summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--debian/open-infrastructure-container-tools.config22
-rw-r--r--debian/open-infrastructure-container-tools.postinst5
-rw-r--r--debian/open-infrastructure-container-tools.templates10
3 files changed, 37 insertions, 0 deletions
diff --git a/debian/open-infrastructure-container-tools.config b/debian/open-infrastructure-container-tools.config
index 65d325a..73d2157 100644
--- a/debian/open-infrastructure-container-tools.config
+++ b/debian/open-infrastructure-container-tools.config
@@ -20,4 +20,26 @@ db_settitle open-infrastructure-container-tools/title
db_input low open-infrastructure-container-tools/cache || true
db_go
+SCRIPT_CHOICES="$(cd /usr/share/container-tools/scripts && find -maxdepth 1 -not -type d -and -not -name 'debconf' -and -not -name '*.d' -printf '%P\n' | sort)"
+db_subst open-infrastructure-container-tools/script SCRIPT_CHOICES "$(echo ${SCRIPT_CHOICES} | sed -e 's| |, |g')"
+
+DISTRIBUTOR="$(lsb_release -is 2>/dev/null)"
+DISTRIBUTOR="${DISTRIBUTOR:-Debian}"
+
+case "${DISTRIBUTOR}" in
+ Progress*)
+ SCRIPT_DEFAULT="progress-linux"
+ ;;
+
+ *)
+ SCRIPT_DEFAULT="debian"
+ ;;
+esac
+
+db_subst open-infrastructure-container-tools/script SCRIPT_DEFAULT "${SCRIPT_DEFAULT}"
+
+db_settitle open-infrastructure-container-tools/title
+db_input low open-infrastructure-container-tools/script || true
+db_go
+
db_stop
diff --git a/debian/open-infrastructure-container-tools.postinst b/debian/open-infrastructure-container-tools.postinst
index c0bffcc..97037fd 100644
--- a/debian/open-infrastructure-container-tools.postinst
+++ b/debian/open-infrastructure-container-tools.postinst
@@ -46,12 +46,17 @@ case "${1}" in
db_get open-infrastructure-container-tools/cache
CACHE="${RET:-/var/cache/container-tools}" # string (w/o empty)
+ db_get open-infrastructure-container-tools/script
+ SCRIPT="${RET:-debian}" # string (w/o empty)
+
db_stop
Setup "/var/lib/machines" "${MACHINES}"
Setup "/etc/container-tools/config" "${CONFIG}"
Setup "/etc/container-tools/debconf" "${DEBCONF}"
Setup "/var/cache/container-tools" "${CACHE}"
+
+ update-alternatives --quiet --set container-tools_script "/usr/share/container-tools/scripts/${SCRIPT}"
;;
abort-upgrade|abort-remove|abort-deconfigure)
diff --git a/debian/open-infrastructure-container-tools.templates b/debian/open-infrastructure-container-tools.templates
index 580467f..9b9ba25 100644
--- a/debian/open-infrastructure-container-tools.templates
+++ b/debian/open-infrastructure-container-tools.templates
@@ -44,3 +44,13 @@ Description: cache directory:
If unsure, use /var/cache/container-tools (default) or
/srv/container/container-tools/cache when using shared
storage.
+
+Template: open-infrastructure-container-tools/script
+Type: select
+Choices: ${SCRIPT_CHOICES}
+Default: ${SCRIPT_DEFAULT}
+Description: create script:
+ Please select the script that will be used by default to
+ create containers.
+ .
+ If unsure, use debian (default).