Find root partition using labels

For some reason /dev/disk/by-label/pmOS_root symlink is not present and
blkid from busybox doesn't support the -L parameter. We could install
blkid from util-linux but I prefered to use shell commands instead
This commit is contained in:
Pablo Castellano 2017-06-22 19:34:51 +02:00
parent 58b31aee1f
commit 7688454be0

View file

@ -19,11 +19,15 @@ mount_subpartitions()
find_root_partition()
{
for i in /dev/mapper/* /dev/mmcblk*; do
cryptsetup isLuks "$i" || continue
echo "$i"
break
done
DEVICE=$(blkid | grep "crypto_LUKS" | tail -1 | cut -d ":" -f 1)
if [ -z "$DEVICE" ]; then
DEVICE=$(blkid | grep "pmOS_root" | tail -1 | cut -d ":" -f 1)
fi
log "info" "root partition is $DEVICE"
echo $DEVICE
}
unlock_root_partition()