3 NCPUS=`cat /proc/cpuinfo | grep processor | wc -l`
7 echo "Usage : $0 <architecture> [rt]"
8 echo " architecture : arm or arm64"
10 echo " e.g) $0 arm64 rt"
14 # Check this system has ccache
18 if [ "$?" -eq "0" ]; then
25 cleanup_localversion()
30 DEFCONFIG=tizen_bcm2711_defconfig
31 touch .kernel_buildenv
32 if [ "$2" = "rt" ]; then
33 echo "Build RT-Kernel"
34 BUILD_VERSION=`cat .kernel_buildenv`
35 if [ "$BUILD_VERSION" != "RT" ]; then
36 echo "Previous .config is for Normal Kernel, so remove"
39 DEFCONFIG=tizen_bcm2711_rt_defconfig
40 cp _localversion-rt localversion-rt
41 trap cleanup_localversion EXIT
42 echo "RT" > ./.kernel_buildenv
44 echo "Build Normal-Kernel"
45 BUILD_VERSION=`cat .kernel_buildenv`
46 if [ "$BUILD_VERSION" == "RT" ]; then
47 echo "Previous .config is for RT Kernel, so remove"
50 echo "NORMAL" > ./.kernel_buildenv
53 if [ $1 = "arm" ]; then
56 rm -f arch/arm/boot/zImage
57 rm -f arch/arm/boot/dts/*.dtb
59 if ! [ -e .config ] ; then
60 make ARCH=arm CROSS_COMPILE="${CCACHE} arm-linux-gnueabi-" ${DEFCONFIG}
63 make ARCH=arm CROSS_COMPILE="${CCACHE} arm-linux-gnueabi-" -j $NCPUS
65 if [ ! -f "./arch/arm/boot/zImage" ]; then
69 elif [ $1 = "arm64" ]; then
72 rm -f arch/arm64/boot/Image
73 rm -f arch/arm64/boot/dts/broadcom/*.dtb
75 if ! [ -e .config ] ; then
76 make ARCH=arm64 CROSS_COMPILE="${CCACHE} aarch64-linux-gnu-" ${DEFCONFIG}
78 make ARCH=arm64 CROSS_COMPILE="${CCACHE} aarch64-linux-gnu-" -j $NCPUS
79 if [ ! -f "./arch/arm64/boot/Image" ]; then
85 scripts/mkbootimg_rpi4.sh