improve mkusb.sh
This commit is contained in:
10
mkusb.sh
10
mkusb.sh
@ -1,9 +1,6 @@
|
|||||||
# name of the USB stick to be created
|
# name of the USB stick to be created
|
||||||
NAME=BOOT_TINY
|
NAME=BOOT_TINY
|
||||||
|
|
||||||
if [ ! -d boot_tiny ] ; then
|
|
||||||
git clone --depth 1 git@gitlab.psi.ch:samenv/boot_tiny.git
|
|
||||||
fi
|
|
||||||
# list removeable disks
|
# list removeable disks
|
||||||
DISKS=()
|
DISKS=()
|
||||||
while read LINE
|
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[@]}"
|
echo "which device? should be one of: ${DISKS[@]}"
|
||||||
read DEVICE
|
read DEVICE
|
||||||
|
|
||||||
|
if [ -z $DEVICE ] ; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
if [[ " ${DISKS[@]} " =~ " $DEVICE " ]]; then
|
if [[ " ${DISKS[@]} " =~ " $DEVICE " ]]; then
|
||||||
echo "create TinyLinux"
|
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
|
if [[ $(cat /sys/block/$DEVICE/removable) != "1" ]]; then
|
||||||
echo "/dev/$DEVICE is not a removable disk"
|
echo "/dev/$DEVICE is not a removable disk"
|
||||||
exit
|
exit
|
||||||
|
Reference in New Issue
Block a user