[OE-core] [PATCH v2] initramfs-framework: support PARTLABEL option
Diego Rondini
diego.rondini at kynetics.com
Thu Sep 19 07:45:09 UTC 2019
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 at kynetics.com>
---
Changes in v2:
- renamed misleading variable name root_uuid to more appropriate name root_partlabel
---
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 76fa84d354..2e400bff41 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_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"
--
2.21.0
More information about the Openembedded-core
mailing list