aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2010-12-11 21:09:50 -0500
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>2010-12-11 21:09:50 -0500
commit60d9be3908fdc071662b01c4c8058b3ddd884ad1 (patch)
treed271683b1376501fad07155ddef20f263c83c9e9
parent4b3500c5b2b6c4c54d3d3108cf70a8a2d1cc9f70 (diff)
downloadkvm-manager-60d9be3908fdc071662b01c4c8058b3ddd884ad1.tar.gz
kvm-manager-60d9be3908fdc071662b01c4c8058b3ddd884ad1.tar.bz2
put the preseed into the initramfs.
-rwxr-xr-xdi-maker9
1 files changed, 5 insertions, 4 deletions
diff --git a/di-maker b/di-maker
index 7ce9131..b99b62d 100755
--- a/di-maker
+++ b/di-maker
@@ -36,8 +36,6 @@ if [ "$preseed" ] ; then
printf "could not read preseed file '%s'\n" "$preseed" >&2
exit 1
fi
- checksum=$(md5sum - < "$preseed" | cut -f1 -d\ )
- preseed_args="preseed/file=/cdrom/preseed.cfg preseed/file/checksum=$checksum"
fi
WORKDIR=$(mktemp -d)
@@ -60,7 +58,7 @@ esac
KERNEL=linux
INITRAMFS=initrd.gz
BOOTINSTRUCTIONS="
- linux /$KERNEL verbose $preseed_args -- console=ttyS0,115200n8
+ linux /$KERNEL verbose -- console=ttyS0,115200n8
initrd /$INITRAMFS
"
@@ -88,7 +86,10 @@ esac
( cd "$WORKDIR" && wget "$BASEPATH"/{$KERNEL,$INITRAMFS} )
if [ "$preseed" ]; then
- cp "$preseed" "${WORKDIR}/preseed.cfg"
+ unpackdir=$(mktemp -d)
+ cp "$preseed" "$unpackdir/preseed.cfg"
+ ( cd "$unpackdir" && fakeroot bash -c "gzip -d < '$WORKDIR/$INITRAMFS' | cpio --extract ; find . | cpio --create -H newc | gzip" ) > "$WORKDIR/$INITRAMFS.new"
+ mv "$WORKDIR/$INITRAMFS.new" "$WORKDIR/$INITRAMFS"
fi
mkdir -p "$WORKDIR/boot/grub"