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() find_root_partition()
{ {
for i in /dev/mapper/* /dev/mmcblk*; do DEVICE=$(blkid | grep "crypto_LUKS" | tail -1 | cut -d ":" -f 1)
cryptsetup isLuks "$i" || continue
echo "$i" if [ -z "$DEVICE" ]; then
break DEVICE=$(blkid | grep "pmOS_root" | tail -1 | cut -d ":" -f 1)
done fi
log "info" "root partition is $DEVICE"
echo $DEVICE
} }
unlock_root_partition() unlock_root_partition()