1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-31 14:50:15 +03:00

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

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

Kinda a follow-up for 54ae0edc4aabb6017f6169b1eac5faf0a407d67b
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. */