summaryrefslogtreecommitdiffstats
path: root/share/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'share/scripts')
-rwxr-xr-xshare/scripts/debconf37
-rwxr-xr-xshare/scripts/debconf.d/0001-preseed-file4
-rwxr-xr-xshare/scripts/debconf.d/0003-debconf20
3 files changed, 56 insertions, 5 deletions
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
diff --git a/share/scripts/debconf.d/0001-preseed-file b/share/scripts/debconf.d/0001-preseed-file
index 82d2049..03976d2 100755
--- a/share/scripts/debconf.d/0001-preseed-file
+++ b/share/scripts/debconf.d/0001-preseed-file
@@ -30,12 +30,12 @@ then
# user specified one or more preseed files through commandline option
db_set cnt-debconf/preseed-file "${PRESEED_FILE}"
db_fset cnt-debconf/preseed-file seen true
-elif ls "${CONFIG}"/* > /dev/null 2>&1
+elif ls "${CONFIG}"/*.cfg > /dev/null 2>&1
then
# user has not specified preseed files through commandline option,
# showing debconf selection dialog for global preseed file.
- FILES="$(cd ${CONFIG} && find * -not -type d -and -not -name '*.cfg' -and -not -name '*.in' -and -not -name '*.sh')"
+ FILES="$(cd ${CONFIG} && find . -type f -name '*.cfg' -printf '%P\n' | sort)"
PRESEED_FILES="$(for FILE in ${FILES}; do echo -n "${FILE}, "; done | sed -e 's|, $||')"
if [ -n "${PRESEED_FILES}" ]
diff --git a/share/scripts/debconf.d/0003-debconf b/share/scripts/debconf.d/0003-debconf
index df14ef0..baf6879 100755
--- a/share/scripts/debconf.d/0003-debconf
+++ b/share/scripts/debconf.d/0003-debconf
@@ -1041,6 +1041,26 @@ Internal_options ()
fi
echo "HOST_COMMAND=\"${HOST_COMMAND}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
+
+ if db_get cnt-debconf/auto
+ then
+ CNT_AUTO="${RET:-FQDN}" # string (w/o empty)
+
+ case "${CNT_AUTO}" in
+ FQDN)
+ CNT_AUTO="$(hostname -f)"
+ ;;
+ esac
+ fi
+
+ echo "CNT_AUTO=\"${CNT_AUTO}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
+
+ if db_get cnt-debconf/bind
+ then
+ BIND="${RET}" # string (w/ empty)
+ fi
+
+ echo "BIND=\"${BIND}\"" >> "${DEBCONF_TMPDIR}/debconf.default"
}
Distribution