From: Colin Walters Date: Sun, 23 Jul 2023 18:39:04 +0000 (-0400) Subject: prepare-root: Don't parse target root when composefs enabled X-Git-Tag: archive/raspbian/2023.7-3+rpi1~1^2~9^2^2~37^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=34656260154ad9affcd4d60c568d06c82b7149a6;p=ostree.git prepare-root: Don't parse target root when composefs enabled We shouldn't load anything from the target root filesystem *before* verifying its integrity if composefs is enabled. In effect, we want to force composefs users to migrate to `/usr/lib/ostree/prepare-root.conf` which lives in the initramfs. (But because we enable sysroot.readonly=true if composefs is enabled too, they don't actually need to) --- diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c index c0f9d753..bf5de00a 100644 --- a/src/switchroot/ostree-prepare-root.c +++ b/src/switchroot/ostree-prepare-root.c @@ -376,8 +376,10 @@ main (int argc, char *argv[]) /* Fall back to querying the repository configuration in the target disk. * This is an operating system builder choice. More info: * https://github.com/ostreedev/ostree/pull/1767 + * However, we only do this if composefs is not enabled, because we don't + * want to parse the target root filesystem before verifying its integrity. */ - if (!sysroot_readonly) + if (!sysroot_readonly && composefs_config->enabled != OT_TRISTATE_YES) { sysroot_readonly = sysroot_is_configured_ro (root_arg); // Encourage porting to the new config file