diff --git a/reform2-imx8mq/reform-tools_1.0-7/sbin/reform-init b/reform2-imx8mq/reform-tools_1.0-7/sbin/reform-init index ae5b5beb0c39d7053d5157fcdd79030a8e4b5cf6..837e635c596277d6e02033a808ff14251df33b1a 100755 --- a/reform2-imx8mq/reform-tools_1.0-7/sbin/reform-init +++ b/reform2-imx8mq/reform-tools_1.0-7/sbin/reform-init @@ -1,6 +1,5 @@ #!/bin/busybox sh -sleep 1 echo "MNT Reform: reform-init checking boot media..." /bin/mount -t proc /proc /proc @@ -22,9 +21,13 @@ echo "Your boot preference is: \"$BOOTPREF\"" if [ "$BOOTPREF" == "usb" ]; then echo "Booting from USB storage in 3 seconds." BOOTPART="/dev/sda1" -elif [ "$BOOTPREF" == "nvme" ]; then +elif [ "${BOOTPREF:0:4}" == "nvme" ]; then echo "Booting from NVMe SSD." - BOOTPART="/dev/nvme0n1p1" + if [ ${#BOOTPREF} -eq 4 -o ! -b /dev/$BOOTPREF ]; then + BOOTPART="/dev/nvme0n1p1" + else + BOOTPART="/dev/$BOOTPREF" + fi else # Default. Boot from SD card (already mounted by kernel). echo "Booting from SD card (or eMMC)." @@ -39,7 +42,7 @@ if [ ! -e $BOOTPART ]; then fi # Check if partition is encrypted -if blkid | grep "$BOOTPART" | grep "crypto_LUKS"; then +if /sbin/blkid -Dp "$BOOTPART" | grep "crypto_LUKS"; then echo "Attempting to mount encrypted partition \"$BOOTPART\"." while : do