From: Jonathan Lebon Date: Sat, 14 Dec 2024 13:47:21 +0000 (-0500) Subject: lib/deploy: error out if composefs enabled but unsupported X-Git-Tag: archive/raspbian/2024.10-1+rpi1^2~6^2^2~2^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=41a7f36f8e0aefd154c8eeea57dd7ab1e7064dac;p=ostree.git lib/deploy: error out if composefs enabled but unsupported If composefs was explicitly requested (`enabled = true`) but libostree was not compiled with composefs support, error out at deploy time. This matches the logic in `ostree-prepare-root`. --- diff --git a/src/libostree/ostree-sysroot-deploy.c b/src/libostree/ostree-sysroot-deploy.c index 2dd57dc6..5c52e64b 100644 --- a/src/libostree/ostree-sysroot-deploy.c +++ b/src/libostree/ostree-sysroot-deploy.c @@ -640,9 +640,6 @@ checkout_deployment_tree (OstreeSysroot *sysroot, OstreeRepo *repo, OstreeDeploy if (!glnx_opendirat (osdeploy_dfd, checkout_target_name, TRUE, &ret_deployment_dfd, error)) return FALSE; - guint64 composefs_start_time = 0; - guint64 composefs_end_time = 0; -#ifdef HAVE_COMPOSEFS /* TODO: Consider changing things in the future to parse the deployment config from memory, and * if composefs is enabled, then we can check out in "user mode" (i.e. only have suid binaries * enabled in composefs, etc.) @@ -667,6 +664,10 @@ checkout_deployment_tree (OstreeSysroot *sysroot, OstreeRepo *repo, OstreeDeploy g_debug ("composefs enabled by config: %d repo: %d", composefs_enabled, repo->composefs_wanted); if (repo->composefs_wanted == OT_TRISTATE_YES) composefs_enabled = repo->composefs_wanted; + + guint64 composefs_start_time = 0; + guint64 composefs_end_time = 0; +#ifdef HAVE_COMPOSEFS if (composefs_enabled != OT_TRISTATE_NO) { composefs_start_time = g_get_monotonic_time (); @@ -694,6 +695,9 @@ checkout_deployment_tree (OstreeSysroot *sysroot, OstreeRepo *repo, OstreeDeploy } else g_debug ("not using composefs"); +#else + if (composefs_enabled == OT_TRISTATE_YES) + return glnx_throw (error, "composefs: enabled at runtime, but support is not compiled in"); #endif *checkout_elapsed = (checkout_end_time - checkout_start_time);