Files
agnos-builder/build_kernel_headers.sh
2021-09-23 19:08:32 -07:00

37 lines
942 B
Bash
Executable File

#!/bin/bash -e
DEFCONFIG=tici_defconfig
# Get directories and make sure we're in the correct spot to start the build
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
TOOLS=$DIR/tools
TMP_DIR=/tmp/agnos-builder-tmp
OUTPUT_DIR=$DIR/output
BOOT_IMG=./boot.img
cd $DIR
# Clone kernel if not done already
if [ ! -d agnos-kernel-sdm845 ]; then
git submodule init agnos-kernel-sdm845
fi
cd agnos-kernel-sdm845
# Build parameters
export ARCH=arm64
export CROSS_COMPILE=$TOOLS/aarch64-linux-gnu-gcc/bin/aarch64-linux-gnu-
export CC=$TOOLS/aarch64-linux-gnu-gcc/bin/aarch64-linux-gnu-gcc
export LD=$TOOLS/aarch64-linux-gnu-gcc/bin/aarch64-linux-gnu-ld.bfd
# these do anything?
export KCFLAGS="-w"
# Load defconfig and build kernel
echo "-- First make --"
make $DEFCONFIG O=out
echo "-- Second make: $(nproc --all) cores --"
make bindeb-pkg -j$(nproc --all) O=out # Image.gz-dtb
# Copy output
cp linux-headers-*.deb $OUTPUT_DIR