Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] initramfs-framework: support LABEL with root-only udev trigger
@ 2026-08-26  9:25 Wenwen Fu
  2026-08-27 13:04 ` Paul Barker
  2026-08-27 15:11 ` [PATCH v2] " Wenwen Fu
  0 siblings, 2 replies; 5+ messages in thread
From: Wenwen Fu @ 2026-08-26  9:25 UTC (permalink / raw)
  To: openembedded-core; +Cc: Wenwen Fu

Filesystem labels are not available in kernel uevents. Enable the
BusyBox findfs applet and use it to resolve root=LABEL= to a device.
Read the kernel-provided PARTUUID from sysfs and trigger only that
partition. Fall back to the full trigger when the label cannot be
resolved safely.

Signed-off-by: Wenwen Fu <wenwfu@qti.qualcomm.com>
---
 meta/recipes-core/busybox/busybox/defconfig          |  2 +-
 .../initrdscripts/initramfs-framework/udev           | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/busybox/busybox/defconfig b/meta/recipes-core/busybox/busybox/defconfig
index 1f4b5e3d1e..a282370a8f 100644
--- a/meta/recipes-core/busybox/busybox/defconfig
+++ b/meta/recipes-core/busybox/busybox/defconfig
@@ -634,7 +634,7 @@ CONFIG_FEATURE_FDISK_WRITABLE=y
 # CONFIG_FEATURE_OSF_LABEL is not set
 # CONFIG_FEATURE_GPT_LABEL is not set
 # CONFIG_FEATURE_FDISK_ADVANCED is not set
-# CONFIG_FINDFS is not set
+CONFIG_FINDFS=y
 CONFIG_FLOCK=y
 # CONFIG_FDFLUSH is not set
 # CONFIG_FREERAMDISK is not set
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
 			;;
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-28 13:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-26  9:25 [PATCH] initramfs-framework: support LABEL with root-only udev trigger Wenwen Fu
2026-08-27 13:04 ` Paul Barker
2026-08-27 14:25   ` Wenwen Fu
2026-08-27 15:11 ` [PATCH v2] " Wenwen Fu
2026-08-28 13:05   ` [OE-core] " Mathieu Dubois-Briand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox