summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-01-28 21:38:19 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2017-04-03 10:09:13 +0000
commit67ed26b29d2b61c6146c7073f0b825fcf6a85aaa (patch)
treefefb4843e7edf99967e9eac7d78458eb8132eeb7 /share
parentCleanup stray preseed.cfg removal. (diff)
downloadcompute-tools-67ed26b29d2b61c6146c7073f0b825fcf6a85aaa.tar.xz
compute-tools-67ed26b29d2b61c6146c7073f0b825fcf6a85aaa.zip
Allowing @NAME@ variable in preseed files to allow for more flexibel preseed templating.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to 'share')
-rwxr-xr-xshare/scripts/debconf2
-rwxr-xr-xshare/scripts/debconf.d/0002-preseed-debconf6
2 files changed, 6 insertions, 2 deletions
diff --git a/share/scripts/debconf b/share/scripts/debconf
index 64d8b8f..6d0410a 100755
--- a/share/scripts/debconf
+++ b/share/scripts/debconf
@@ -622,7 +622,7 @@ EOF
then
for FILE in ${PRESEED_FILE}
do
- cat "${FILE}" >> "${DIRECTORY}/preseed.cfg"
+ sed -e "s|@NAME@|${NAME}|g" "${FILE}" >> "${DIRECTORY}/preseed.cfg"
done
Chroot "${DIRECTORY}" "debconf-set-selections preseed.cfg"
diff --git a/share/scripts/debconf.d/0002-preseed-debconf b/share/scripts/debconf.d/0002-preseed-debconf
index 05b9379..48fa6a1 100755
--- a/share/scripts/debconf.d/0002-preseed-debconf
+++ b/share/scripts/debconf.d/0002-preseed-debconf
@@ -72,8 +72,12 @@ done
for DEBCONF_PRESEED_FILE in ${DEBCONF_PRESEED_FILES}
do
+ sed -e "s|@NAME@|${NAME}|g" "${DEBCONF_PRESEED_FILE}" > "${DIRECTORY}/preseed.cfg"
+
# Apply user specified preseed files
- debconf-set-selections "${DEBCONF_PRESEED_FILE}"
+ debconf-set-selections "${DIRECTORY}/preseed.cfg"
+
+ rm -f "${DIRECTORY}/preseed.cfg"
done
# Write expanded list of debconf preseed files