diff options
| author | Reiner Herrmann <reiner@reiner-h.de> | 2016-01-31 20:34:51 +0100 |
|---|---|---|
| committer | Reiner Herrmann <reiner@reiner-h.de> | 2016-01-31 20:34:51 +0100 |
| commit | f749d8cec803b7a069e0ae98b95a423c2b34b8b6 (patch) | |
| tree | 49dfb0c50e331ed938b8bfb2f6291026a8e02bed /debootstrap.sh | |
| parent | ff7ca7ca72437ed010624514320f364b87dc778c (diff) | |
Support building for different architectures
Usage:
$ ARCH=i386 ./debootstrap.sh
Diffstat (limited to 'debootstrap.sh')
| -rwxr-xr-x | debootstrap.sh | 13 |
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" |
