From: Lennart Poettering Date: Wed, 15 Nov 2023 10:12:38 +0000 (+0100) Subject: gpt-auto-generator: drop in_initrd() check in add_partition_root_rw() X-Git-Tag: v255-rc2~5^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5253b4a99f658785fcdca0d30663259d1543c443;p=thirdparty%2Fsystemd.git gpt-auto-generator: drop in_initrd() check in add_partition_root_rw() This call is never called in the initrd, hence we can drop the extra check, as it is redundant. Let's keep it as an assert() though, as a form of code-enforced documentation. --- diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c index d7747406228..e4c3aeea8a7 100644 --- a/src/gpt-auto-generator/gpt-auto-generator.c +++ b/src/gpt-auto-generator/gpt-auto-generator.c @@ -634,11 +634,9 @@ static int add_partition_root_rw(DissectedPartition *p) { int r; assert(p); + assert(!in_initrd()); - if (in_initrd()) { - log_debug("In initrd, not generating drop-in for systemd-remount-fs.service."); - return 0; - } + /* Invoked on the main system (not initrd), to honour GPT flag 60 on the root fs (ro) */ if (arg_root_rw >= 0) { log_debug("Parameter ro/rw specified on kernel command line, not generating drop-in for systemd-remount-fs.service.");