diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2016-05-26 08:56:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2016-06-03 11:37:19 +0000 |
commit | 7446c9d377967c23f41044a312441606848f4aac (patch) | |
tree | 72a635360cafa69120e6e176c20c156ff21006bb /share/scripts | |
parent | Adding bind field in debconf cairon-backports example preseed file. (diff) | |
download | compute-tools-7446c9d377967c23f41044a312441606848f4aac.tar.xz compute-tools-7446c9d377967c23f41044a312441606848f4aac.zip |
Mounting bind mounts for the duration of the debconf script.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-x | share/scripts/debconf | 30 |
1 files changed, 30 insertions, 0 deletions
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}" |