summaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-05-30 09:58:45 +0200
committerSébastien Dailly <sebastien@dailly.me>2026-05-30 09:58:45 +0200
commit8b2420f74367e4973be0dd9556c021588abfe591 (patch)
treeb95fbf8d5aefc51f619b2506d8ae75ee9f29b75b /build.sh
Initial commit
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..0bbd47c
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+usage() {
+ echo "usage: BUILDROOT_DIR=${BUILDROOT_DIR} $0 {boardname} all"
+ echo
+ echo "with boardname in"
+ echo " - orangepi_zero"
+ echo " - qemu_x86_64"
+ echo " - raspberrypi0[w]"
+}
+
+test -z ${BUILDROOT_DIR} && BUILDROOT_DIR="../buildroot-2026.02/"
+
+if [ ! -d ${BUILDROOT_DIR} ]; then
+ usage
+ echo
+ echo "Error: the path to buildroot \"${BUILDROOT_DIR}\" does not exists"
+ exit 1
+fi
+
+export BOARDNAME=$1
+
+case "$BOARDNAME" in
+ orangepi_zero)
+ ;;
+ qemu_x86_64)
+ ;;
+ raspberrypi0 | raspberrypi0w)
+ ;;
+ *)
+ usage
+ echo
+ echo "Error: unknown card \"$1\""
+ exit 1
+ ;;
+esac
+
+# Merge custom buildroot configurations
+CONFIG_="BR2" KCONFIG_CONFIG="configs/${BOARDNAME}_defconfig" "$BUILDROOT_DIR/support/kconfig/merge_config.sh" -m -r \
+ "${BUILDROOT_DIR}/configs/${BOARDNAME}_defconfig" \
+ configs/config \
+ "configs/$BOARDNAME"
+sed "1i ### DO NOT EDIT, this file was automatically generated\n" -i "configs/${BOARDNAME}_defconfig"
+
+## Create full buildroot configuration
+BR2_EXTERNAL="$(pwd)" make O="$(pwd)/output/${BOARDNAME}" -C "${BUILDROOT_DIR}" "${BOARDNAME}_defconfig"
+
+# Build
+BR2_EXTERNAL="$(pwd)" make O="$(pwd)/output/${BOARDNAME}" -C ${BUILDROOT_DIR} "$2"