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.

Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk>
This commit is contained in:
Chris Lamb 2008-03-22 18:13:03 +00:00
parent 3e5f888a19
commit 32f6dcd3a3
1 changed files with 28 additions and 0 deletions

View File

@ -453,5 +453,33 @@ then
fi fi
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 # Creating stage file
Create_stagefile .stage/binary_debian-installer Create_stagefile .stage/binary_debian-installer