aboutsummaryrefslogtreecommitdiff
path: root/di-maker
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-11-11 16:16:17 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2009-11-11 16:16:17 -0500
commit7ae659fc52138afd9e0e024f2fa5bed1d489cb6a (patch)
tree8c728f3a0d8debdbf3f684397607f9e30b3ede9d /di-maker
parent76bf07c125812a9b92724f1a3fb614da220035cf (diff)
downloadkvm-manager-7ae659fc52138afd9e0e024f2fa5bed1d489cb6a.tar.gz
kvm-manager-7ae659fc52138afd9e0e024f2fa5bed1d489cb6a.tar.bz2
fully transition di-maker to grub2 (should work on modern squeeze installs)
Diffstat (limited to 'di-maker')
-rwxr-xr-xdi-maker42
1 files changed, 32 insertions, 10 deletions
diff --git a/di-maker b/di-maker
index d6ad5f3..e0311a6 100755
--- a/di-maker
+++ b/di-maker
@@ -6,25 +6,47 @@
set -e
-# depends on grub2 -- should probably be refactored to use
-# grub-mkrescue
+# depends on grub2
+
+# specify the first argument as the new installer image:
+
+output="$1"
+
+if [ -z "$output" ] ; then
+ printf "you must specify a file name for the image to be built" >&2
+ exit 1
+fi
+
+if [ -e "$output" ] ; then
+ printf "file '%s' already exists" "$output" >&2
+ exit 1
+fi
+
WORKDIR=$(mktemp -d)
+cleanup() {
+ rm -rf "$WORKDIR"
+}
+
+trap cleanup EXIT
+
( cd "$WORKDIR" && wget http://ftp.nl.debian.org/debian/dists/lenny/main/installer-amd64/current/images/netboot/debian-installer/amd64/{linux,initrd.gz} )
mkdir -p "$WORKDIR/boot/grub"
-cp /usr/lib/grub/x86_64-pc/stage2_eltorito "$WORKDIR/boot/grub/"
-cat > "$WORKDIR/boot/grub/menu.lst" <<EOF
+cat > "$WORKDIR/boot/grub/grub.cfg" <<EOF
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
-terminal serial
+terminal_output serial
+terminal_input serial
-title lenny d-i (created $(date -R))
-kernel /linux -- console=ttyS0,115200n8
-initrd /initrd.gz
+menuentry "lenny d-i (created $(date -R))" {
+ linux /linux verbose -- console=ttyS0,115200n8
+ initrd /initrd.gz
+}
EOF
-genisoimage -R -input-charset utf-8 -b boot/grub/stage2_eltorito -no-emul-boot --boot-load-size 4 -boot-info-table "$WORKDIR"
+## no longer using genisoimage with grub2:
+# genisoimage -R -input-charset utf-8 -b boot/grub/stage2_eltorito -no-emul-boot --boot-load-size 4 -boot-info-table "$WORKDIR"
-rm -rf "$WORKDIR"
+grub-mkrescue --overlay="$WORKDIR" "$output"