summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-11-15 11:14:11 +0100
committerLennart Poettering <lennart@poettering.net>2023-11-15 13:21:06 +0100
commitca8ac0f9b5479eb98fad6d364303f9d6d38f410c (patch)
treedf9ffb84de17e30a27c97a6edad77b24fabfeb8e
parentgpt-auto-generator: drop in_initrd() check in add_partition_root_rw() (diff)
downloadsystemd-ca8ac0f9b5479eb98fad6d364303f9d6d38f410c.tar.xz
systemd-ca8ac0f9b5479eb98fad6d364303f9d6d38f410c.zip
gpt-auto-generator: add comment + assert() explaining mode of invocation
We are not invoked in the initrd, and that deserves a comment.
-rw-r--r--src/gpt-auto-generator/gpt-auto-generator.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index e4c3aeea8a..d1f6688f4c 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -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",