From f749d8cec803b7a069e0ae98b95a423c2b34b8b6 Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Sun, 31 Jan 2016 20:34:51 +0100 Subject: Support building for different architectures Usage: $ ARCH=i386 ./debootstrap.sh --- build.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'build.sh') diff --git a/build.sh b/build.sh index f7f2df9..8074c80 100755 --- a/build.sh +++ b/build.sh @@ -5,6 +5,7 @@ set -x BUILDDIR=/tmp/build SRCDIR=$(dirname $(realpath "$0")) +ARCH=${ARCH:-x86_64} SIZE_CFLAGS="-I/tmp/build/include -I/tmp/build/include/ncurses -Os -ffunction-sections -fdata-sections -fno-asynchronous-unwind-tables" SIZE_LDFLAGS="-L/tmp/build/lib -Wl,--gc-sections -Wl,--strip-all" @@ -89,9 +90,9 @@ musl-gcc "$SRCDIR/init.c" -o "$BUILDDIR/rootfs/sbin/init" $SIZE_CFLAGS $SIZE_LDF echo "nod /dev/console 0600 0 0 c 5 1" > rootfs-files.txt pushd linux-*/ patch -p1 < "$SRCDIR/kernel.patch" -cp "$SRCDIR/config-kernel" .config +cp "$SRCDIR/config-kernel-$ARCH" .config make oldconfig -make -j$NPROC bzImage CC="gcc -std=gnu89" +make -j$NPROC bzImage ARCH="$ARCH" CC="gcc -std=gnu89" popd -- cgit v1.2.3