From 8f86f098b6ea868f8d98b4d26df8382dc4047c81 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Sun, 14 Nov 2021 20:42:34 +0100 Subject: Inital commit --- build.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 build.sh (limited to 'build.sh') diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..7b61baa --- /dev/null +++ b/build.sh @@ -0,0 +1,42 @@ +#!/bin/sh +usage() { + echo "usage: BUILDROOT_DIR=${BUILDROOT_DIR} $0 {boardname} all" + echo + echo "with boardname in" + echo " - raspberrypi0w" + echo " - raspberrypi3" +} + +test -z ${BUILDROOT_DIR} && BUILDROOT_DIR=../buildroot + +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 + raspberrypi0w) + ;; + raspberrypi3) + ;; + *) + 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 +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" -- cgit v1.2.3