tegra-minimal-init:platform-preboot.sh: support more bootdev types

Support more bootdev types: UUID, PARTUUID, PARTLABEL, LABEL.

Signed-off-by: Ming Liu <liu.ming50@gmail.com>
This commit is contained in:
Ming Liu
2023-06-27 10:27:15 +02:00
committed by Matt Madison
parent 56ed0e78f6
commit 91fa40401f

View File

@@ -35,8 +35,22 @@ fi
if [ -z "$rootdev" ]; then
echo "[FAIL]"
if [ -n "$mayberoot" ]; then
rootdev="$mayberoot"
if [ "`echo $mayberoot | cut -c1-5`" = "UUID=" ]; then
rootuuid=`echo $mayberoot | cut -c6-`
rootdev="`blkid -t UUID=$rootuuid -l | awk -F: '{ print $1 }'`"
elif [ "`echo $mayberoot | cut -c1-9`" = "PARTUUID=" ]; then
rootpartuuid=`echo $mayberoot | cut -c10-`
rootdev="`blkid -t PARTUUID=$rootpartuuid -l | awk -F: '{ print $1 }'`"
elif [ "`echo $mayberoot | cut -c1-10`" = "PARTLABEL=" ]; then
rootpartlabel=`echo $mayberoot | cut -c11-`
rootdev="`blkid -t PARTLABEL=$rootpartlabel -l | awk -F: '{ print $1 }'`"
elif [ "`echo $mayberoot | cut -c1-6`" = "LABEL=" ]; then
rootlabel=`echo $mayberoot | cut -c7-`
rootdev="`blkid -t LABEL=$rootlabel -l | awk -F: '{ print $1 }'`"
else
rootdev="$mayberoot"
fi
else
rootdev="/dev/@@TNSPEC_BOOTDEV@@"
rootdev="/dev/@@TNSPEC_BOOTDEV@@"
fi
fi