From 679aed644100f986881ff41bc2be02aba1b18b16 Mon Sep 17 00:00:00 2001 From: Chris Lamb Date: Sat, 22 Mar 2008 18:13:03 +0000 Subject: lh_binary_debian-installer: Preseed by repacking initrd in some situations This patch repacks the initrd when using the d-i netboot images in order to incorporate a preseed.cfg if it exists. Before this patch, preseeding of d-i netboot images was not possible. Repacking the initrd has the additional advantage of being able to preseed the first few questions of the installation process. --- helpers/lh_binary_debian-installer | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/helpers/lh_binary_debian-installer b/helpers/lh_binary_debian-installer index d1913fa..257d786 100755 --- a/helpers/lh_binary_debian-installer +++ b/helpers/lh_binary_debian-installer @@ -453,5 +453,33 @@ then fi fi +repack_initrd() { + local TARGET_INITRD + TARGET_INITRD="${1}" + REPACK_TMPDIR="unpacked-initrd" + + # cpio does not have a "extract to directory", so we must change directory + mkdir -p ${REPACK_TMPDIR} + cd ${REPACK_TMPDIR} + + gzip -d < ../${TARGET_INITRD} | cpio -i --make-directories --no-absolute-filenames + cp ../config/binary_debian-installer/preseed.cfg . + find | cpio -H newc -o | gzip -9 > ../${TARGET_INITRD} + + cd .. + rm -rf ${REPACK_TMPDIR} +} + +# Preseed d-i by repacking the initrd in certain situations +if [ "${USE_NETBOOT_DI}" = "yes" ] && [ -e config/binary_debian-installer/preseed.cfg ] +then + repack_initrd "${DESTDIR}"/"${INITRD_DI}" + + if [ -e "${DESTDIR}"/"${INITRD_GI}" ] + then + repack_initrd "${DESTDIR}"/"${INITRD_GI}" + fi +fi + # Creating stage file Create_stagefile .stage/binary_debian-installer -- cgit v1.0