]> code.ossystems Code Review - openembedded-core.git/commitdiff
initramfs-framework: support PARTLABEL option
authorDiego Rondini <diego.rondini@kynetics.com>
Mon, 16 Sep 2019 13:23:15 +0000 (15:23 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 19 Sep 2019 09:54:26 +0000 (10:54 +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: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initrdscripts/initramfs-framework/rootfs

index 76fa84d3545f425a7f0188dd4eb81a47f0962b73..61baf73a603706dac658cee624018b8ce1af9a14 100644 (file)
@@ -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"