From ce88f18bae951a614940e0e4497e9f20aa4011b6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 1 Jun 2016 15:56:41 +0200 Subject: Merging upstream version 20160601. Signed-off-by: Daniel Baumann --- share/scripts/debconf | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'share/scripts/debconf') diff --git a/share/scripts/debconf b/share/scripts/debconf index 55c2b8b..4f29238 100755 --- a/share/scripts/debconf +++ b/share/scripts/debconf @@ -907,7 +907,9 @@ 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|^bind=.*|bind=${BIND}|" "${CONFIG}/${NAME}.conf" sed -i -e "s|^network-veth-extra=.*|network-veth-extra=${HOST_INTERFACE_NAME}:eth0|g" "${CONFIG}/${NAME}.conf" for NUMBER in $(seq 1 ${NETWORK_NUMBER}) @@ -990,13 +992,42 @@ Cleanup_system "${CACHE}/${DISTRIBUTION}_${ARCHITECTURE}" ## Specific parts cp -a "${CACHE}/${DISTRIBUTION}_${ARCHITECTURE}" "${MACHINES}/${NAME}" +# Mounting bind mounts +if [ -n "${BIND}" ] +then + BINDS="$(echo ${BIND} | sed -e 's|;| |g')" + + for ENTRY in ${BINDS} + do + SOURCE="$(echo ${ENTRY} | awk -F: '{ print $1 }')" + TARGET="$(echo ${ENTRY} | awk -F: '{ print $2 }')" + + mkdir -p "${SOURCE}" + mkdir -p "${MACHINES}/${NAME}/${TARGET}" + + mount -o bind "${SOURCE}" "${MACHINES}/${NAME}/${TARGET}" + done +fi + Configure_system "${MACHINES}/${NAME}" Configure_network "${MACHINES}/${NAME}" Cleanup_system "${MACHINES}/${NAME}" Commands "${MACHINES}/${NAME}" +# Unmounting bind mounts +if [ -n "${BIND}" ] +then + BINDS="$(echo ${BIND} | sed -e 's|;| |g')" + + for ENTRY in ${BINDS} + do + TARGET="$(echo ${ENTRY} | awk -F: '{ print $2 }')" + + umount "${MACHINES}/${NAME}/${TARGET}" + done +fi + # remove debconf temporary files -#FIXME -#echo rm --preserve-root --one-file-system -rf "${DEBCONF_TMPDIR}" -rmdir --ignore-fail-on-non-empty /tmp/container-tools || true +rm --preserve-root --one-file-system -rf "${DEBCONF_TMPDIR}" +rmdir --ignore-fail-on-non-empty /tmp/container-tools 2>&1 || true -- cgit v1.2.3