summaryrefslogtreecommitdiffstats
path: root/share/scripts/debootstrap
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-03-02 10:39:25 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-03-02 10:39:34 +0000
commitc0d285f4b03b176f1e1b5e4ac8968f2c8aa4492d (patch)
treeda3f1fbc3889d6dbe20584434250ed673b84682d /share/scripts/debootstrap
parentReleasing debian version 20190222-1. (diff)
downloadopen-infrastructure-compute-tools-c0d285f4b03b176f1e1b5e4ac8968f2c8aa4492d.tar.xz
open-infrastructure-compute-tools-c0d285f4b03b176f1e1b5e4ac8968f2c8aa4492d.zip
Merging upstream version 20190301.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'share/scripts/debootstrap')
-rwxr-xr-xshare/scripts/debootstrap24
1 files changed, 19 insertions, 5 deletions
diff --git a/share/scripts/debootstrap b/share/scripts/debootstrap
index 7910ac3..61f5e13 100755
--- a/share/scripts/debootstrap
+++ b/share/scripts/debootstrap
@@ -20,8 +20,10 @@
set -e
PROJECT="open-infrastructure"
+SOFTWARE="compute-tools"
PROGRAM="container"
-SCRIPT="${0}"
+
+SCRIPT="$(basename ${0})"
HOOKS="/etc/${PROJECT}/${PROGRAM}/hooks"
MACHINES="/var/lib/machines"
@@ -126,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
@@ -162,8 +176,8 @@ done
mkdir -p "${MACHINES}"
-debootstrap --arch=${ARCHITECTURE} --include=${INCLUDE} ${DISTRIBUTION} ${MACHINES}/${NAME} ${MIRROR}
-chroot "${MACHINES}/${NAME}" apt-get clean
+${BOOTSTRAP} ${BOOTSTRAP_OPTIONS} --arch=${ARCHITECTURE} --include=${INCLUDE} ${DISTRIBUTION} ${MACHINES}/${NAME} ${MIRROR}
+chroot "${MACHINES}/${NAME}" apt clean
# Setting hostname
echo "${NAME}" > "${MACHINES}/${NAME}/etc/hostname"