2014-04-24 13:42:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# vim: set ts=4 sw=4 sts=4 et :
|
|
|
|
|
2014-10-14 16:02:12 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
2014-10-16 16:03:05 +00:00
|
|
|
# Source external scripts
|
2014-10-14 16:02:12 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
2014-04-24 13:42:18 +00:00
|
|
|
. $SCRIPTSDIR/vars.sh
|
|
|
|
|
2014-10-16 16:03:05 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Configurations
|
|
|
|
# ------------------------------------------------------------------------------
|
2014-10-14 16:02:12 +00:00
|
|
|
if [ "$VERBOSE" -ge 2 -o "$DEBUG" == "1" ]; then
|
|
|
|
set -x
|
2014-10-16 16:03:05 +00:00
|
|
|
else
|
|
|
|
set -e
|
2014-10-14 16:02:12 +00:00
|
|
|
fi
|
2014-04-24 13:42:18 +00:00
|
|
|
|
2014-10-14 16:02:12 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Execute any custom pre configuration scripts
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
customStep "$0" "pre"
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Install base debian system
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
if ! [ -f "$INSTALLDIR/tmp/.prepared_debootstrap" ]; then
|
2014-10-16 16:03:05 +00:00
|
|
|
debug "Installing base ${DEBIANVERSION} system"
|
2014-10-14 16:02:12 +00:00
|
|
|
COMPONENTS="" debootstrap --arch=amd64 --include=ncurses-term \
|
|
|
|
--components=main --keyring="${SCRIPTSDIR}/keys/debian-${DEBIANVERSION}-archive-keyring.gpg" \
|
2014-10-16 16:03:05 +00:00
|
|
|
"$DEBIANVERSION" "$INSTALLDIR" "$DEBIAN_MIRROR" || { error "Debootstrap failed!"; exit 1; }
|
2014-10-14 16:02:12 +00:00
|
|
|
chroot "$INSTALLDIR" chmod 0666 "/dev/null"
|
|
|
|
touch "$INSTALLDIR/tmp/.prepared_debootstrap"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Execute any custom post configuration scripts
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
customStep "$0" "post"
|