]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
gpt-auto-generator: drop in_initrd() check in add_partition_root_rw()
authorLennart Poettering <lennart@poettering.net>
Wed, 15 Nov 2023 10:12:38 +0000 (11:12 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 15 Nov 2023 12:20:53 +0000 (13:20 +0100)
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.

src/gpt-auto-generator/gpt-auto-generator.c

index d774740622816a869072a242a06cf3a203324a4c..e4c3aeea8a7777fa130e58f3b04fb41d89b14a3c 100644 (file)
@@ -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.");