1#!/bin/sh 2 3set +e 4 5SELFPID=$$ 6renice 10 -p "$SELFPID" 7ionice -c 3 -p "$SELFPID" 8 9set -e 10 11TDIR=kernel-build-space/buildresult 12SDIR=kernel-build-space/source/kernel 13 14rm -rf ${TDIR} 15 16mkdir -p ${TDIR} 17 18# Download AOSP's kernel 19cp -R ${SDIR}/common ${TDIR}/common 20cp -R ${SDIR}/common-modules ${TDIR}/common-modules 21 22 23# Build the kernel 24cd ${TDIR}/common 25export ARCH=arm64 26export CROSS_COMPILE=aarch64-linux-gnu- 27KERVER=$(make kernelversion) 28make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig 29for i in arch/arm64/configs/gki_defconfig ../common-modules/virtual-device/virtual_device_core.fragment ../common-modules/virtual-device/linux_distro.fragment; do 30 ./scripts/kconfig/merge_config.sh -O . .config ${i} 31done 32cat <<EOF > ../extraconfig 33EOF 34#./scripts/kconfig/merge_config.sh -O . .config ../extraconfig 35 36make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LOCALVERSION=.aosp-linaro-1-arm64 KDEB_PKGVERSION="${KERVER}"-1 deb-pkg 37 38cd - 39