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:
parent
58b31aee1f
commit
7688454be0
1 changed files with 9 additions and 5 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue