summaryrefslogtreecommitdiffstats
path: root/share/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2017-06-29 09:14:46 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2017-06-29 09:20:38 +0000
commit13f1aa11bd770faf8e66a72a7ac34fc1f7e2305a (patch)
tree1cdf704c14e208bc35e4ea25569ff14086ae4ed7 /share/scripts
parentAdding upstream version 20170522. (diff)
downloadopen-infrastructure-compute-tools-13f1aa11bd770faf8e66a72a7ac34fc1f7e2305a.tar.xz
open-infrastructure-compute-tools-13f1aa11bd770faf8e66a72a7ac34fc1f7e2305a.zip
Adding upstream version 20170629.upstream/20170629
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/scripts')
-rwxr-xr-xshare/scripts/curl5
-rwxr-xr-xshare/scripts/debconf82
-rwxr-xr-xshare/scripts/debconf.d/0003-debconf40
-rwxr-xr-xshare/scripts/debootstrap5
4 files changed, 89 insertions, 43 deletions
diff --git a/share/scripts/curl b/share/scripts/curl
index 18d49c0..a338020 100755
--- a/share/scripts/curl
+++ b/share/scripts/curl
@@ -57,6 +57,11 @@ Parameters ()
shift 2
;;
+ --cnt.container-server)
+ # ignore
+ shift 2
+ ;;
+
-s|--script)
# ignore
shift 2
diff --git a/share/scripts/debconf b/share/scripts/debconf
index c90e851..5441acc 100755
--- a/share/scripts/debconf
+++ b/share/scripts/debconf
@@ -57,6 +57,11 @@ Parameters ()
shift 2
;;
+ --cnt.container-server)
+ # ignore
+ shift 2
+ ;;
+
-s|--script)
# ignore
shift 2
@@ -294,10 +299,6 @@ Pin: release n=${DIST}-updates
Pin-Priority: 999
Package: *
-Pin: release n=${DIST}-lts
-Pin-Priority: 999
-
-Package: *
Pin: release n=${DIST}-extras
Pin-Priority: 999
EOF
@@ -486,10 +487,6 @@ Configure_system ()
echo "deb ${PARENT_MIRROR} ${PARENT_DIST}-updates ${PARENT_AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/debian.list"
;;
- ${PARENT_DIST}-lts)
- echo "deb ${PARENT_MIRROR} ${PARENT_DIST}-lts ${PARENT_AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/debian.list"
- ;;
-
${PARENT_DIST}-backports)
echo "deb ${PARENT_MIRROR} ${PARENT_DIST}-backports ${PARENT_AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/debian.list"
;;
@@ -534,14 +531,6 @@ Configure_system ()
echo "deb ${MIRROR} ${DIST}-updates-staging ${AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
;;
- ${DIST}-lts)
- echo "deb ${MIRROR} ${DIST}-lts ${AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
- ;;
-
- ${DIST}-lts-staging)
- echo "deb ${MIRROR} ${DIST}-lts-staging ${AREA}" >> "${DIRECTORY}/etc/apt/sources.list.d/progress-linux.list"
- ;;
-
${DIST}-extras)
if echo "${AREA}" | grep -qs non-free
then
@@ -724,7 +713,6 @@ EOF
rm -f "${DIRECTORY}/.container-command"
fi
-
}
Configure_network ()
@@ -811,8 +799,6 @@ EOF
Configure_systemd_networkd ()
{
- # FIXME: postup/postdown: multi-interface route
-
DIRECTORY="${1}"
# Enable systemd-networkd
@@ -830,8 +816,8 @@ Configure_systemd_networkd ()
eval IPV4_ADDRESS="$`echo NETWORK${NUMBER}_IPV4_ADDRESS`"
eval IPV4_GATEWAY="$`echo NETWORK${NUMBER}_IPV4_GATEWAY`"
eval IPV4_NETMASK="$`echo NETWORK${NUMBER}_IPV4_NETMASK`"
-# eval IPV4_POST_UP="$`echo NETWORK${NUMBER}_IPV4_POST_UP`"
-# eval IPV4_POST_DOWN="$`echo NETWORK${NUMBER}_IPV4_POST_DOWN`"
+ eval IPV4_POST_UP="$`echo NETWORK${NUMBER}_IPV4_POST_UP`"
+ eval IPV4_POST_DOWN="$`echo NETWORK${NUMBER}_IPV4_POST_DOWN`"
if [ -z "${IPV4_METHOD}" ]
then
@@ -879,6 +865,46 @@ EOF
fi
esac
+ if [ -n "${IPV4_POST_UP}" ]
+ then
+
+cat > "${DIRECTORY}/etc/systemd/system/cnt-ipv4-post-up-eth${NUMBER}.service" << EOF
+[Unit]
+Description=container-tools IPV4_POST_UP
+After=network-online.target
+Wants=network-online.target
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -c "${IPV4_POST_UP}"
+
+[Install]
+WantedBy=multi-user.target
+EOF
+
+ chroot "${DIRECTORY}" systemctl enable cnt-ipv4-post-up-eth${NUMBER}.service
+ fi
+
+ if [ -n "${IPV4_POST_DOWN}" ]
+ then
+
+cat > "${DIRECTORY}/etc/systemd/system/cnt-ipv4-post-down-eth${NUMBER}.service" << EOF
+[Unit]
+Description=container-tools IPV4_POST_DOWN
+After=network.target
+Wants=network.target
+
+[Service]
+Type=oneshot
+ExecStart=/bin/sh -c "${IPV4_POST_DOWN}"
+
+[Install]
+WantedBy=multi-user.target
+EOF
+
+ chroot "${DIRECTORY}" systemctl enable cnt-ipv4-post-down-eth${NUMBER}.service
+ fi
+
NUMBER="$((${NUMBER} + 1))"
done
}
@@ -904,12 +930,14 @@ Commands ()
HOSTNAME_SHORT="$(echo ${NAME} | cut -c-8)"
HOST_INTERFACE_NAME="$(echo ${NETWORK0_VETH:-veth-${HOSTNAME_SHORT}-0})"
- sed -i -e "s|^cnt.auto=.*|cnt.auto=${CNT_AUTO}|" "${CONFIG}/${NAME}.conf"
- sed -i -e "s|^cnt.network-bridge=.*|cnt.network-bridge=${HOST_INTERFACE_NAME}:${NETWORK0_BRIDGE:-br0}|g" "${CONFIG}/${NAME}.conf"
- sed -i -e "s|^cnt.overlay=.*|cnt.overlay=${CNT_OVERLAY}|g" "${CONFIG}/${NAME}.conf"
- sed -i -e "s|^bind=.*|bind=${BIND}|" "${CONFIG}/${NAME}.conf"
- sed -i -e "s|^bind-ro=.*|bind-ro=${BIND_RO}|" "${CONFIG}/${NAME}.conf"
- sed -i -e "s|^network-veth-extra=.*|network-veth-extra=${HOST_INTERFACE_NAME}:eth0|g" "${CONFIG}/${NAME}.conf"
+ sed -i -e "s|^cnt.auto=.*|cnt.auto=${CNT_AUTO}|g" \
+ -e "s|^cnt.container-server=.*|cnt.container-server=${CNT_CONTAINER_SERVER}|g" \
+ -e "s|^cnt.network-bridge=.*|cnt.network-bridge=${HOST_INTERFACE_NAME}:${NETWORK0_BRIDGE:-br0}|g" \
+ -e "s|^cnt.overlay=.*|cnt.overlay=${CNT_OVERLAY}|g" \
+ -e "s|^bind=.*|bind=${BIND}|g" \
+ -e "s|^bind-ro=.*|bind-ro=${BIND_RO}|g" \
+ -e "s|^network-veth-extra=.*|network-veth-extra=${HOST_INTERFACE_NAME}:eth0|g" \
+ "${CONFIG}/${NAME}.conf"
for NUMBER in $(seq 1 ${NETWORK_NUMBER})
do
diff --git a/share/scripts/debconf.d/0003-debconf b/share/scripts/debconf.d/0003-debconf
index 1364bd0..8e78b3e 100755
--- a/share/scripts/debconf.d/0003-debconf
+++ b/share/scripts/debconf.d/0003-debconf
@@ -182,8 +182,8 @@ Archives ()
;;
*)
- db_subst cnt-debconf/archives CHOICES "Security, Updates, LTS, Backports, Proposed Updates"
- db_subst cnt-debconf/archives CHOICES_C "${DISTRIBUTION}-security, ${DISTRIBUTION}-updates, ${DISTRIBUTION}-lts, ${DISTRIBUTION}-backports, ${DISTRIBUTION}-proposed-updates"
+ db_subst cnt-debconf/archives CHOICES "Security, Updates, Backports, Proposed Updates"
+ db_subst cnt-debconf/archives CHOICES_C "${DISTRIBUTION}-security, ${DISTRIBUTION}-updates, ${DISTRIBUTION}-backports, ${DISTRIBUTION}-proposed-updates"
case "${PARENT_DISTRIBUTION}" in
sid)
@@ -191,7 +191,7 @@ Archives ()
;;
*)
- #db_set cnt-debconf/archives "${DISTRIBUTION}-security, ${DISTRIBUTION}-updates, ${DISTRIBUTION}-lts, ${DISTRIBUTION}-backports"
+ #db_set cnt-debconf/archives "${DISTRIBUTION}-security, ${DISTRIBUTION}-updates, ${DISTRIBUTION}-backports"
db_set cnt-debconf/archives "${DISTRIBUTION}-security, ${DISTRIBUTION}-updates"
;;
esac
@@ -204,10 +204,10 @@ Archives ()
progress-linux)
DIST="$(echo ${DISTRIBUTION} | sed -e 's|-backports||')"
- db_subst cnt-debconf/archives CHOICES "staging, Security, Security (staging), Updates, Updates (staging), LTS, LTS (staging), Extras, Extras (staging), Backports, Backports (staging), Backports Extras, Backports Extras (staging)"
- db_subst cnt-debconf/archives CHOICES_C "${DIST}-staging, ${DIST}-security, ${DIST}-security-staging, ${DIST}-updates, ${DIST}-updates-staging, ${DIST}-lts, ${DIST}-lts-staging, ${DIST}-extras, ${DIST}-extras-staging, ${DIST}-backports, ${DIST}-backports-staging, ${DIST}-backports-extras, ${DIST}-backports-extras-staging"
+ db_subst cnt-debconf/archives CHOICES "staging, Security, Security (staging), Updates, Updates (staging), Extras, Extras (staging), Backports, Backports (staging), Backports Extras, Backports Extras (staging)"
+ db_subst cnt-debconf/archives CHOICES_C "${DIST}-staging, ${DIST}-security, ${DIST}-security-staging, ${DIST}-updates, ${DIST}-updates-staging, ${DIST}-extras, ${DIST}-extras-staging, ${DIST}-backports, ${DIST}-backports-staging, ${DIST}-backports-extras, ${DIST}-backports-extras-staging"
- db_set cnt-debconf/archives "${DIST}-security, ${DIST}-updates, ${DIST}-lts, ${DIST}-extras, ${DIST}-backports, ${DIST}-backports-extras"
+ db_set cnt-debconf/archives "${DIST}-security, ${DIST}-updates, ${DIST}-extras, ${DIST}-backports, ${DIST}-backports-extras"
db_fset cnt-debconf/archives seen false
;;
esac
@@ -235,12 +235,12 @@ Parent_archives ()
then
case "${MODE}" in
progress-linux)
- db_subst cnt-debconf/parent-archives CHOICES "Security, Updates, LTS, Backports, Proposed Updates"
- db_subst cnt-debconf/parent-archives CHOICES_C "${PARENT_DISTRIBUTION}-security, ${PARENT_DISTRIBUTION}-updates, ${PARENT_DISTRIBUTION}-lts, ${PARENT_DISTRIBUTION}-backports, ${PARENT_DISTRIBUTION}-proposed-updates"
+ db_subst cnt-debconf/parent-archives CHOICES "Security, Updates, Backports, Proposed Updates"
+ db_subst cnt-debconf/parent-archives CHOICES_C "${PARENT_DISTRIBUTION}-security, ${PARENT_DISTRIBUTION}-updates, ${PARENT_DISTRIBUTION}-backports, ${PARENT_DISTRIBUTION}-proposed-updates"
case "${PARENT_DISTRIBUTION}" in
*)
- #db_set cnt-debconf/parent-archives "${PARENT_DISTRIBUTION}-security, ${PARENT_DISTRIBUTION}-lts, ${PARENT_DISTRIBUTION}-updates, ${PARENT_DISTRIBUTION}-backports"
+ #db_set cnt-debconf/parent-archives "${PARENT_DISTRIBUTION}-security, ${PARENT_DISTRIBUTION}-updates, ${PARENT_DISTRIBUTION}-backports"
db_set cnt-debconf/parent-archives "${PARENT_DISTRIBUTION}-security, ${PARENT_DISTRIBUTION}-updates"
;;
esac
@@ -253,7 +253,7 @@ Parent_archives ()
;;
*)
- db_subst cnt-debconf/parent-archives CHOICES "Security, Updates, LTS, Backports, Proposed Updates"
+ db_subst cnt-debconf/parent-archives CHOICES "Security, Updates, Backports, Proposed Updates"
db_subst cnt-debconf/parent-archives CHOICES_C "${ARCHIVES}"
db_set cnt-debconf/parent-archives "${ARCHIVES}"
@@ -270,7 +270,7 @@ Parent_archives ()
progress-linux)
case "${PARENT_DISTRIBUTION}" in
*)
- #PARENT_ARCHIVES="${PARENT_DISTRIBUTION}-security, ${PARENT_DISTRIBUTION}-updates, ${PARENT_DISTRIBUTION}-lts, ${PARENT_DISTRIBUTION}-backports"
+ #PARENT_ARCHIVES="${PARENT_DISTRIBUTION}-security, ${PARENT_DISTRIBUTION}-updates, ${PARENT_DISTRIBUTION}-backports"
PARENT_ARCHIVES="${PARENT_DISTRIBUTION}-security, ${PARENT_DISTRIBUTION}-updates"
;;
esac
@@ -1008,18 +1008,26 @@ Internal_options ()
if db_get cnt-debconf/auto
then
- CNT_AUTO="${RET:-FQDN}" # string (w/o empty)
+ CNT_AUTO="${RET:-true}" # string (w/o empty)
fi
- CNT_AUTO="${CNT_AUTO:-FQDN}"
+ CNT_AUTO="${CNT_AUTO:-true}"
+ echo "CNT_AUTO=\"${CNT_AUTO}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
+
+ if db_get cnt-debconf/container-server
+ then
+ CNT_CONTAINER_SERVER="${RET:-FQDN}" # string (w/o empty)
+ fi
+
+ CNT_CONTAINER_SERVER="${CNT_CONTAINER_SERVER:-FQDN}"
- case "${CNT_AUTO}" in
+ case "${CNT_CONTAINER_SERVER}" in
FQDN)
- CNT_AUTO="$(hostname -f)"
+ CNT_CONTAINER_SERVER="$(hostname -f)"
;;
esac
- echo "CNT_AUTO=\"${CNT_AUTO}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
+ echo "CNT_CONTAINER_SERVER=\"${CNT_CONTAINER_SERVER}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
if db_get cnt-debconf/bind
then
diff --git a/share/scripts/debootstrap b/share/scripts/debootstrap
index 79a3193..0c19d54 100755
--- a/share/scripts/debootstrap
+++ b/share/scripts/debootstrap
@@ -56,6 +56,11 @@ Parameters ()
shift 2
;;
+ --cnt.container-server)
+ # ignore
+ shift 2
+ ;;
+
-s|--script)
# ignore
shift 2