From: Diego Rondini Date: Mon, 16 Sep 2019 13:23:15 +0000 (+0200) Subject: initramfs-framework: support PARTLABEL option X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~13210 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e714b8982c2decbc24598af46f44c3a94834591f;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git initramfs-framework: support PARTLABEL option Since commit (kernel >= 4.20): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f027c34d844013d9d6c902af8fa01a82d6e5073d specifying rootfs by PARTLABEL is supported. This commit adds support to specify root by GPT partition label. Signed-off-by: Diego Rondini Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/rootfs b/meta/recipes-core/initrdscripts/initramfs-framework/rootfs index 76fa84d3545..61baf73a603 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-10`" = "PARTLABEL=" ]; then + root_uuid=`echo $bootparam_root | cut -c11-` + bootparam_root="/dev/disk/by-partlabel/$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"