]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev-builtin-blkid: ignore root partitions with name "_empty"
authorLennart Poettering <lennart@poettering.net>
Wed, 5 Mar 2025 15:13:02 +0000 (16:13 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 6 Mar 2025 13:05:14 +0000 (14:05 +0100)
This is how sysupdate marks empty partitions, hence ignore that.

Kinda a follow-up for 54ae0edc4aabb6017f6169b1eac5faf0a407d67b

src/shared/dissect-image.c
src/udev/udev-builtin-blkid.c

index 6cd320d8979387ba0304dcbd9da02140cf6ee49d..ef3a456ea7fa4e08cf0613793c0249ecf5ae4f8b 100644 (file)
@@ -1001,6 +1001,8 @@ static int dissect_image(
                         type = gpt_partition_type_from_uuid(type_id);
 
                         label = blkid_partition_get_name(pp); /* libblkid returns NULL here if empty */
+
+                        /* systemd-sysupdate expects empty partitions to be marked with an "_empty" label, hence ignore them here. */
                         if (streq_ptr(label, "_empty"))
                                 continue;
 
index e15c97903efb9bff8452eb2d14d04bb229e43268..3dc8c057e588c61f8d21ab6b161f07972569ee12 100644 (file)
@@ -212,6 +212,10 @@ static int find_gpt_root(UdevEvent *event, blkid_probe pr, const char *loop_back
                         if (flags & SD_GPT_FLAG_NO_AUTO)
                                 continue;
 
+                        /* systemd-sysupdate expects empty partitions to be marked with an "_empty" label, hence ignore them here. */
+                        if (streq_ptr(label, "_empty"))
+                                continue;
+
                         /* We found a suitable root partition, let's remember the first one, or the one with
                          * the newest version, as determined by comparing the partition labels. */