mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 01:19:52 +00:00
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>
This commit is contained in:
@@ -24,24 +24,13 @@ rootfs_run() {
|
|||||||
if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then
|
if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then
|
||||||
root_uuid=`echo $bootparam_root | cut -c6-`
|
root_uuid=`echo $bootparam_root | cut -c6-`
|
||||||
bootparam_root="/dev/disk/by-uuid/$root_uuid"
|
bootparam_root="/dev/disk/by-uuid/$root_uuid"
|
||||||
fi
|
elif [ "`echo ${bootparam_root} | cut -c1-9`" = "PARTUUID=" ]; then
|
||||||
|
|
||||||
if [ "`echo ${bootparam_root} | cut -c1-9`" = "PARTUUID=" ]; then
|
|
||||||
root_partuuid=`echo $bootparam_root | cut -c10-`
|
root_partuuid=`echo $bootparam_root | cut -c10-`
|
||||||
bootparam_root="/dev/disk/by-partuuid/$root_partuuid"
|
bootparam_root="/dev/disk/by-partuuid/$root_partuuid"
|
||||||
fi
|
elif [ "`echo ${bootparam_root} | cut -c1-10`" = "PARTLABEL=" ]; then
|
||||||
|
|
||||||
if [ "`echo ${bootparam_root} | cut -c1-10`" = "PARTLABEL=" ]; then
|
|
||||||
root_partlabel=`echo $bootparam_root | cut -c11-`
|
root_partlabel=`echo $bootparam_root | cut -c11-`
|
||||||
bootparam_root="/dev/disk/by-partlabel/$root_partlabel"
|
bootparam_root="/dev/disk/by-partlabel/$root_partlabel"
|
||||||
fi
|
elif [ "`echo ${bootparam_root} | cut -c1-6`" = "LABEL=" ]; then
|
||||||
|
|
||||||
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-`
|
root_label=`echo $bootparam_root | cut -c7-`
|
||||||
bootparam_root="/dev/disk/by-label/$root_label"
|
bootparam_root="/dev/disk/by-label/$root_label"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user