#!/bin/bash PRJ_PATH=`pwd` BOARD=imx6ull #CROSS_TOOL=arm-linux-gnueabihf- CROSS_TOOL=/opt/buildroot/cortexA7/bin/arm-linux- # bootloader, linux kernel tarball path and branch TAR_PATH=${PRJ_PATH}/tarball BSP_BRANCH="lf-5.10.52-2.1.0" # rootfs should be buildroot or stretch/buster/bullseye for debian system ROOTFS=buildroot set -u set -e function do_modify_build() { DIR=$1 cd $PRJ_PATH sed -i "s|^BOARD.*|BOARD=${BOARD}|g" ${DIR}/build.sh if [ $DIR = bootloader -o $DIR == kernel ] ; then sed -i "s|^CROSS_TOOL.*|CROSS_TOOL=${CROSS_TOOL}|g" ${DIR}/build.sh sed -i "s|^TAR_PATH.*|TAR_PATH=${TAR_PATH}|g" ${DIR}/build.sh sed -i "s|^BSP_BRANCH.*|BSP_BRANCH=${BSP_BRANCH}|g" ${DIR}/build.sh elif [ $DIR = rootfs -o $DIR == images ] ; then sed -i "s|^TAR_PATH.*|TAR_PATH=${TAR_PATH}|g" ${DIR}/build.sh sed -i "s|^ROOTFS=.*|ROOTFS=${ROOTFS}|g" ${DIR}/build.sh elif [ $DIR = tarball ] ; then sed -i "s|^ROOTFS=.*|ROOTFS=${ROOTFS}|g" ${DIR}/build.sh fi } function do_modify() { do_modify_build tarball do_modify_build bootloader do_modify_build kernel do_modify_build rootfs do_modify_build images } function do_build() { cd $PRJ_PATH/tarball && ./build.sh && cd - cd $PRJ_PATH/bootloader && ./build.sh && cd - cd $PRJ_PATH/kernel && ./build.sh && cd - cd $PRJ_PATH/rootfs && ./build.sh && cd - } do_modify do_build