diff options
-rwxr-xr-x | helpers/lh_binary_debian-installer | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/helpers/lh_binary_debian-installer b/helpers/lh_binary_debian-installer index d1913faee..257d786c3 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 |