Browse Source

Adds an option for preparing 16 or 32 GB USB disks

main
Abhas Abhinav 2 years ago
parent
commit
1ddac7d9ed
1 changed files with 72 additions and 28 deletions
  1. +72
    -28
      prepare-usb.sh

+ 72
- 28
prepare-usb.sh View File

@ -1,12 +1,22 @@
#!/bin/bash
#!/bin/bash
usb=$1 usb=$1
size=$2
part=`echo $usb`1 part=`echo $usb`1
rsync="rsync --delete -rvtDW --progress --modify-window=1" rsync="rsync --delete -rvtDW --progress --modify-window=1"
if [ -z $1 ]
if [ -z $usb -o -z $size ]
then then
echo "Usage: sudo ./prepare-usb.sh <device>"
echo "Usage: sudo ./prepare-usb.sh <device> <size>"
exit 1
fi
if [ $size -eq 16 -o $size -eq 32 ]
then
echo "Working with $size GB disk..."
else
echo "Usage: sudo ./prepare-usb.sh <device> <size>"
echo " <size> should be 16 or 32"
exit 1 exit 1
fi fi
@ -17,31 +27,61 @@ then
exit 1 exit 1
fi fi
## Install Ventoy
ventoy -i /dev/$usb -L MH-USB -I -g
sleep 20
OS_FOR_16GB=" OS_FOR_16GB="
alpine-standard-3.15.0-x86_64.iso
debian-live-11.2.0-amd64-cinnamon.iso
Fedora-Workstation-Live-x86_64-35-1.2.iso
LibreELEC-Generic.x86_64-10.0.1.img
manjaro-kde-21.2.1-minimal-220103-linux515.iso
netboot.xyz.iso
openwrt-21.02.0-x86-64-generic-ext4-combined.img
systemrescue-9.00-amd64.iso
tails-amd64-4.26.img
trisquel-mini_9.0.1_amd64.iso
ubuntu-20.04.3-desktop-amd64.iso"
RPi_FOR_16GB="
alpine-standard-3.15.0-x86_64.iso*
debian-11.2.0-amd64-netinst.iso*
zdebian-firmware-11.2.0-amd64-netinst.iso*
Fedora-Workstation-Live-x86_64-35-1.2.iso*
guix-system-install-1.3.0.x86_64-linux.iso*
LibreELEC-Generic.x86_64-10.0.1.img*
manjaro-kde-21.2.1-minimal-220103-linux515.iso*
netboot.xyz.iso*
openwrt-21.02.0-x86-64-generic-ext4-combined.img*
proxmox-ve_7.1-2.iso*
systemrescue-9.00-amd64.iso*
tails-amd64-4.26.img*
trisquel-mini_10.0_amd64.iso*
ubuntu-20.04.3-desktop-amd64.iso*"
OS_FOR_32GB="
alpine-standard-3.15.0-x86_64.iso*
debian-11.2.0-amd64-netinst.iso*
devuan_chimaera_4.0.0_amd64_desktop-live.iso*
zdebian-firmware-11.2.0-amd64-netinst.iso*
Fedora-Workstation-Live-x86_64-35-1.2.iso*
guix-system-install-1.3.0.x86_64-linux.iso*
haiku-r1beta3-x86_64-anyboot.iso*
LibreELEC-Generic.x86_64-10.0.1.img*
manjaro-kde-21.2.2-220123-linux515.iso*
netboot.xyz.iso*
openwrt-21.02.0-x86-64-generic-ext4-combined.img*
proxmox-ve_7.1-2.iso*
Qubes-R4.0.4-x86_64.iso*
systemrescue-9.00-amd64.iso*
tails-amd64-4.26.img*
trisquel-mini_10.0_amd64.iso*
ubuntu-20.04.3-desktop-amd64.iso*"
RPi="
2021-10-30-raspios-bullseye-armhf-lite.zip 2021-10-30-raspios-bullseye-armhf-lite.zip
LibreELEC-RPi4.arm-10.0.1.img.gz" LibreELEC-RPi4.arm-10.0.1.img.gz"
TOOLS_FOR_16GB="
imager_1.6.1.exe
imager_amd64.AppImage
ungoogled-chromium_91.0.4472.164-1.1.AppImage"
TOOLS="
balenaEtcher-1.7.3-x64.AppImage*
balenaEtcher-Portable-1.7.3.exe*
ungoogled-chromium_91.0.4472.164-1.1.AppImage*"
## Install Ventoy
if [ $size -eq 16 ]
then
ventoy -i /dev/$usb -L MH-USB -I -g
sleep 20
OS=$OS_FOR_16GB
else
ventoy -i /dev/$usb -L MH-USB -I -g -r 1500
sleep 20
OS=$OS_FOR_32GB
fi
## Copy ISOs ## Copy ISOs
mkdir -p /mnt/mhusb/ mkdir -p /mnt/mhusb/
@ -49,15 +89,19 @@ mount /dev/$part /mnt/mhusb
mkdir -p /mnt/mhusb/{OS,Tools} mkdir -p /mnt/mhusb/{OS,Tools}
cd MH-USB/OS/ cd MH-USB/OS/
time $rsync $OS_FOR_16GB /mnt/mhusb/OS/
time $rsync $OS /mnt/mhusb/OS/
cd ../Tools/ cd ../Tools/
time $rsync $TOOLS_FOR_16GB /mnt/mhusb/Tools/
time $rsync $TOOLS /mnt/mhusb/Tools/
cd ../ cd ../
time $rsync ventoy /mnt/mhusb time $rsync ventoy /mnt/mhusb
## cd ../RPi/
## $rsync $RPi_FOR_16GB /mnt/mhusb/RPi/
if [ $size -eq 32 ]
then
cd RPi/
mkdir -p /mnt/mhusb/RPi/
$rsync $RPi /mnt/mhusb/RPi/
fi
echo "Done." echo "Done."

Loading…
Cancel
Save