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

bootc switch --stateroot flag #617

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Commits on Sep 10, 2024

  1. cli: support the stateroot option also on switch

    # Background
    
    <hash> added the `stateroot` option to the `install` subcommand
    
    # Issue
    
    The `stateroot` option is not available on the `switch` subcommand
    
    # Solution
    
    Add the `stateroot` option to the `switch` subcommand
    
    # Implementation
    
    * If the stateroot is different than the current, we should allow using
      the same image as the currently booted one
    
    * Stateroot has to be explicitly created (`init_osname` binding) if it
      doesn't exist. If it does, we still call `init_osname` and simply
      ignore the error (TODO: only ignore non-already-exists errors)
    
    * Copy `/var` from the old stateroot to the new one. I'm doing `--reflink`
      but it's still very slow
    
    * Must use the old stateroot to find the `merge_deployment` because
      otherwise we boot without the required kargs (it manifested as a
      missing `root=UUID=...` which caused the dracut rootfs-generator to
      silently fail to create `sysroot.mount` and so `ostree-prepare-root`
      failed due to empty `/sysroot`)
    
    Signed-off-by: Omer Tuchfeld <[email protected]>
    omertuc committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    b8d843d View commit details
    Browse the repository at this point in the history