ostree/tests/kolainst/destructive
Jonathan Lebon c561e6179e lib/sysroot-deploy: Add experimental support for automatic early prune
During the early design of FCOS and RHCOS, we chose a value of 384M
for the boot partition. This turned out to be too small: some arches
other than x86_64 have larger initrds, kernel binaries, or additional
artifacts (like device tree blobs). We'll likely bump the boot partition
size in the future, but we don't want to abandon all the nodes deployed
with the current size.[[1]]

Because stale entries in `/boot` are cleaned up after new entries are
written, there is a window in the update process during which the bootfs
temporarily must host all the `(kernel, initrd)` pairs for the union of
current and new deployments.

This patch determines if the bootfs is capable of holding all the
pairs. If it can't but it could hold all the pairs from just the new
deployments, the outgoing deployments (e.g. rollbacks) are deleted
*before* new deployments are written. This is done by updating the
bootloader in two steps to maintain atomicity.

Since this is a lot of new logic in an important section of the
code, this feature is gated for now behind an environment variable
(`OSTREE_ENABLE_AUTO_EARLY_PRUNE`). Once we gain more experience with
it, we can consider turning it on by default.

This strategy increases the fallibility of the update system since one
would no longer be able to rollback to the previous deployment if a bug
is present in the bootloader update logic after auto-pruning (see [[2]]
and following). This is however mitigated by the fact that the heuristic
is opportunistic: the rollback is pruned *only if* it's the only way for
the system to update.

[1]: https://github.com/coreos/fedora-coreos-tracker/issues/1247
[2]: https://github.com/ostreedev/ostree/issues/2670#issuecomment-1179341883

Closes: #2670
2023-05-01 12:12:03 -04:00
..
auto-prune.sh lib/sysroot-deploy: Add experimental support for automatic early prune 2023-05-01 12:12:03 -04:00
basic-misc.sh main: Also support CLI extensions in /usr/libexec/libostree/ext 2022-01-11 20:13:33 -05:00
boot-automount.sh finalize-staged: Ensure /boot automount doesn't expire 2022-08-30 09:16:39 -06:00
data tests/kolainst: Avoid recursive symlinks 2022-01-25 16:44:39 -05:00
deployment-lint deploy: Warn if we find content in the deployment's /var 2021-06-10 07:33:17 -04:00
itest-bare-root.sh tests/kola: Move to tests/kolainst 2020-05-27 15:16:50 +00:00
itest-deploy-selinux.sh tests/kola: Move to tests/kolainst 2020-05-27 15:16:50 +00:00
itest-label-selinux.sh bin/commit: Fix --tree=tar with --selinux-policy 2021-09-30 11:44:27 -04:00
kargs-edit-in-place.sh Fix ostree admin kargs edit-in-place assertion when deployments 2022-08-29 11:31:32 +08:00
overlay-initrds.sh lib/deploy: Add support for overlay initrds 2020-09-30 13:29:32 -04:00
staged-delay.sh ci: Fix staged-delay to work with newer systemd 2021-05-25 16:28:32 -04:00
staged-deploy.sh tests/kolainst/staged-deploy: parse rpm-ostree status --json instead 2022-08-15 17:50:11 -04:00
unlock-transient.sh Add "transient" unlock 2020-08-07 18:57:56 +00:00
var-mount.sh tests/var-mount: tweak test setup 2021-10-19 08:03:09 +00:00