From 29e1e2ad0b6fd0db0e099831ba331b4ffa2b094b Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Wed, 24 Mar 2021 13:37:58 +0100 Subject: initramfs-framework:rootfs: fix some conditional check Drop a duplicated check for "PARTLABEL=", also change to use elif to avoid go through all the checks for root parameter. Signed-off-by: Ming Liu Signed-off-by: Richard Purdie --- .../initrdscripts/initramfs-framework/rootfs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'meta') diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/rootfs b/meta/recipes-core/initrdscripts/initramfs-framework/rootfs index ee24e82af3..10b9583172 100644 --- a/meta/recipes-core/initrdscripts/initramfs-framework/rootfs +++ b/meta/recipes-core/initrdscripts/initramfs-framework/rootfs @@ -24,24 +24,13 @@ rootfs_run() { if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then root_uuid=`echo $bootparam_root | cut -c6-` bootparam_root="/dev/disk/by-uuid/$root_uuid" - fi - - if [ "`echo ${bootparam_root} | cut -c1-9`" = "PARTUUID=" ]; then + elif [ "`echo ${bootparam_root} | cut -c1-9`" = "PARTUUID=" ]; then root_partuuid=`echo $bootparam_root | cut -c10-` bootparam_root="/dev/disk/by-partuuid/$root_partuuid" - 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-10`" = "PARTLABEL=" ]; then + elif [ "`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 + elif [ "`echo ${bootparam_root} | cut -c1-6`" = "LABEL=" ]; then root_label=`echo $bootparam_root | cut -c7-` bootparam_root="/dev/disk/by-label/$root_label" fi -- cgit 1.2.3-korg