From 7446c9d377967c23f41044a312441606848f4aac Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 26 May 2016 10:56:09 +0200 Subject: Mounting bind mounts for the duration of the debconf script. Signed-off-by: Daniel Baumann --- share/scripts/debconf | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'share') diff --git a/share/scripts/debconf b/share/scripts/debconf index f4f63d4..1c5884b 100755 --- a/share/scripts/debconf +++ b/share/scripts/debconf @@ -991,12 +991,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}" -- cgit v1.2.3