From 0d2492ab4a1e743358d3ef23e1bdafaf1c052324 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 23 Oct 2022 10:11:03 +0200 Subject: Adding initial image support in container debconf build-scripts. Signed-off-by: Daniel Baumann --- share/build-scripts/debconf.d/0003-debconf | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'share/build-scripts/debconf.d/0003-debconf') diff --git a/share/build-scripts/debconf.d/0003-debconf b/share/build-scripts/debconf.d/0003-debconf index edd3ea7..c5b5778 100755 --- a/share/build-scripts/debconf.d/0003-debconf +++ b/share/build-scripts/debconf.d/0003-debconf @@ -44,6 +44,39 @@ Mode () export MODE } +Images () +{ + if db_get container/image && [ "${RET}" ] + then + db_get container/image + IMAGE="${RET}" # string (w/o empty) + + echo "IMAGE=\"${IMAGE}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + fi + + NUMBER="1" + + while db_get container/image${NUMBER} && [ "${RET}" ] + do + if db_get container/image${NUMBER} + then + eval IMAGE${NUMBER}="\"${RET}\"" # string (w/o empty) + fi + + NUMBER="$((${NUMBER} + 1))" + done + + IMAGE_NUMBER="$((${NUMBER} - 1))" + + echo "IMAGE_NUMBER=\"${IMAGE_NUMBER}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + + for NUMBER in $(seq 1 ${IMAGE_NUMBER}) + do + eval IMAGE="$`echo IMAGE${NUMBER}`" + echo "IMAGE${NUMBER}=\"${IMAGE}\"" >> "${DEBCONF_TMPDIR}/debconf.default" + done +} + Distribution () { db_get container/distribution @@ -1284,6 +1317,7 @@ Internal_options () } Mode +Images Distribution Parent_distribution -- cgit v1.2.3