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

40ignition-ostree: add coreos-inject-rootmap.service #503

Merged
merged 10 commits into from
Aug 27, 2020

Commits on Aug 20, 2020

  1. 40ignition-ostree: Initial support for rootfs replacement

    This adds basic infrastructure units for "re-provisioning"
    the root filesystem.  See:
    coreos/fedora-coreos-tracker#94
    
    A unit first detects if the Ignition configuration has a filesystem
    with the label `root` - if so, we save the rootfs into RAM, let
    `ignition-disks.service` run, then restore it from RAM.
    
    Earlier attempts used the `brd` kernel module which is a RAM-backed
    block device so we can just `dd`.  However, this has some limitations,
    such as the need to save the full disk in RAM, and the inability for any
    other initrd code to use `brd` devices. As well, `brd` doesn't support
    discards, so we require at minimum $rootfs_size RAM (e.g. 3G) until
    reprovisioning is complete.
    
    Future work here will likely move the `restore` phase into `rpm-ostree`.
    
    Co-authored-by: Jonathan Lebon <jonathan@jlebon.com>
    cgwalters and jlebon committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    a4c5bc6 View commit details
    Browse the repository at this point in the history
  2. 40ignition-ostree: Regenerate UUIDs for /boot and /

    This is a general best practice; the intention of filesystem
    UUIDs is that they're unique.  It helps backup systems and the like
    if we change this.
    
    This builds on coreos/coreos-assembler@e3905fd
    
    In the future, we may also switch to using these UUIDs for subsequent
    boots; see: coreos/fedora-coreos-tracker#465
    cgwalters authored and jlebon committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    324307b View commit details
    Browse the repository at this point in the history
  3. 40ignition-ostree: add coreos-inject-rootmap.service

    This implements the rootmap functionality that figures out all the
    dependencies required to find `/sysroot`, and injects them into the BLS
    config. For more information, see:
    
    coreos/fedora-coreos-tracker#94 (comment)
    
    The `rdcore` code supports RAID and LUKS devices, though the latter
    needs a new Clevis release with the following patches to be fully
    supported:
    
    latchset/clevis#211
    latchset/clevis#217
    
    This also implements the `root=UUID=$uuid` inject patch proposed in
    coreos/fedora-coreos-tracker#465.
    
    On its own, this unlocks reprovisioning FCOS with root on a RAID device,
    or e.g. in-place reprovisioning of root on btrfs.
    
    Closes: coreos/fedora-coreos-tracker#465
    Closes: coreos/fedora-coreos-tracker#94
    jlebon committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    e92eb54 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5461a0a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    78caf63 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    45da6b8 View commit details
    Browse the repository at this point in the history
  7. 40ignition-ostree: put growpart stamp file in /run

    This stamp file was used to make sure coreos-growpart only ran on the
    first boot when it ran in the real root. Nowadays, it runs in the
    initramfs as part of `ignition-complete.target` before we even run
    `ostree-prepare-root` (which meant we were actually creating the stamp
    file in the initrd filesystem).
    
    Having a stamp file is useful though for writing tests. So let's
    repurpose the idea and put it in `/run` instead.
    jlebon committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    c883e29 View commit details
    Browse the repository at this point in the history
  8. Add root reprovisioning tests

    Add two basic tests: one where we reprovision in place to ext4, and one
    where we reprovision onto a separate RAID1.
    jlebon committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    0ba1a3e View commit details
    Browse the repository at this point in the history
  9. 40ignition-ostree: drop unnecessary inst_simple

    That generator no longer exists.
    jlebon committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    46196f9 View commit details
    Browse the repository at this point in the history
  10. 40ignition-ostree: split out coreos-rootflags script

    Split out a small script where the canonical rootflags live in the
    non-reprovisioning case. This will be used by both
    `ignition-ostree-mount-sysroot` and `rdcore rootmap`.
    jlebon committed Aug 20, 2020
    Configuration menu
    Copy the full SHA
    faa02d6 View commit details
    Browse the repository at this point in the history