summaryrefslogtreecommitdiff
path: root/localusbbootmacinit
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-04-12 19:16:57 +0000
committerJonas Smedegaard <dr@jones.dk>2008-04-12 19:16:57 +0000
commitf85c80fe8de5ac8b0e30350d7115c5fc9f337174 (patch)
treeffcc211cfbc2e86ac912bc0dc3dfb22c471e351d /localusbbootmacinit
parent5fea6320214a1cb00418f52895fd11fc2522771c (diff)
*** empty log message ***
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!"