summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Rondini <diego.rondini@kynetics.com>2019-09-16 15:23:15 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-19 10:54:26 +0100
commite714b8982c2decbc24598af46f44c3a94834591f (patch)
tree70548172595be61e12a1a7f9494a0356d69323b1
parentf66c02130d11154088d86c96fedd88e9d2bca723 (diff)
downloadopenembedded-core-contrib-e714b8982c2decbc24598af46f44c3a94834591f.tar.gz
openembedded-core-contrib-e714b8982c2decbc24598af46f44c3a94834591f.tar.bz2
openembedded-core-contrib-e714b8982c2decbc24598af46f44c3a94834591f.zip
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 <diego.rondini@kynetics.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-framework/rootfs5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/rootfs b/meta/recipes-core/initrdscripts/initramfs-framework/rootfs
index 76fa84d354..61baf73a60 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"