Add a finalrd script to move filesystems #124
Closed
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.
/mnt/run/base
contains the snap file that is mounted on/
. Forthat reason it is not possible to unmount
/mnt/run/base
until wehave switched root to the shutdown ramfs.
At this point before we move
/sysroot/mnt/run/base
out of/sysroot
so that
systemd-shutdown
is able to unmount all filesystems.systemd-shutdown
allows hooks. But they are called right aftersystemd-shutdown
. That means we cannot run a hook after the rootswitch and before
systemd-shutdown
. For that reason thefinalrd hook replaces
systemd-shutdown
in the ramfs by a wrapper.This solution is not elegant. In the long term we should try to make
systemd-shutdown
always move all sub mount points before trying tounmount.
Also, there is still an error message when systemd tries to umount
/mnt/run/base
before switching root. There does not seem to beanyway to make
mnt-run-base.mount
perpetual.