[OE-core] [PATCH] initramfs-framework: rootfs: add support for LABEL

Ricardo Salveti ricardo at opensourcefoundries.com
Fri Feb 9 01:41:18 UTC 2018


The rootfs can also be found via the partition label.

Signed-off-by: Ricardo Salveti <ricardo at opensourcefoundries.com>
---
 meta/recipes-core/initrdscripts/initramfs-framework/rootfs | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/rootfs b/meta/recipes-core/initrdscripts/initramfs-framework/rootfs
index 14768f1..76fa84d 100644
--- a/meta/recipes-core/initrdscripts/initramfs-framework/rootfs
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/rootfs
@@ -31,6 +31,11 @@ rootfs_run() {
 				bootparam_root="/dev/disk/by-partuuid/$root_uuid"
 			fi
 
+			if [ "`echo ${bootparam_root} | cut -c1-6`" = "LABEL=" ]; then
+				root_label=`echo $bootparam_root | cut -c7-`
+				bootparam_root="/dev/disk/by-label/$root_label"
+			fi
+
 			if [ -e "$bootparam_root" ]; then
 				flags=""
 				if [ -n "$bootparam_ro" ] && ! echo "$bootparam_rootflags" | grep -w -q "ro"; then
-- 
2.7.4




More information about the Openembedded-core mailing list