Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So, I did some research related to the systemd.volatile=overlay option in #2972 (comment)
An in-place mount of /var is pretty easy but it has unwanted side-effects. While for ostree another dependency at src/boot/ostree-prepare-root.service should be no issue, the problem is in ignition-ostree-mount-var.service which executes src/config/overlay.d/05core/usr/lib/dracut/modules.d/40ignition-ostree/ignition-ostree-mount-var.sh
During do_mount various checks are run which all fail if we do an inplace mount of /var somewhere else (such as /inplace/var/). So we have to tweak the setup in order to match the expectations of this unit by making
/sysroot/${ostree}
a symlink and${deployment_path}/../../var
a directory.This is problematic because when ostree-prepare-root is run, ostree karg in
/proc/cmdline
evaluates to something different compared to the execution of ignition-ostree-mount-var.service.Thus it is not possible to fake a directory structure that would pass the tests during ostree-prepare-root. From what I understand, this means I would need to modify the ignition-ostree-mount-var.service (or execute a dependency before running this service) but I do not understand the impact of changing this to something like:
Additionally, building an image with this causes selinux to wrack havoc too. So running
cosa run -c --kargs "enforcing=0 systemd.volatile=overlay"
seems to be the only option actually being able to log in because otherwise I get:boot.log
@alexlarsson @cgwalters wdyt, is adding another dependency a feasible approach or is it okay to modify ignition-ostree-mount-var.service (I am afraid that this might introduce a breaking change somewhere).