diff options
author | Marco Amadori <amadorim@vdavda.com> | 2008-12-02 16:56:02 +0100 |
---|---|---|
committer | Daniel Baumann <daniel@debian.org> | 2011-03-09 19:03:45 +0100 |
commit | a796685a27520dc312340069e3ba33ea95b30cef (patch) | |
tree | cee1c8db6a7012969ae1c1ec5c6158e2cf2352c1 | |
parent | 57ac4cc808d29a8c7c8a5081d9d27fe5b2f6a0eb (diff) | |
download | vyos-live-build-a796685a27520dc312340069e3ba33ea95b30cef.tar.gz vyos-live-build-a796685a27520dc312340069e3ba33ea95b30cef.zip |
NEW: "binary_debian-installer-includes" config directory.
This add another "-includes" power to live-helper, just leave your full
path files there and they will end on the installer initrd. This is
mostly useful for hacking the installer images with themes, firmware and
new installation helpers.
"This doesn't handle the case where you want to remove files or
programmatically modify things" yet.
-rwxr-xr-x | helpers/lh_binary_debian-installer | 32 | ||||
-rwxr-xr-x | helpers/lh_config | 1 |
2 files changed, 31 insertions, 2 deletions
diff --git a/helpers/lh_binary_debian-installer b/helpers/lh_binary_debian-installer index 8d6906304..7de1223cb 100755 --- a/helpers/lh_binary_debian-installer +++ b/helpers/lh_binary_debian-installer @@ -643,16 +643,33 @@ fi Repack_initrd() { local TARGET_INITRD + local INCLUDE_PATH TARGET_INITRD="${1}" + INCLUDE_PATH="${2}" REPACK_TMPDIR="unpacked-initrd" + if [ -d "${INCLUDE_PATH}" ] + then + INCLUDE_PATH=$(readlink -f ${INCLUDE_PATH}) + fi + # 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/*.cfg . - find | cpio -H newc -o | gzip -9 > ../${TARGET_INITRD} + if [ ! -d "${INCLUDE_PATH}" ] + then + # Invoked the old way, just copy the preseeds + cp ../config/binary_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 + find -print0 | cpio -H newc -o0 | gzip -9 > ../${TARGET_INITRD} cd .. rm -rf ${REPACK_TMPDIR} @@ -669,6 +686,17 @@ then fi fi +# Include content of config/binary_debian-installer-includes if exists and not empty +if [ -d config/binary_debian-installer-includes ] && [ -n "$(ls -A config/binary_debian-installer-includes)" ] +then + Repack_initrd "${DESTDIR}"/"${INITRD_DI}" config/binary_debian-installer-includes + + if [ -e "${DESTDIR}"/"${INITRD_GI}" ] + then + Repack_initrd "${DESTDIR}"/"${INITRD_GI}" config/binary_debian-installer-includes + fi +fi + # Saving cache Save_cache cache/packages_binary diff --git a/helpers/lh_config b/helpers/lh_config index 1a9c6152c..4c611919e 100755 --- a/helpers/lh_config +++ b/helpers/lh_config @@ -996,6 +996,7 @@ EOF # Creating lh_binary_* configuration mkdir -p config/binary_debian-installer +mkdir -p config/binary_debian-installer-includes mkdir -p config/binary_grub mkdir -p config/binary_local-debs mkdir -p config/binary_local-hooks |