summaryrefslogtreecommitdiff
path: root/debootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'debootstrap.sh')
-rwxr-xr-xdebootstrap.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/debootstrap.sh b/debootstrap.sh
index ead947d..659c166 100755
--- a/debootstrap.sh
+++ b/debootstrap.sh
@@ -8,14 +8,25 @@ DEBDIR=/tmp/debian-chroot
RELEASE=stretch
MIRROR=http://httpredir.debian.org/debian/
+ARCH=${ARCH:-x86_64}
[ -f "build.sh" ] || exit 1
+case "$ARCH" in
+ x86_64)
+ DEBARCH=amd64 ;;
+ i386)
+ DEBARCH=i386 ;;
+ *)
+ echo "Unsupported architecture"
+ exit 1
+esac
+
if [ $(pgrep -c apt-cacher-ng) -gt 0 ]; then
MIRROR="http://localhost:3142/httpredir.debian.org/debian"
fi
-debootstrap $RELEASE "$DEBDIR" "$MIRROR"
+debootstrap --arch=$DEBARCH $RELEASE "$DEBDIR" "$MIRROR"
echo "deb-src $MIRROR $RELEASE main" >> "$DEBDIR/etc/apt/sources.list"
cp -a * "$DEBDIR/usr/src"