#!/bin/bash
DTB=1
LOCAL_DIR=$(pwd)
KERNEL_DIR=${LOCAL_DIR}/kernel/linux
PRODUCT_OUT=${LOCAL_DIR}/out/target/product/hikey970
HIKEY970_KERNEL=${LOCAL_DIR}/device/linaro/hikey-kernel
#change by ylh
MKBOOTTOOL_DIR=${LOCAL_DIR}/out/host/linux-x86/bin
CURRENT_DIR=${LOCAL_DIR}
NCPU=`grep -c ^processor /proc/cpuinfo`
if [ ! -e ${PRODUCT_OUT} ]
then
mkdir -p ${PRODUCT_OUT}
fi
export ARCH=arm64
export CROSS_COMPILE=${CURRENT_DIR}/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
function check_build_result()
{
if [ $? != 0 ]; then
echo -e "\033[31m $1 build fail! \033[0m"
exit -1
else
echo -e "\033[32m $1 build success! \033[0m"
fi
}
cd ${KERNEL_DIR}
make hikey970_defconfig && \
make -j$[NCPU*2]
# change by ylh
#make -j$[NCPU*2]
check_build_result "Kernel Image"
rm -f arch/arm64/configs/hikey970_temp_defconfig
cp arch/arm64/boot/Image.gz ${HIKEY970_KERNEL}
if [ $DTB -eq 1 ]; then
make hisilicon/kirin9
Hikey970纯粹编译内核脚本
最新推荐文章于 2025-08-13 23:56:02 发布