diff options
author | Jonathan Lebon <jonathan@jlebon.com> | 2023-04-13 17:22:43 -0400 |
---|---|---|
committer | Jonathan Lebon <jonathan@jlebon.com> | 2023-05-01 12:12:03 -0400 |
commit | c561e6179e965d11bba7e1d80ca35b7ad6fc7bc5 (patch) | |
tree | 48a8bb83b42517a65701c960942aac960504e1fb /Makefile-boot.am | |
parent | fd3304e98760f4d8413af6181a77d0e1d955dbe8 (diff) | |
download | ostree-c561e6179e965d11bba7e1d80ca35b7ad6fc7bc5.tar.gz |
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
Diffstat (limited to 'Makefile-boot.am')
0 files changed, 0 insertions, 0 deletions