From: Lennart Poettering Date: Wed, 5 Mar 2025 15:13:02 +0000 (+0100) Subject: udev-builtin-blkid: ignore root partitions with name "_empty" X-Git-Tag: v258-rc1~1165 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=729620b8467effa4b93913a8ffc6f626e1603f03;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 6cd320d8979..ef3a456ea7f 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -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; diff --git a/src/udev/udev-builtin-blkid.c b/src/udev/udev-builtin-blkid.c index e15c97903ef..3dc8c057e58 100644 --- a/src/udev/udev-builtin-blkid.c +++ b/src/udev/udev-builtin-blkid.c @@ -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. */