The Mostly Harmless USB Disk https://mostlyharmless.io/usb/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.3 KiB

  1. #!/bin/bash
  2. usb=$1
  3. part=`echo $usb`1
  4. rsync="rsync --delete -rvtDW --progress --modify-window=1"
  5. if [ -z $1 ]
  6. then
  7. echo "Usage: sudo ./prepare-usb.sh <device>"
  8. exit 1
  9. fi
  10. if [ $UID -gt 0 ]
  11. then
  12. echo "Please run as root."
  13. echo "Usage: sudo ./prepare-usb.sh <device>"
  14. exit 1
  15. fi
  16. ## Install Ventoy
  17. ventoy -i /dev/$usb -L MH-USB -I -g
  18. sleep 20
  19. OS_FOR_16GB="
  20. alpine-standard-3.15.0-x86_64.iso
  21. debian-live-11.2.0-amd64-cinnamon.iso
  22. Fedora-Workstation-Live-x86_64-35-1.2.iso
  23. LibreELEC-Generic.x86_64-10.0.1.img
  24. manjaro-kde-21.2.1-minimal-220103-linux515.iso
  25. netboot.xyz.iso
  26. openwrt-21.02.0-x86-64-generic-ext4-combined.img
  27. systemrescue-9.00-amd64.iso
  28. tails-amd64-4.26.img
  29. trisquel-mini_9.0.1_amd64.iso
  30. ubuntu-20.04.3-desktop-amd64.iso"
  31. RPi_FOR_16GB="
  32. 2021-10-30-raspios-bullseye-armhf-lite.zip
  33. LibreELEC-RPi4.arm-10.0.1.img.gz"
  34. TOOLS_FOR_16GB="
  35. imager_1.6.1.exe
  36. imager_amd64.AppImage
  37. ungoogled-chromium_91.0.4472.164-1.1.AppImage"
  38. ## Copy ISOs
  39. mkdir -p /mnt/mhusb/
  40. mount /dev/$part /mnt/mhusb
  41. mkdir -p /mnt/mhusb/{OS,Tools}
  42. cd MH-USB/OS/
  43. time $rsync $OS_FOR_16GB /mnt/mhusb/OS/
  44. cd ../Tools/
  45. time $rsync $TOOLS_FOR_16GB /mnt/mhusb/Tools/
  46. cd ../
  47. time $rsync ventoy /mnt/mhusb
  48. ## cd ../RPi/
  49. ## $rsync $RPi_FOR_16GB /mnt/mhusb/RPi/
  50. echo "Done."