Updating d-i initrd repacking handling in binary_debian-installer for additional inclusions of stuff.
This commit is contained in:
parent
ff227d990e
commit
2bbcc84208
|
@ -802,14 +802,14 @@ fi
|
||||||
Repack_initrd()
|
Repack_initrd()
|
||||||
{
|
{
|
||||||
local TARGET_INITRD
|
local TARGET_INITRD
|
||||||
local INCLUDE_PATH
|
local INCLUDES_SOURCE
|
||||||
TARGET_INITRD="${1}"
|
TARGET_INITRD="${1}"
|
||||||
INCLUDE_PATH="${2}"
|
INCLUDES_SOURCE="${2}"
|
||||||
REPACK_TMPDIR="unpacked-initrd"
|
REPACK_TMPDIR="unpacked-initrd"
|
||||||
|
|
||||||
if [ -d "${INCLUDE_PATH}" ]
|
if [ -d "${INCLUDES_SOURCE}" ]
|
||||||
then
|
then
|
||||||
INCLUDE_PATH=$(readlink -f ${INCLUDE_PATH})
|
INCLUDES_SOURCE=$(readlink -f ${INCLUDES_SOURCE})
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# cpio does not have a "extract to directory", so we must change directory
|
# cpio does not have a "extract to directory", so we must change directory
|
||||||
|
@ -817,33 +817,39 @@ Repack_initrd()
|
||||||
cd ${REPACK_TMPDIR}
|
cd ${REPACK_TMPDIR}
|
||||||
|
|
||||||
gzip -d < ../${TARGET_INITRD} | cpio -i --make-directories --no-absolute-filenames
|
gzip -d < ../${TARGET_INITRD} | cpio -i --make-directories --no-absolute-filenames
|
||||||
if [ ! -d "${INCLUDE_PATH}" ]
|
|
||||||
then
|
for _INCLUDE in ${INCLUDES_SOURCE}
|
||||||
# Invoked the old way, just copy the preseeds
|
do
|
||||||
cp ../config/debian-installer/*.cfg .
|
if [ ! -d ${_INCLUDE} ]
|
||||||
else
|
then
|
||||||
# New way, include target directory content in the initrd
|
cp ${_INCLUDE} .
|
||||||
REPACK_TMPDIR_ABS="${PWD}"
|
else
|
||||||
cd "${INCLUDE_PATH}"
|
REPACK_TMPDIR_ABS="${PWD}"
|
||||||
find -print0 | cpio -pumd0 --no-preserve-owner "${REPACK_TMPDIR_ABS}/"
|
cd "${_INCLUDE}"
|
||||||
cd "${OLDPWD}"
|
find -print0 | cpio -pumd0 --no-preserve-owner "${REPACK_TMPDIR_ABS}/"
|
||||||
fi
|
cd "${OLDPWD}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
find -print0 | cpio -H newc -o0 | gzip -9 > ../${TARGET_INITRD}
|
find -print0 | cpio -H newc -o0 | gzip -9 > ../${TARGET_INITRD}
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf ${REPACK_TMPDIR}
|
rm -rf ${REPACK_TMPDIR}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Preseed d-i by repacking the initrd in certain situations
|
case "${DI_IMAGE_TYPE}" in
|
||||||
if [ "${DI_IMAGE_TYPE}" = "netboot" ] && [ -e config/debian-installer/preseed.cfg ]
|
netboot)
|
||||||
then
|
# Preseed d-i by repacking the initrd in certain situations
|
||||||
Repack_initrd "${DESTDIR}"/"${INITRD_DI}"
|
if [ -e config/debian-installer/preseed.cfg ]
|
||||||
|
then
|
||||||
|
Repack_initrd "${DESTDIR}"/"${INITRD_DI}" config/debian-installer/preseed.cfg
|
||||||
|
|
||||||
if [ -e "${DESTDIR}"/"${INITRD_GI}" ]
|
if [ -e "${DESTDIR}"/"${INITRD_GI}" ]
|
||||||
then
|
then
|
||||||
Repack_initrd "${DESTDIR}"/"${INITRD_GI}"
|
Repack_initrd "${DESTDIR}"/"${INITRD_GI}" config/debian-installer/preseed.cfg
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
# Include content of config/includes.debian-installer if exists and not empty
|
# Include content of config/includes.debian-installer if exists and not empty
|
||||||
if [ -d config/includes.debian-installer ] && [ -n "$(ls -A config/includes.debian-installer)" ]
|
if [ -d config/includes.debian-installer ] && [ -n "$(ls -A config/includes.debian-installer)" ]
|
||||||
|
|
Loading…
Reference in New Issue