]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
gpt-auto-generator: add comment + assert() explaining mode of invocation
authorLennart Poettering <lennart@poettering.net>
Wed, 15 Nov 2023 10:14:11 +0000 (11:14 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 15 Nov 2023 12:21:06 +0000 (13:21 +0100)
We are not invoked in the initrd, and that deserves a comment.

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

index e4c3aeea8a7777fa130e58f3b04fb41d89b14a3c..d1f6688f4ca6db0c1c32ddef87c0f805a4d0a51f 100644 (file)
@@ -793,6 +793,11 @@ static int enumerate_partitions(dev_t devnum) {
         _cleanup_free_ char *devname = NULL;
         int r;
 
+        assert(!in_initrd());
+
+        /* Run on the final root fs (not in the initrd), to mount auxiliary partitions, and hook in rw
+         * remount and growfs of the root partition */
+
         r = block_get_whole_disk(devnum, &devnum);
         if (r < 0)
                 return log_debug_errno(r, "Failed to get whole block device for " DEVNUM_FORMAT_STR ": %m",