Commit 88664acc authored by Ruslan Marchenko's avatar Ruslan Marchenko
Browse files

reform-tools: make nvme partition selectable

parent df15f286
#!/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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment