Skip to content

Commit

Permalink
rework usb install again
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidHal committed Nov 27, 2024
1 parent a8b1f9a commit 7e58264
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions scripts/InstallScripts/InstallPrawnOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,19 @@ install() {
then
if [[ $BOOT_DEVICE_NO_P == "/dev/sda" ]]
then
if [ -e /dev/sdb ]; then
TARGET=/dev/sdb
elif [ -e /dev/sdc ]; then
TARGET=/dev/sdc
else
echo "unable to find a target usb device to install to, please ensure one is plugged in and is available at /dev/sdb or /dev/sdc"
exit 1
fi
dmesg -D
while true; do
echo "Please select the usb device you'd like to install to"
# ignore devices with 0B storage size, and ignore our currently booted usb device (sda)
lsblk --noheadings --nodeps | rg "sd" | rg --invert-match "0B" | rg --invert-match "sda"
read -r -p "Please enter the device to install to in the form 'sdc'" USER_TARG
if [ -e /dev/$USER_TARG ]; then
TARGET=/dev/$USER_TARG
else
echo "/dev/${USER_TARG} does not exist, please try again"
fi
done
dmesg -E
else
TARGET=/dev/sda
fi
Expand Down

0 comments on commit 7e58264

Please sign in to comment.