From 29423a893c2a179eb7f64afd9800a474cda71d5a Mon Sep 17 00:00:00 2001 From: Eric Curtin Date: Thu, 24 Aug 2023 15:20:25 +0100 Subject: [PATCH] prepare-root: If composefs is configured as "maybe" don't fail If composefs is configured as "maybe", we should continue even if composefs support is not built in. --- src/switchroot/ostree-prepare-root.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c index 62ea5617..54a55c1d 100644 --- a/src/switchroot/ostree-prepare-root.c +++ b/src/switchroot/ostree-prepare-root.c @@ -424,11 +424,11 @@ main (int argc, char *argv[]) // Tracks if we did successfully enable it at runtime bool using_composefs = false; +#ifdef HAVE_COMPOSEFS /* We construct the new sysroot in /sysroot.tmp, which is either the composfs mount or a bind mount of the deploy-dir */ if (composefs_config->enabled != OT_TRISTATE_NO) { -#ifdef HAVE_COMPOSEFS const char *objdirs[] = { "/sysroot/ostree/repo/objects" }; g_autofree char *cfs_digest = NULL; struct lcfs_mount_options_s cfs_options = { @@ -532,10 +532,12 @@ main (int argc, char *argv[]) errx (EXIT_FAILURE, "composefs: failed to mount: %s", errmsg); } } -#else - errx (EXIT_FAILURE, "composefs: enabled at runtime, but support is not compiled in"); -#endif } +#else + /* if composefs is configured as "maybe", we should continue */ + if (composefs_config->enabled == OT_TRISTATE_YES) + errx (EXIT_FAILURE, "composefs: enabled at runtime, but support is not compiled in"); +#endif if (!using_composefs) {