From 1d316e31093e33eff6c3ae7f8081547ef93e72ed Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 21 Aug 2023 17:11:32 -0400 Subject: [PATCH] prepare-root: Init composefs options earlier Prep for a later patch. --- src/switchroot/ostree-prepare-root.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/switchroot/ostree-prepare-root.c b/src/switchroot/ostree-prepare-root.c index 50ea0e92..682e71ea 100644 --- a/src/switchroot/ostree-prepare-root.c +++ b/src/switchroot/ostree-prepare-root.c @@ -436,6 +436,11 @@ main (int argc, char *argv[]) 1, }; + cfs_options.flags = LCFS_MOUNT_FLAGS_READONLY; + cfs_options.image_mountdir = OSTREE_COMPOSEFS_LOWERMNT; + if (mkdirat (AT_FDCWD, OSTREE_COMPOSEFS_LOWERMNT, 0700) < 0) + err (EXIT_FAILURE, "Failed to create %s", OSTREE_COMPOSEFS_LOWERMNT); + g_autofree char *expected_digest = NULL; if (composefs_config->is_signed) @@ -476,11 +481,6 @@ main (int argc, char *argv[]) ot_bin2hex (expected_digest, cfs_digest_buf, g_variant_get_size (cfs_digest_v)); } - cfs_options.flags = LCFS_MOUNT_FLAGS_READONLY; - cfs_options.image_mountdir = OSTREE_COMPOSEFS_LOWERMNT; - if (mkdirat (AT_FDCWD, OSTREE_COMPOSEFS_LOWERMNT, 0700) < 0) - err (EXIT_FAILURE, "Failed to create %s", OSTREE_COMPOSEFS_LOWERMNT); - if (expected_digest != NULL) { cfs_options.flags |= LCFS_MOUNT_FLAGS_REQUIRE_VERITY; -- 2.30.2