summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh5
1 files changed, 3 insertions, 2 deletions
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