prepare-root: Init composefs options earlier

Prep for a later patch.
This commit is contained in:
Colin Walters 2023-08-21 17:11:32 -04:00
parent aa9b7c3b1b
commit 1d316e3109

View File

@ -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;