summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2013-01-24 01:26:06 +0100
committerDaniel Baumann <daniel@debian.org>2013-01-24 01:30:03 +0100
commit2bbcc842081019a0035eceb240e4bc18e01e6dcb (patch)
tree8e914853f31e23a1420f2e4e5d3b406d7819a569
parentff227d990e706bc380dca2c7b436735056069e48 (diff)
downloadvyos-live-build-2bbcc842081019a0035eceb240e4bc18e01e6dcb.tar.gz
vyos-live-build-2bbcc842081019a0035eceb240e4bc18e01e6dcb.zip
Updating d-i initrd repacking handling in binary_debian-installer for additional inclusions of stuff.
-rwxr-xr-xscripts/build/binary_debian-installer54
1 files changed, 30 insertions, 24 deletions
diff --git a/scripts/build/binary_debian-installer b/scripts/build/binary_debian-installer
index a9a3df8da..086576764 100755
--- a/scripts/build/binary_debian-installer
+++ b/scripts/build/binary_debian-installer
@@ -802,14 +802,14 @@ fi
Repack_initrd()
{
local TARGET_INITRD
- local INCLUDE_PATH
+ local INCLUDES_SOURCE
TARGET_INITRD="${1}"
- INCLUDE_PATH="${2}"
+ INCLUDES_SOURCE="${2}"
REPACK_TMPDIR="unpacked-initrd"
- if [ -d "${INCLUDE_PATH}" ]
+ if [ -d "${INCLUDES_SOURCE}" ]
then
- INCLUDE_PATH=$(readlink -f ${INCLUDE_PATH})
+ INCLUDES_SOURCE=$(readlink -f ${INCLUDES_SOURCE})
fi
# cpio does not have a "extract to directory", so we must change directory
@@ -817,33 +817,39 @@ Repack_initrd()
cd ${REPACK_TMPDIR}
gzip -d < ../${TARGET_INITRD} | cpio -i --make-directories --no-absolute-filenames
- if [ ! -d "${INCLUDE_PATH}" ]
- then
- # Invoked the old way, just copy the preseeds
- cp ../config/debian-installer/*.cfg .
- else
- # New way, include target directory content in the initrd
- REPACK_TMPDIR_ABS="${PWD}"
- cd "${INCLUDE_PATH}"
- find -print0 | cpio -pumd0 --no-preserve-owner "${REPACK_TMPDIR_ABS}/"
- cd "${OLDPWD}"
- fi
+
+ for _INCLUDE in ${INCLUDES_SOURCE}
+ do
+ if [ ! -d ${_INCLUDE} ]
+ then
+ cp ${_INCLUDE} .
+ else
+ REPACK_TMPDIR_ABS="${PWD}"
+ cd "${_INCLUDE}"
+ find -print0 | cpio -pumd0 --no-preserve-owner "${REPACK_TMPDIR_ABS}/"
+ cd "${OLDPWD}"
+ fi
+ done
find -print0 | cpio -H newc -o0 | gzip -9 > ../${TARGET_INITRD}
cd ..
rm -rf ${REPACK_TMPDIR}
}
-# Preseed d-i by repacking the initrd in certain situations
-if [ "${DI_IMAGE_TYPE}" = "netboot" ] && [ -e config/debian-installer/preseed.cfg ]
-then
- Repack_initrd "${DESTDIR}"/"${INITRD_DI}"
+case "${DI_IMAGE_TYPE}" in
+ netboot)
+ # Preseed d-i by repacking the initrd in certain situations
+ if [ -e config/debian-installer/preseed.cfg ]
+ then
+ Repack_initrd "${DESTDIR}"/"${INITRD_DI}" config/debian-installer/preseed.cfg
- if [ -e "${DESTDIR}"/"${INITRD_GI}" ]
- then
- Repack_initrd "${DESTDIR}"/"${INITRD_GI}"
- fi
-fi
+ if [ -e "${DESTDIR}"/"${INITRD_GI}" ]
+ then
+ Repack_initrd "${DESTDIR}"/"${INITRD_GI}" config/debian-installer/preseed.cfg
+ fi
+ fi
+ ;;
+esac
# 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)" ]