diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2017-06-29 09:14:46 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2017-06-29 09:20:38 +0000 |
commit | 13f1aa11bd770faf8e66a72a7ac34fc1f7e2305a (patch) | |
tree | 1cdf704c14e208bc35e4ea25569ff14086ae4ed7 /share/scripts/debconf | |
parent | Adding upstream version 20170522. (diff) | |
download | open-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/debconf')
-rwxr-xr-x | share/scripts/debconf | 82 |
1 files changed, 55 insertions, 27 deletions
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 |