summaryrefslogtreecommitdiff
path: root/src/libostree/ostree-sysroot.h
diff options
context:
space:
mode:
authorJonathan Lebon <jonathan@jlebon.com>2023-04-13 17:22:43 -0400
committerJonathan Lebon <jonathan@jlebon.com>2023-05-01 12:12:03 -0400
commitc561e6179e965d11bba7e1d80ca35b7ad6fc7bc5 (patch)
tree48a8bb83b42517a65701c960942aac960504e1fb /src/libostree/ostree-sysroot.h
parentfd3304e98760f4d8413af6181a77d0e1d955dbe8 (diff)
downloadostree-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 'src/libostree/ostree-sysroot.h')
-rw-r--r--src/libostree/ostree-sysroot.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libostree/ostree-sysroot.h b/src/libostree/ostree-sysroot.h
index 23c7139a..b159020d 100644
--- a/src/libostree/ostree-sysroot.h
+++ b/src/libostree/ostree-sysroot.h
@@ -193,6 +193,7 @@ gboolean ostree_sysroot_write_deployments (OstreeSysroot *self,
typedef struct {
gboolean do_postclean;
+ gboolean disable_auto_early_prune;
gboolean unused_bools[7];
int unused_ints[7];
gpointer unused_ptrs[7];