From 0346b7a77a94583ffa63a04a096c252d4452ca1c Mon Sep 17 00:00:00 2001 From: Pablo Castellano Date: Thu, 22 Jun 2017 19:34:51 +0200 Subject: [PATCH] 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 --- aports/postmarketos-mkinitfs/init_functions.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/aports/postmarketos-mkinitfs/init_functions.sh b/aports/postmarketos-mkinitfs/init_functions.sh index ac6ba150..52e36b49 100644 --- a/aports/postmarketos-mkinitfs/init_functions.sh +++ b/aports/postmarketos-mkinitfs/init_functions.sh @@ -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()