diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-17 17:40:15 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-02-23 16:29:28 +0000 |
commit | 13175dfc19dbac8d7024f3f5fb3d838a4bc7a0a1 (patch) | |
tree | a033edc5f91aa71f29e5f5688d56ac6f48c97d26 /share/scripts/debconf.d/0001-preseed-file | |
parent | Adding upstream version 20180825. (diff) | |
download | open-infrastructure-compute-tools-13175dfc19dbac8d7024f3f5fb3d838a4bc7a0a1.tar.xz open-infrastructure-compute-tools-13175dfc19dbac8d7024f3f5fb3d838a4bc7a0a1.zip |
Adding upstream version 20190222.upstream/20190222
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | share/scripts/debconf.d/0001-preseed-file | 44 | ||||
-rw-r--r-- | share/scripts/debconf.d/0001-preseed-file.templates | 8 |
2 files changed, 27 insertions, 25 deletions
diff --git a/share/scripts/debconf.d/0001-preseed-file b/share/scripts/debconf.d/0001-preseed-file index fab7d8d..d9ff245 100755 --- a/share/scripts/debconf.d/0001-preseed-file +++ b/share/scripts/debconf.d/0001-preseed-file @@ -1,7 +1,6 @@ #!/bin/sh -# container-tools - Manage systemd-nspawn containers -# Copyright (C) 2014-2018 Daniel Baumann <daniel.baumann@open-infrastructure.net> +# Copyright (C) 2014-2019 Daniel Baumann <daniel.baumann@open-infrastructure.net> # # SPDX-License-Identifier: GPL-3.0+ # @@ -20,7 +19,10 @@ set -e -CONFIG="/etc/container-tools/debconf" +PROJECT="open-infrastructure" +PROGRAM="container" + +CONFIG="/etc/${PROJECT}/${PROGRAM}/debconf" DEBCONF_NOWARNINGS="true" export DEBCONF_NOWARNINGS @@ -30,28 +32,28 @@ export DEBCONF_NOWARNINGS if [ -n "${PRESEED_FILE}" ] then # user specified one or more preseed files through commandline option - db_set cnt-debconf/preseed-file "${PRESEED_FILE}" - db_fset cnt-debconf/preseed-file seen true + db_set container/preseed-file "${PRESEED_FILE}" + db_fset container/preseed-file seen true elif [ -e "${CONFIG}/${NAME}.cfg" ] then # user did not specify a pressed file, but there is a matching one # available on the system matching the container name - db_set cnt-debconf/preseed-file "${CONFIG}/${NAME}.cfg" - db_fset cnt-debconf/preseed-file seen true + db_set container/preseed-file "${CONFIG}/${NAME}.cfg" + db_fset container/preseed-file seen true elif [ "$(ls ${CONFIG}/*/${NAME}.cfg 2>/dev/null | wc -l)" -eq 1 ] then # user did not specify a pressed file, but there is 1 (and only 1) - # matching in a sub-directory of /etc/container-tools/debconf + # matching in a sub-directory of /etc/${PROJECT}/${PROGRAM}/debconf FILE="$(ls ${CONFIG}/*/${NAME}.cfg)" - db_set cnt-debconf/preseed-file "${FILE}" - db_fset cnt-debconf/preseed-file seen true + db_set container/preseed-file "${FILE}" + db_fset container/preseed-file seen true elif [ -e "${CONFIG}/default.cfg" ] then # user did not specify a pressed file, but there is a default one - db_set cnt-debconf/preseed-file "${CONFIG}/default.cfg" - db_fset cnt-debconf/preseed-file seen true + db_set container/preseed-file "${CONFIG}/default.cfg" + db_fset container/preseed-file seen true elif ls "${CONFIG}"/*.cfg > /dev/null 2>&1 || ls "${CONFIG}"/*/*.cfg > /dev/null 2>&1 then # user has not specified preseed files through commandline option, @@ -62,13 +64,13 @@ then if [ -n "${PRESEED_FILES}" ] then - db_subst cnt-debconf/preseed-files CHOICES "none, custom, , ${PRESEED_FILES}" + db_subst container/preseed-files CHOICES "none, custom, , ${PRESEED_FILES}" - db_settitle cnt-debconf/title - db_input high cnt-debconf/preseed-files || true + db_settitle container/title + db_input high container/preseed-files || true db_go - db_get cnt-debconf/preseed-files + db_get container/preseed-files PRESEED_FILE="${RET}" # select case "${PRESEED_FILE}" in @@ -77,8 +79,8 @@ then *) # user specified preseed file through debconf select - db_set cnt-debconf/preseed-file "${CONFIG}/${PRESEED_FILE}.cfg" - db_fset cnt-debconf/preseed-file seen true + db_set container/preseed-file "${CONFIG}/${PRESEED_FILE}.cfg" + db_fset container/preseed-file seen true ;; esac fi @@ -90,11 +92,11 @@ case "${PRESEED_FILE}" in *) # ask user for a preseed file - db_settitle cnt-debconf/title - db_input high cnt-debconf/preseed-file || true + db_settitle container/title + db_input high container/preseed-file || true db_go - db_get cnt-debconf/preseed-file + db_get container/preseed-file PRESEED_FILE="${RET}" # string (w/ empty) echo "PRESEED_FILE=\"${PRESEED_FILE}\"" >> "${DEBCONF_TMPDIR}/debconf.default" diff --git a/share/scripts/debconf.d/0001-preseed-file.templates b/share/scripts/debconf.d/0001-preseed-file.templates index 707da95..7e12e0d 100644 --- a/share/scripts/debconf.d/0001-preseed-file.templates +++ b/share/scripts/debconf.d/0001-preseed-file.templates @@ -1,14 +1,14 @@ -Template: cnt-debconf/title +Template: container/title Type: title -Description: container-tools +Description: compute-tools -Template: cnt-debconf/preseed-files +Template: container/preseed-files Type: select Default: none Choices: ${CHOICES} Description: Choose a preseed config, enter a custom one, or use no preseed file at all. -Template: cnt-debconf/preseed-file +Template: container/preseed-file Type: string Default: Description: Enter (optional) preseed file to use: |