From 15b1c334dff04708e2ba6ba712a1474f0128563c Mon Sep 17 00:00:00 2001 From: Vitaly Kuznetsov Date: Mon, 12 Jan 2026 17:05:59 +0100 Subject: [PATCH] repart: Generate fstab and crypttab late 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 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/repart/repart.c b/src/repart/repart.c index 19bd3441caa..7c19f102877 100644 --- a/src/repart/repart.c +++ b/src/repart/repart.c @@ -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); -- 2.47.3