diff options
author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2010-12-11 21:09:50 -0500 |
---|---|---|
committer | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2010-12-11 21:09:50 -0500 |
commit | 60d9be3908fdc071662b01c4c8058b3ddd884ad1 (patch) | |
tree | d271683b1376501fad07155ddef20f263c83c9e9 /di-maker | |
parent | 4b3500c5b2b6c4c54d3d3108cf70a8a2d1cc9f70 (diff) | |
download | kvm-manager-60d9be3908fdc071662b01c4c8058b3ddd884ad1.tar.gz kvm-manager-60d9be3908fdc071662b01c4c8058b3ddd884ad1.tar.bz2 |
put the preseed into the initramfs.
Diffstat (limited to 'di-maker')
-rwxr-xr-x | di-maker | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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" |