#!/bin/bash if [ $# != 1 ]; then echo "Usage : build-rpi3.sh " echo " architecture : arm or arm64" echo " e.g) build-rpi3.sh arm" exit fi # Check this system has ccache check_ccache() { type ccache if [ "$?" -eq "0" ]; then CCACHE=ccache fi } check_ccache if [ $1 = "arm" ]; then echo "ARM" rm -f arch/arm/boot/zImage rm -f arch/arm/boot/dts/*.dtb CROSS_COMPILER=arm-linux-gnueabi- if ! [ -e .config ] ; then make ARCH=arm CROSS_COMPILE="$CROSS_COMPILER" tizen_bcm2709_defconfig fi make ARCH=arm CROSS_COMPILE="$CROSS_COMPILER" -j8 if [ ! -f "./arch/arm/boot/zImage" ]; then echo "Build fail" exit 1 fi elif [ $1 = "arm64" ]; then echo "ARM64" rm -f arch/arm64/boot/Image rm -f arch/arm64/boot/dts/broadcom/*.dtb CROSS_COMPILER=aarch64-linux-gnu- if ! [ -e .config ] ; then make ARCH=arm64 CROSS_COMPILE="$CROSS_COMPILER" tizen_bcmrpi3_defconfig fi make ARCH=arm64 CROSS_COMPILE="$CROSS_COMPILER" -j8 if [ ! -f "./arch/arm64/boot/Image" ]; then echo "Build fail" exit 1 fi fi