]> code.ossystems Code Review - openembedded-core.git/commitdiff
initramfs-framework: support PARTLABEL option
authorDiego Rondini <diego.rondini@kynetics.com>
Thu, 19 Sep 2019 07:45:09 +0000 (09:45 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 2 Oct 2019 09:07:18 +0000 (10:07 +0100)
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 <diego.rondini@kynetics.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-core/initrdscripts/initramfs-framework/rootfs

index f8c73b9726b402500f89b28480ff331d2156a04d..748c9391c04422d66e0c429c10e98f523c5b66b5 100644 (file)
@@ -36,6 +36,11 @@ rootfs_run() {
                                bootparam_root="/dev/disk/by-partlabel/$root_partlabel"
                        fi
 
+                       if [ "`echo ${bootparam_root} | cut -c1-10`" = "PARTLABEL=" ]; then
+                               root_partlabel=`echo $bootparam_root | cut -c11-`
+                               bootparam_root="/dev/disk/by-partlabel/$root_partlabel"
+                       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"