From 08dea2824317fb307f2fa3387b7783888acd0ea7 Mon Sep 17 00:00:00 2001 From: sean Date: Fri, 26 Jul 2019 13:42:55 -0700 Subject: [PATCH] tweaks --- setup.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/setup.sh b/setup.sh index b4569c3..1005254 100644 --- a/setup.sh +++ b/setup.sh @@ -25,7 +25,7 @@ width=`tput cols` height=`tput lines` window=$((height - 5)) -if [ -e "/sys/firmware/efi/efivars" ]; then efi="1"; echo -e "\nUEFI detected..." else efi="0"; echo -e "\nBIOS detected..."; fi +if [ -d "/sys/firmware/efi" ]; then efi="1"; echo -e "\nUEFI detected..." else efi="0"; echo -e "\nBIOS detected..."; fi # gather input at the start devices=""; for device in $(ls /dev/disk/by-id | grep -v part); do devices="$devices $device off"; done @@ -121,7 +121,7 @@ if [ "$efi" = "1" ]; then echo "Done." done - for disk in `echo "$disks"`; do + for disk in `echo "$boots"`; do echo "" echo "Creating boot partitions for device $disk..." errors=`sgdisk -n3:0:+512M -t3:BF01 /dev/disk/by-id/$disk 2>&1 1>/dev/null` @@ -158,15 +158,16 @@ for disk in `echo "$disks"`; do echo "Done." done -# create boot mirror list -bootmirror=""; rootraidz=""; for disk in `echo "$disks"`; do bootmirror="$bootmirror /dev/disk/by-id/${disk}-part3"; rootraidz="$rootraidz /dev/disk/by-id/${disk}-part4"; done +# create boot mirror list and root list +bootmirror=""; for disk in `echo "$boots"`; do bootmirror="$bootmirror /dev/disk/by-id/${disk}-part3"; done +rootraidz=""; for disk in `echo "$boots"`; do rootraidz="$rootraidz /dev/disk/by-id/${disk}-part4"; done # refresh drives or there are missing partitions partprobe 2>/dev/null 1>/dev/null # wait for the partitions to show up -for disk in `echo "$disk"`; do +for disk in `echo "$boots"`; do pending="0" while ! [ -e "/dev/disk/by-id/${disk}-part3" ]; do partprobe 2>/dev/null 1>/dev/null