summaryrefslogtreecommitdiffstats
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:28:26 +0100
commitfef6805f68ddd98738e3bdd2861ecb32e7e05a3a (patch)
tree7c9ae621e4254ae2eb2fcf60d8c69956865843b1
parenta7e1bbaf6d7c5d1cf44069419860dabd78c02eec (diff)
downloadpoky-fef6805f68ddd98738e3bdd2861ecb32e7e05a3a.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. (From OE-Core rev: 29e1e2ad0b6fd0db0e099831ba331b4ffa2b094b) Signed-off-by: Ming Liu <liu.ming50@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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() {
24 if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then 24 if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then
25 root_uuid=`echo $bootparam_root | cut -c6-` 25 root_uuid=`echo $bootparam_root | cut -c6-`
26 bootparam_root="/dev/disk/by-uuid/$root_uuid" 26 bootparam_root="/dev/disk/by-uuid/$root_uuid"
27 fi 27 elif [ "`echo ${bootparam_root} | cut -c1-9`" = "PARTUUID=" ]; then
28
29 if [ "`echo ${bootparam_root} | cut -c1-9`" = "PARTUUID=" ]; then
30 root_partuuid=`echo $bootparam_root | cut -c10-` 28 root_partuuid=`echo $bootparam_root | cut -c10-`
31 bootparam_root="/dev/disk/by-partuuid/$root_partuuid" 29 bootparam_root="/dev/disk/by-partuuid/$root_partuuid"
32 fi 30 elif [ "`echo ${bootparam_root} | cut -c1-10`" = "PARTLABEL=" ]; then
33
34 if [ "`echo ${bootparam_root} | cut -c1-10`" = "PARTLABEL=" ]; then
35 root_partlabel=`echo $bootparam_root | cut -c11-`
36 bootparam_root="/dev/disk/by-partlabel/$root_partlabel"
37 fi
38
39 if [ "`echo ${bootparam_root} | cut -c1-10`" = "PARTLABEL=" ]; then
40 root_partlabel=`echo $bootparam_root | cut -c11-` 31 root_partlabel=`echo $bootparam_root | cut -c11-`
41 bootparam_root="/dev/disk/by-partlabel/$root_partlabel" 32 bootparam_root="/dev/disk/by-partlabel/$root_partlabel"
42 fi 33 elif [ "`echo ${bootparam_root} | cut -c1-6`" = "LABEL=" ]; then
43
44 if [ "`echo ${bootparam_root} | cut -c1-6`" = "LABEL=" ]; then
45 root_label=`echo $bootparam_root | cut -c7-` 34 root_label=`echo $bootparam_root | cut -c7-`
46 bootparam_root="/dev/disk/by-label/$root_label" 35 bootparam_root="/dev/disk/by-label/$root_label"
47 fi 36 fi