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 autosave-xfs transposefs unit #2320

Merged
merged 7 commits into from
Apr 6, 2023

Commits on Apr 6, 2023

  1. 40ignition-ostree: run ignition-ostree-growfs before sysroot mount

    Prep for automatic XFS reprovisioning.
    
    The only way to know for sure whether the rootfs should be reprovisioned
    is analyzing it after the filesystem was grown. We could do calculations
    beforehand, but it'd get complex having to analyze the partition table.
    
    Anyway, the partition growing and e.g. LUKS container resizing need
    to happen before automatic reprovisioning and ignition-ostree-growfs
    already knows how to do that.
    jlebon committed Apr 6, 2023
    Configuration menu
    Copy the full SHA
    f39857f View commit details
    Browse the repository at this point in the history
  2. 40ignition-ostree: factor out zram-related functions

    No functional change.
    Prep for future patch.
    jlebon committed Apr 6, 2023
    Configuration menu
    Copy the full SHA
    9b70797 View commit details
    Browse the repository at this point in the history
  3. 40ignition-ostree: skip udev hack if Ignition did not reprovision rootfs

    Currently, this code only executes via Ignition reprovisioning the
    rootfs, but we're about to add code to reprovision the rootfs outside of
    that path. In that case, we don't need to query the Ignition config.
    jlebon committed Apr 6, 2023
    Configuration menu
    Copy the full SHA
    39f64dc View commit details
    Browse the repository at this point in the history
  4. 40ignition-ostree: add autosave-xfs transposefs unit

    Add a new transposefs unit: `autosave-xfs`. This unit runs after
    `ignition-disks` and `ignition-ostree-growfs,` but before the `restore`
    transposefs unit.
    
    If the XFS root was grown, it checks if the allocation group count
    (agcount) is within a reasonable amount (128 is chosen here). If
    it isn't, it saves the rootfs and reformats the filesystem. The
    `restore` unit will then restore it as usual. In the case of in-place
    reprovisioning like LUKS (i.e. where the partition table isn't modified
    by the Ignition config), the rootfs is still saved only once.
    
    Ideally, instead of adding a new transposefs unit, we would make it
    part of the initial `save` unit. But at that point, there's no way to
    tell whether we should autosave without gazing even more deeply into the
    Ignition config. We also don't want to unconditionally save the rootfs
    when we may not need it.
    
    Closes: coreos/fedora-coreos-tracker#1183
    jlebon committed Apr 6, 2023
    Configuration menu
    Copy the full SHA
    3107c60 View commit details
    Browse the repository at this point in the history
  5. tests/kola: add non-exclusive check for growfs

    We weren't checking anywhere in the non-reprovisioning case that we grow
    the root filesystem on first boot. Add a trivial test for this.
    jlebon committed Apr 6, 2023
    Configuration menu
    Copy the full SHA
    298a03e View commit details
    Browse the repository at this point in the history
  6. tests/kola: move LUKS checks to shared file

    Prep for adding another LUKS where we want the same checks.
    jlebon committed Apr 6, 2023
    Configuration menu
    Copy the full SHA
    5a5edfe View commit details
    Browse the repository at this point in the history
  7. tests/kola: add autosave-xfs tests

    Add a new `ext.config.root-reprovision.autosave-xfs` test that checks
    that the logic kicks in on a large enough disk. Add a similar
    `ext.config.root-reprovision.luks.autosave-xfs` for the LUKS version
    of this.
    
    Sanity-check in other reprovisioning tests that autosave-xfs didn't
    kick in.
    jlebon committed Apr 6, 2023
    Configuration menu
    Copy the full SHA
    2a3c4aa View commit details
    Browse the repository at this point in the history