summaryrefslogtreecommitdiffstats
path: root/share/scripts
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2016-08-04 13:45:49 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2016-08-04 13:50:13 +0000
commite1ac8c36854fbeb60a53a5090fbb673b2a7b9d09 (patch)
treecc969c8a612fe7412f9d14759e6dc64c77b2a5a1 /share/scripts
parentReleasing debian version 20160701-1. (diff)
downloadopen-infrastructure-compute-tools-e1ac8c36854fbeb60a53a5090fbb673b2a7b9d09.tar.xz
open-infrastructure-compute-tools-e1ac8c36854fbeb60a53a5090fbb673b2a7b9d09.zip
Merging upstream version 20160801.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'share/scripts')
-rwxr-xr-xshare/scripts/debconf43
-rwxr-xr-xshare/scripts/debconf.d/0003-debconf7
2 files changed, 50 insertions, 0 deletions
diff --git a/share/scripts/debconf b/share/scripts/debconf
index aa1c798..4c89e6f 100755
--- a/share/scripts/debconf
+++ b/share/scripts/debconf
@@ -909,6 +909,7 @@ Commands ()
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|^network-veth-extra=.*|network-veth-extra=${HOST_INTERFACE_NAME}:eth0|g" "${CONFIG}/${NAME}.conf"
@@ -1010,12 +1011,54 @@ then
done
fi
+# Mounting overlay mounts
+if [ -n "${CNT_OVERLAY}" ]
+then
+ CNT_OVERLAYS="$(echo ${CNT_OVERLAY} | sed -e 's|;| |g')"
+
+ for CNT_OVERLAY in ${CNT_OVERLAYS}
+ do
+ DIRECTORY_LOWER="$(echo ${CNT_OVERLAY} | awk -F: '{ print $1 }')"
+ DIRECTORY_UPPER="$(echo ${CNT_OVERLAY} | awk -F: '{ print $2 }')"
+ DIRECTORY_WORK="$(echo ${CNT_OVERLAY} | awk -F: '{ print $3 }')"
+ DIRECTORY_MERGED="$(echo ${CNT_OVERLAY} | awk -F: '{ print $4 }')"
+
+ for DIRECTORY in "${DIRECTORY_LOWER}" "${DIRECTORY_UPPER}" "${DIRECTORY_WORK}" "${DIRECTORY_MERGED}"
+ do
+ mkdir -p "${DIRECTORY}"
+ done
+
+ mount -t overlay overlay-${NAME} -olowerdir="${DIRECTORY_LOWER}",upperdir="${DIRECTORY_UPPER}",workdir="${DIRECTORY_WORK}" "${DIRECTORY_MERGED}"
+ done
+fi
+
Configure_system "${MACHINES}/${NAME}"
Configure_network "${MACHINES}/${NAME}"
Cleanup_system "${MACHINES}/${NAME}"
Commands "${MACHINES}/${NAME}"
+# Unmounting overlay mounts
+if [ -n "${CNT_OVERLAY}" ]
+then
+ CNT_OVERLAYS="$(echo ${CNT_OVERLAY} | sed -e 's|;| |g')"
+
+ for CNT_OVERLAY in ${CNT_OVERLAYS}
+ do
+ DIRECTORY_LOWER="$(echo ${CNT_OVERLAY} | awk -F: '{ print $1 }')"
+ DIRECTORY_UPPER="$(echo ${CNT_OVERLAY} | awk -F: '{ print $2 }')"
+ DIRECTORY_WORK="$(echo ${CNT_OVERLAY} | awk -F: '{ print $3 }')"
+ DIRECTORY_MERGED="$(echo ${CNT_OVERLAY} | awk -F: '{ print $4 }')"
+
+ umount -f "${DIRECTORY_MERGED}"
+
+ for DIRECTORY in "${DIRECTORY_LOWER}" "${DIRECTORY_UPPER}" "${DIRECTORY_WORK}" "${DIRECTORY_MERGED}"
+ do
+ rmdir --ignore-fail-on-non-empty --parents ${DIRECTORY} > /dev/null 2>&1 || true
+ done
+ done
+fi
+
# Unmounting bind mounts
if [ -n "${BIND}" ]
then
diff --git a/share/scripts/debconf.d/0003-debconf b/share/scripts/debconf.d/0003-debconf
index 15a6a15..548fb07 100755
--- a/share/scripts/debconf.d/0003-debconf
+++ b/share/scripts/debconf.d/0003-debconf
@@ -1063,6 +1063,13 @@ Internal_options ()
fi
echo "BIND=\"${BIND}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
+
+ if db_get cnt-debconf/overlay
+ then
+ CNT_OVERLAY="${RET}" # string (w/ empty)
+ fi
+
+ echo "CNT_OVERLAY=\"${CNT_OVERLAY}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
}
Distribution