Add an internal constant for the composefs image name
authorColin Walters <walters@verbum.org>
Tue, 11 Jul 2023 21:50:43 +0000 (17:50 -0400)
committerColin Walters <walters@verbum.org>
Tue, 11 Jul 2023 21:50:43 +0000 (17:50 -0400)
Just a minor cleanup.

src/libostree/ostree-repo-composefs.c
src/libostree/ostree-sysroot-deploy.c
src/libotcore/otcore.h
src/switchroot/ostree-prepare-root.c

index c6ce5787c96ca4c5783274ac825e4766d9eb01c5..97eb4465675e266579ef900e721afd46d690488d 100644 (file)
@@ -593,7 +593,6 @@ ostree_repo_commit_add_composefs_metadata (OstreeRepo *self, guint format_versio
   /* For now */
   g_assert (format_version == 0);
 
-  /* Create a composefs image and put in deploy dir as .ostree.cfs */
   g_autoptr (OstreeComposefsTarget) target = ostree_composefs_target_new ();
 
   if (!ostree_repo_checkout_composefs (self, target, repo_root, cancellable, error))
index 2454a5877d94680a52fea983d76f69e367c0206e..5628f268e2f7984465819ed3bfb3242070ae09c6 100644 (file)
@@ -46,7 +46,7 @@
 #include "ostree-sepolicy-private.h"
 #include "ostree-sysroot-private.h"
 #include "ostree.h"
-#include "otutil.h"
+#include "otcore.h"
 
 #ifdef HAVE_LIBSYSTEMD
 #define OSTREE_VARRELABEL_ID \
@@ -662,7 +662,7 @@ checkout_deployment_tree (OstreeSysroot *sysroot, OstreeRepo *repo, OstreeDeploy
       g_autoptr (GVariant) metadata_composefs = g_variant_lookup_value (
           metadata, OSTREE_COMPOSEFS_DIGEST_KEY_V0, G_VARIANT_TYPE_BYTESTRING);
 
-      /* Create a composefs image and put in deploy dir as .ostree.cfs */
+      /* Create a composefs image and put in deploy dir */
       g_autoptr (OstreeComposefsTarget) target = ostree_composefs_target_new ();
 
       g_autoptr (GFile) commit_root = NULL;
@@ -674,7 +674,7 @@ checkout_deployment_tree (OstreeSysroot *sysroot, OstreeRepo *repo, OstreeDeploy
         return FALSE;
 
       g_autofree char *composefs_cfs_path
-          = g_strdup_printf ("%s/.ostree.cfs", checkout_target_name);
+          = g_strdup_printf ("%s/" OSTREE_COMPOSEFS_NAME, checkout_target_name);
 
       if (!glnx_open_tmpfile_linkable_at (osdeploy_dfd, checkout_target_name, O_WRONLY | O_CLOEXEC,
                                           &tmpf, error))
index fdbca4932c8109406fb9272a75d58cca78eefcbf..a335fa3db02870bcc4dc3dbe10a4f35eeef03014 100644 (file)
@@ -42,3 +42,6 @@
 bool otcore_ed25519_init (void);
 gboolean otcore_validate_ed25519_signature (GBytes *data, GBytes *pubkey, GBytes *signature,
                                             bool *out_valid, GError **error);
+
+// The name of the composefs metadata root
+#define OSTREE_COMPOSEFS_NAME ".ostree.cfs"
index ea07331bfc877fcb146a786f3735a5a3dd6e3788..ea04ab073a582f870ddc6738986141d7eb483afb 100644 (file)
@@ -79,9 +79,6 @@
 #define FS_VERITY_FL 0x00100000 /* Verity protected inode */
 #define FS_IOC_GETFLAGS _IOR ('f', 1, long)
 
-// The name of the composefs metadata root
-#define OSTREE_COMPOSEFS_NAME ".ostree.cfs"
-
 #if defined(HAVE_LIBSYSTEMD) && !defined(OSTREE_PREPARE_ROOT_STATIC)
 #define USE_LIBSYSTEMD
 #endif