diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2022-10-23 08:11:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2022-10-23 09:48:06 +0000 |
commit | 0d2492ab4a1e743358d3ef23e1bdafaf1c052324 (patch) | |
tree | a8885b2f480b0b611ddea29597efc8fae2bcab34 /share/build-scripts/debconf.d/0003-debconf | |
parent | Renaming internal bootstrap function to be more generic in debconf build-script. (diff) | |
download | compute-tools-0d2492ab4a1e743358d3ef23e1bdafaf1c052324.tar.xz compute-tools-0d2492ab4a1e743358d3ef23e1bdafaf1c052324.zip |
Adding initial image support in container debconf build-scripts.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-x | share/build-scripts/debconf.d/0003-debconf | 34 | ||||
-rw-r--r-- | share/build-scripts/debconf.d/0003-debconf.templates | 6 |
2 files changed, 40 insertions, 0 deletions
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 diff --git a/share/build-scripts/debconf.d/0003-debconf.templates b/share/build-scripts/debconf.d/0003-debconf.templates index 098acd1..551033a 100644 --- a/share/build-scripts/debconf.d/0003-debconf.templates +++ b/share/build-scripts/debconf.d/0003-debconf.templates @@ -10,6 +10,12 @@ Choices: ${CHOICES} Description: Mode Mode. +Template: container/image +Type: string +Default: +Description: Image + Image. + Template: container/distribution Type: select Default: |