From: Daniel Kahn Gillmor Date: Sun, 12 Dec 2010 02:09:50 +0000 (-0500) Subject: put the preseed into the initramfs. X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=60d9be3908fdc071662b01c4c8058b3ddd884ad1;p=kvm-manager.git put the preseed into the initramfs. --- 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"