summaryrefslogtreecommitdiff
path: root/localusbbootmacinit
blob: 8d9a411a71ddc8a05fd01e180c766925cb520b3a (plain)
  1. #!/bin/sh
  2. # Prepare USB stick to install using debian-installer
  3. set -e
  4. usbdev="$1"
  5. shift
  6. webroot="http://people.debian.org/~wouter/d-i/powerpc/daily/powerpc/netboot/"
  7. webitems="yaboot yaboot.conf vmlinux initrd.gz"
  8. # space required for webitems on HFS bootstrap filesystem
  9. diskspace="10M"
  10. echo "Initializing partition map on $usbdev..."
  11. mac-fdisk "$usbdev" <<EOF >/dev/null
  12. i
  13. y
  14. C
  15. 2p
  16. $diskspace
  17. bootstrap
  18. Apple_Bootstrap
  19. w
  20. y
  21. q
  22. EOF
  23. echo "Initializing HFS bootstrap filesystem on $usbdev..."
  24. hformat "${usbdev}2"
  25. echo "Installing files onto bootstrap filesystem on $usbdev..."
  26. hmount "${usbdev}2"
  27. for item in $webitems; do
  28. # Download only once
  29. if [ ! -f "$item" ]; then
  30. wget -O "$item.new" "$webroot/$item"
  31. mv "$item.new" "$item"
  32. fi
  33. hcopy -r "$item" :
  34. done
  35. #hcopy -r /usr/lib/yaboot/yaboot :
  36. hattrib -c UNIX -t tbxi :yaboot
  37. hattrib -b :
  38. humount
  39. echo "Done setting up $usbdev!"