From 2161762ebc50914fe51a7923945c64e6ce4ee25f Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Tue, 28 Dec 2021 21:46:06 +0800 Subject: [PATCH] update build shell script, add system and distro --- bsp/build.sh | 42 ++++++++++++++++++++++-------------------- 1 files changed, 22 insertions(+), 20 deletions(-) diff --git a/bsp/build.sh b/bsp/build.sh index 0ad0a30..7fd2e92 100755 --- a/bsp/build.sh +++ b/bsp/build.sh @@ -2,17 +2,16 @@ PRJ_PATH=`pwd` -BOARD=imx6ull - -#CROSS_TOOL=arm-linux-gnueabihf- +BOARD=igkboard +BSP_BRANCH="lf-5.10.52-2.1.0" 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/yocto or stretch/buster/bullseye for debian system -ROOTFS=buster +# $SYSTEM should be buildroot, yocto or debian +# Buildroot distro should be: buildroot-2021.02 +# Yocto distro should be : hardknott +# Debian distro should be : buster or bullseye +SYSTEM=buildroot +DISTRO=v2021.02 set -u set -e @@ -24,21 +23,20 @@ cd $PRJ_PATH sed -i "s|^BOARD.*|BOARD=${BOARD}|g" ${DIR}/build.sh + sed -i "s|^BSP_BRANCH.*|BSP_BRANCH=${BSP_BRANCH}|g" ${DIR}/build.sh + sed -i "s|^CROSS_TOOL.*|CROSS_TOOL=${CROSS_TOOL}|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|^BSP_BRANCH.*|BSP_BRANCH=${BSP_BRANCH}|g" ${DIR}/build.sh - elif [ $DIR = rootfs -o $DIR == images -o $DIR = tarball ] ; then - sed -i "s|^ROOTFS=.*|ROOTFS=${ROOTFS}|g" ${DIR}/build.sh - fi + sed -i "s|^SYSTEM=.*|SYSTEM=${SYSTEM}|g" ${DIR}/build.sh + sed -i "s|^DISTRO=.*|DISTRO=${DISTRO}|g" ${DIR}/build.sh } function do_modify() -{ +{ do_modify_build tarball do_modify_build bootloader do_modify_build kernel - do_modify_build rootfs + do_modify_build drivers + do_modify_build rootfs do_modify_build images } @@ -58,7 +56,7 @@ function do_action() { - folder=$1 + folder=$1 action=$2 cd $PRJ_PATH/$folder @@ -67,7 +65,7 @@ ./build.sh -b elif [ $action == "clean" ] ; then ./build.sh -c - fi + fi cd $PRJ_PATH } @@ -115,7 +113,10 @@ do_usage fi -do_modify +if [ $action == "build" ] ; then + do_modify + cd tarball && ./build.sh && cd - +fi if [ $1 == "bsp" ] ; then if [ $action == "build" ] ; then @@ -123,6 +124,7 @@ fi do_action bootloader $action do_action kernel $action + do_action drivers $action elif [ $1 == "image" ] ; then do_root "yes" do_action rootfs $action -- Gitblit v1.9.1