]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: Generate fstab and crypttab late
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 12 Jan 2026 16:05:59 +0000 (17:05 +0100)
committerVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 19 Jan 2026 10:29:00 +0000 (11:29 +0100)
The immediate need for the change is to allow to capture the expected
LUKS volume key hash and record it to the generated crypttab but it
also seems to make sense to not generate crypttab/fstab before we know
that partition creation succeeded as fstab/crypttab entries are bogus
otherwise.

src/repart/repart.c

index 19bd3441caab29ecd57dbf83ffad5576fd11cb09..7c19f1028775b4d9673197e7383b382fa2143657 100644 (file)
@@ -10719,14 +10719,6 @@ static int run(int argc, char *argv[]) {
         if (r < 0)
                 return r;
 
-        r = context_fstab(context);
-        if (r < 0)
-                return r;
-
-        r = context_crypttab(context);
-        if (r < 0)
-                return r;
-
         r = context_update_verity_size(context);
         if (r < 0)
                 return r;
@@ -10782,6 +10774,14 @@ static int run(int argc, char *argv[]) {
         if (r < 0)
                 return r;
 
+        r = context_fstab(context);
+        if (r < 0)
+                return r;
+
+        r = context_crypttab(context);
+        if (r < 0)
+                return r;
+
         (void) context_dump(context, /* late= */ true);
 
         context_disarm_auto_removal(context);