summaryrefslogtreecommitdiffstats
path: root/share/scripts/debootstrap
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2019-02-26 19:15:21 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2019-03-02 08:40:00 +0000
commit19392bf2121802e1866bdb44690b0452ade157f9 (patch)
tree422b3ae517f62ca0e1d8392197e1480f97234f6c /share/scripts/debootstrap
parentAdding same internal name strings in all scripts. (diff)
downloadcompute-tools-19392bf2121802e1866bdb44690b0452ade157f9.tar.xz
compute-tools-19392bf2121802e1866bdb44690b0452ade157f9.zip
Adding support for using mmdebstrap in container debootstrap create script.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-xshare/scripts/debootstrap21
1 files changed, 17 insertions, 4 deletions
diff --git a/share/scripts/debootstrap b/share/scripts/debootstrap
index 7b73c26..61f5e13 100755
--- a/share/scripts/debootstrap
+++ b/share/scripts/debootstrap
@@ -22,7 +22,8 @@ set -e
PROJECT="open-infrastructure"
SOFTWARE="compute-tools"
PROGRAM="container"
-SCRIPT="${0}"
+
+SCRIPT="$(basename ${0})"
HOOKS="/etc/${PROJECT}/${PROGRAM}/hooks"
MACHINES="/var/lib/machines"
@@ -127,9 +128,21 @@ then
exit 1
fi
-if [ ! -x /usr/sbin/debootstrap ]
+case "${SCRIPT}" in
+ debootstrap)
+ BOOTSTRAP="/usr/sbin/debootstrap"
+ BOOTSTRAP_OPTIONS=""
+ ;;
+
+ mmdebstrap)
+ BOOTSTRAP="/usr/bin/mmdebstrap"
+ BOOTSTRAP_OPTIONS="--mode=root"
+ ;;
+esac
+
+if [ ! -x "${BOOTSTRAP}" ]
then
- echo "'${NAME}': /usr/sbin/debootstrap - no such file." >&2
+ echo "'${NAME}': ${BOOTSTRAP} - no such file." >&2
exit 1
fi
@@ -163,7 +176,7 @@ done
mkdir -p "${MACHINES}"
-debootstrap --arch=${ARCHITECTURE} --include=${INCLUDE} ${DISTRIBUTION} ${MACHINES}/${NAME} ${MIRROR}
+${BOOTSTRAP} ${BOOTSTRAP_OPTIONS} --arch=${ARCHITECTURE} --include=${INCLUDE} ${DISTRIBUTION} ${MACHINES}/${NAME} ${MIRROR}
chroot "${MACHINES}/${NAME}" apt clean
# Setting hostname