Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a finalrd script to move filesystems #124

Commits on Dec 1, 2021

  1. Add a finalrd script to move filesystems

    `/mnt/run/base` contains the snap file that is mounted on `/`. For
    that reason it is not possible to unmount `/mnt/run/base` until we
    have 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 after
    `systemd-shutdown`. That means we cannot run a hook after the root
    switch and before `systemd-shutdown`. For that reason the
    finalrd 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 to
    unmount.
    
    Also, there is still an error message when systemd tries to umount
    `/mnt/run/base` before switching root. There does not seem to be
    anyway to make `mnt-run-base.mount` perpetual.
    valentindavid committed Dec 1, 2021
    Configuration menu
    Copy the full SHA
    3a4c52f View commit details
    Browse the repository at this point in the history