summaryrefslogtreecommitdiff
path: root/localusbbootmacinit
diff options
context:
space:
mode:
Diffstat (limited to 'localusbbootmacinit')
-rwxr-xr-xlocalusbbootmacinit47
1 files changed, 47 insertions, 0 deletions
diff --git a/localusbbootmacinit b/localusbbootmacinit
new file mode 100755
index 0000000..8d9a411
--- /dev/null
+++ b/localusbbootmacinit
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# Prepare USB stick to install using debian-installer
+
+set -e
+
+usbdev="$1"
+shift
+
+webroot="http://people.debian.org/~wouter/d-i/powerpc/daily/powerpc/netboot/"
+webitems="yaboot yaboot.conf vmlinux initrd.gz"
+
+# space required for webitems on HFS bootstrap filesystem
+diskspace="10M"
+
+echo "Initializing partition map on $usbdev..."
+mac-fdisk "$usbdev" <<EOF >/dev/null
+i
+y
+
+C
+2p
+$diskspace
+bootstrap
+Apple_Bootstrap
+w
+y
+q
+EOF
+
+echo "Initializing HFS bootstrap filesystem on $usbdev..."
+hformat "${usbdev}2"
+echo "Installing files onto bootstrap filesystem on $usbdev..."
+hmount "${usbdev}2"
+for item in $webitems; do
+ # Download only once
+ if [ ! -f "$item" ]; then
+ wget -O "$item.new" "$webroot/$item"
+ mv "$item.new" "$item"
+ fi
+ hcopy -r "$item" :
+done
+#hcopy -r /usr/lib/yaboot/yaboot :
+hattrib -c UNIX -t tbxi :yaboot
+hattrib -b :
+humount
+echo "Done setting up $usbdev!"