Commit 44034522 authored by mntmn's avatar mntmn
Browse files

reform-tools: some text and comments tweaks in reform-init

parent 218e8d20
Pipeline #282 failed with stage
......@@ -5,8 +5,10 @@ echo "MNT Reform: reform-init checking boot media..."
/bin/mount -t proc /proc /proc
BOOTPREF=$(cat /reform-boot-medium) # Read config file from reform-boot-config script
BOOTPART="/dev/mmcblk1p1" # SD card
# Read config file generated by reform-boot-config script
BOOTPREF=$(cat /reform-boot-medium)
# Default to SD card
BOOTPART="/dev/mmcblk1p1"
if [ "x$BOOTPREF" == "x" ]
then
......@@ -14,12 +16,11 @@ then
BOOTPREF="sd"
fi
echo "Your boot preference is: '$BOOTPREF'"
echo "Your boot preference is: \"$BOOTPREF\""
# Check config
if [ "$BOOTPREF" == "usb" ]; then
echo "Booting from USB storage device, after 3sec."
sleep 3
echo "Booting from USB storage in 3 seconds."
BOOTPART="/dev/sda1"
elif [ "$BOOTPREF" == "nvme" ]; then
echo "Booting from NVMe SSD."
......@@ -32,14 +33,14 @@ fi
# Check if partition exists
if [ ! -e $BOOTPART ]; then
echo "Partition '$BOOTPART' not found. Falling back to SD card."
echo "Partition \"$BOOTPART\" not found. Falling back to SD card."
read -r -p "Press ENTER to continue."
exec /sbin/init
fi
# Check if partition is encrypted
if blkid | grep "$BOOTPART" | grep "crypto_LUKS"; then
echo "Attempting to mount encrypted partition '$BOOTPART'."
echo "Attempting to mount encrypted partition \"$BOOTPART\"."
while :
do
/sbin/cryptsetup luksOpen "$BOOTPART" cryptroot && break
......@@ -48,7 +49,7 @@ if blkid | grep "$BOOTPART" | grep "crypto_LUKS"; then
fi
# Mount
echo "Trying to boot from partition '$BOOTPART'."
echo "Trying to boot from partition \"$BOOTPART\"."
if ! /bin/mount "$BOOTPART" "/mnt"; then
echo "Could not mount '$BOOTPART'. Falling back to SD card."
read -r -p "Press ENTER to continue."
......@@ -63,8 +64,7 @@ if [ ! -e /mnt/sbin/init ]; then
exec /sbin/init
fi
# move root mount over to encrypted drive
# Move root mount over to encrypted drive
cd /mnt || exit 9
mount --move . /
exec chroot . /sbin/init
Markdown is supported
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