improve mkusb.sh

This commit is contained in:
2024-01-24 16:52:17 +01:00
parent 847685bcdc
commit 4b052f9320

View File

@ -1,9 +1,6 @@
# name of the USB stick to be created
NAME=BOOT_TINY
if [ ! -d boot_tiny ] ; then
git clone --depth 1 git@gitlab.psi.ch:samenv/boot_tiny.git
fi
# list removeable disks
DISKS=()
while read LINE
@ -22,9 +19,16 @@ done < <(lsblk -l --output RM,TYPE,NAME,SIZE,LABEL,VENDOR,MODEL)
echo "which device? should be one of: ${DISKS[@]}"
read DEVICE
if [ -z $DEVICE ] ; then
exit
fi
if [[ " ${DISKS[@]} " =~ " $DEVICE " ]]; then
echo "create TinyLinux"
if [ ! -d boot_tiny ] ; then
git clone --depth 1 git@gitlab.psi.ch:samenv/boot_tiny.git
fi
if [[ $(cat /sys/block/$DEVICE/removable) != "1" ]]; then
echo "/dev/$DEVICE is not a removable disk"
exit