From 7ae659fc52138afd9e0e024f2fa5bed1d489cb6a Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 11 Nov 2009 16:16:17 -0500 Subject: fully transition di-maker to grub2 (should work on modern squeeze installs) --- di-maker | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) (limited to 'di-maker') 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" < "$WORKDIR/boot/grub/grub.cfg" <