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

lib/deploy: Add support for overlay initrds #2155

Merged
merged 3 commits into from
Oct 2, 2020

Commits on Sep 30, 2020

  1. lib/bootconfig: Add support for multiple initrd keys

    Prep for actually teaching the rest of the codebase about this.
    
    We keep the primary initrd in the `options` hash table for backwards
    compatibility.
    jlebon committed Sep 30, 2020
    Configuration menu
    Copy the full SHA
    f7500bb View commit details
    Browse the repository at this point in the history
  2. lib/deploy: Add deploy/stage APIs with options

    And make the `override_kernel_argv` one of those options. This is mostly
    a mechanical move here, no functional change otherwise.
    
    Prep for adding a new option.
    jlebon committed Sep 30, 2020
    Configuration menu
    Copy the full SHA
    40fea4c View commit details
    Browse the repository at this point in the history
  3. lib/deploy: Add support for overlay initrds

    In FCOS and RHCOS, the need to configure software in the initramfs has
    come up multiple times. Sometimes, using kernel arguments suffices.
    Other times, it really must be a configuration file. Rebuilding the
    initramfs on the client-side however is a costly operation. Not only
    does it add complexity to the update workflow, it also erodes a lot of
    the value obtained from using the baked "blessed" initramfs from the
    tree itself.
    
    One elegant way to address this is to allow specifying multiple
    initramfses. This is supported by most bootloaders (notably GRUB) and
    results in each initrd being overlayed on top of each other.
    
    This patch allows libostree clients to leverage this so that they can
    avoid regenerating the initramfs entirely. libostree itself is agnostic
    as to what kind and how much data overlay initrds contain. It's up to
    the clients to enforce such boundaries.
    
    To implement this, we add a new ostree_sysroot_stage_overlay_initrd
    which takes a file descriptor and returns a checksum. Then users can
    pass these checksums when calling the deploy APIs via the new array
    option `overlay_initrds`. We copy these files into `/boot` and add them
    to the BLS as another `initrd` entry.
    jlebon committed Sep 30, 2020
    Configuration menu
    Copy the full SHA
    81b13da View commit details
    Browse the repository at this point in the history