From: Ming Liu Date: Wed, 24 Mar 2021 12:37:58 +0000 (+0100) Subject: initramfs-framework:rootfs: fix some conditional check X-Git-Tag: yocto-3.3~62 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=29e1e2ad0b6fd0db0e099831ba331b4ffa2b094b;p=openembedded-core.git 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 --- 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