Filesystem labels are not available in kernel uevents. Add util-linux-findfs to initramfs-module-udev and use findfs to resolve root=LABEL= to a device. Read the kernel-provided PARTUUID from sysfs and trigger only that partition, falling back to a full trigger if the label cannot be resolved safely. Keeping findfs out of the BusyBox defconfig avoids increasing BusyBox for unrelated users.
Tested with bitbake -p and by generating the core-image-minimal-initramfs dependency graph. AI-Generated: OpenAI Codex Signed-off-by: Wenwen Fu <[email protected]> --- Changes in v2: - Keep findfs out of the default BusyBox configuration. - Add util-linux-findfs as an initramfs-module-udev runtime dependency. --- .../initrdscripts/initramfs-framework/udev | 12 ++++++++++++ .../initrdscripts/initramfs-framework_1.0.bb | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/udev b/meta/recipes-core/initrdscripts/initramfs-framework/udev index 8f67e78a7c..85c5ba1178 100644 --- a/meta/recipes-core/initrdscripts/initramfs-framework/udev +++ b/meta/recipes-core/initrdscripts/initramfs-framework/udev @@ -43,6 +43,18 @@ udev_trigger_root_device() { PARTUUID=?*) root_match="PARTUUID=${bootparam_root#PARTUUID=}" ;; + LABEL=?*) + # The kernel does not export the filesystem LABEL in the + # uevent, so resolve it to a device node with findfs and + # match on that device's kernel-provided PARTUUID. + root_label="${bootparam_root#LABEL=}" + root_dev=$(findfs "LABEL=$root_label" 2>/dev/null) || return 1 + [ -n "$root_dev" ] || return 1 + root_partuuid=$(sed -n 's/^PARTUUID=//p' \ + "/sys/class/block/${root_dev#/dev/}/uevent" 2>/dev/null) + [ -n "$root_partuuid" ] || return 1 + root_match="PARTUUID=$root_partuuid" + ;; *) return 1 ;; diff --git a/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb index 2ec03bc34c..936cd0c995 100644 --- a/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb +++ b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb @@ -88,7 +88,7 @@ RDEPENDS:initramfs-module-mdev = "${PN}-base busybox-mdev" FILES:initramfs-module-mdev = "/init.d/01-mdev" SUMMARY:initramfs-module-udev = "initramfs support for udev" -RDEPENDS:initramfs-module-udev = "${PN}-base udev" +RDEPENDS:initramfs-module-udev = "${PN}-base udev util-linux-findfs" FILES:initramfs-module-udev = "/init.d/01-udev" SUMMARY:initramfs-module-e2fs = "initramfs support for ext4/ext3/ext2 filesystems" -- 2.43.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#244498): https://lists.openembedded.org/g/openembedded-core/message/244498 Mute This Topic: https://lists.openembedded.org/mt/120957667/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
