From f5d1a41c4fa42db584b52021b723ca5d2592ef36 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Tue, 15 Mar 2022 15:53:59 +0900 Subject: [PATCH] script: update build-rpi4 script to support RT kernel build Update build-rpi4 script to support RT kernel build. Change-Id: I6f6e8e7579b4ae10defc4110949135f0459871ed Signed-off-by: Seung-Woo Kim --- build-rpi4.sh | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/build-rpi4.sh b/build-rpi4.sh index 30af5c5..45c1e8e 100755 --- a/build-rpi4.sh +++ b/build-rpi4.sh @@ -3,10 +3,11 @@ NCPUS=`cat /proc/cpuinfo | grep processor | wc -l` NCPUS=$(($NCPUS * 2)) -if [ $# != 1 ]; then - echo "Usage : $0 " +if [ $# == 0 ]; then + echo "Usage : $0 [rt]" echo " architecture : arm or arm64" echo " e.g) $0 arm" + echo " e.g) $0 arm64 rt" exit fi @@ -21,6 +22,34 @@ check_ccache() check_ccache +cleanup_localversion() +{ + rm -f localversion-rt +} + +DEFCONFIG=tizen_bcm2711_defconfig +touch .kernel_buildenv +if [ "$2" = "rt" ]; then + echo "Build RT-Kernel" + BUILD_VERSION=`cat .kernel_buildenv` + if [ "$BUILD_VERSION" != "RT" ]; then + echo "Previous .config is for Normal Kernel, so remove" + rm -f .config + fi + DEFCONFIG=tizen_bcm2711_rt_defconfig + cp _localversion-rt localversion-rt + trap cleanup_localversion EXIT + echo "RT" > ./.kernel_buildenv +else + echo "Build Normal-Kernel" + BUILD_VERSION=`cat .kernel_buildenv` + if [ "$BUILD_VERSION" == "RT" ]; then + echo "Previous .config is for RT Kernel, so remove" + rm -f .config + fi + echo "NORMAL" > ./.kernel_buildenv +fi + if [ $1 = "arm" ]; then echo "ARM" @@ -28,7 +57,7 @@ if [ $1 = "arm" ]; then rm -f arch/arm/boot/dts/*.dtb if ! [ -e .config ] ; then - make ARCH=arm CROSS_COMPILE="${CCACHE} arm-linux-gnueabi-" tizen_bcm2711_defconfig + make ARCH=arm CROSS_COMPILE="${CCACHE} arm-linux-gnueabi-" ${DEFCONFIG} fi make ARCH=arm CROSS_COMPILE="${CCACHE} arm-linux-gnueabi-" -j $NCPUS @@ -44,7 +73,7 @@ elif [ $1 = "arm64" ]; then rm -f arch/arm64/boot/dts/broadcom/*.dtb if ! [ -e .config ] ; then - make ARCH=arm64 CROSS_COMPILE="${CCACHE} aarch64-linux-gnu-" tizen_bcm2711_defconfig + make ARCH=arm64 CROSS_COMPILE="${CCACHE} aarch64-linux-gnu-" ${DEFCONFIG} fi make ARCH=arm64 CROSS_COMPILE="${CCACHE} aarch64-linux-gnu-" -j $NCPUS if [ ! -f "./arch/arm64/boot/Image" ]; then -- 2.7.4