summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2021-03-24 13:37:58 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-28 22:26:19 +0100
commit29e1e2ad0b6fd0db0e099831ba331b4ffa2b094b (patch)
treeb025b7b4611772289c8262719973a0a5506c7b29 /meta/recipes-core
parent410a45639d84a3d69a65133593da32062196dd59 (diff)
downloadopenembedded-core-29e1e2ad0b6fd0db0e099831ba331b4ffa2b094b.tar.gz
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 <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r--meta/recipes-core/initrdscripts/initramfs-framework/rootfs17
1 files changed, 3 insertions, 14 deletions
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