udev-builtin-blkid: ignore root partitions with name "_empty"

This is how sysupdate marks empty partitions, hence ignore that.

Kinda a follow-up for 54ae0edc4a
This commit is contained in:
Lennart Poettering
2025-03-05 16:13:02 +01:00
parent 5c9feb2d6e
commit 729620b846
2 changed files with 6 additions and 0 deletions

View 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;

View 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. */