Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 23 additions & 18 deletions kernel/scripts/build_kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,42 @@
#
# Author: Bjordis Collaku <[email protected]>
# ===================================================
set -euo pipefail

kpath=$BUILD_TOP/qcom-next/arch/arm64/boot
CRD_DTB=$kpath/dts/qcom/x1e80100-crd.dtb
EVK_DTB=$kpath/dts/qcom/hamoa-iot-evk.dtb
QCS6490_DTB=$kpath/dts/qcom/qcs6490-rb3gen2.dtb
QCS8300_DTB=$kpath/dts/qcom/qcs8300-ride.dtb
QCS9100_DTB=$kpath/dts/qcom/qcs9100-ride-r3.dtb
KERNEL_DIR=${KERNEL_DIR:-qcom-next}

KPATH=$BUILD_TOP/$KERNEL_DIR/arch/arm64/boot
OUT_PATH=$BUILD_TOP/out

DTBS=(
"$KPATH/dts/qcom/x1e80100-crd.dtb"
"$KPATH/dts/qcom/hamoa-iot-evk.dtb"
"$KPATH/dts/qcom/qcs6490-rb3gen2.dtb"
"$KPATH/dts/qcom/qcs8300-ride.dtb"
"$KPATH/dts/qcom/qcs9100-ride-r3.dtb"
)

# Clean previous build
rm -rf $BUILD_TOP/out/*;
rm -rf $OUT_PATH/*;

# Make config
cd $BUILD_TOP/qcom-next/
cd $BUILD_TOP/$KERNEL_DIR/
make ARCH=arm64 defconfig qcom.config
# Deploy boot config to out/
cp $BUILD_TOP/qcom-next/.config $BUILD_TOP/out/
cp $BUILD_TOP/$KERNEL_DIR/.config $OUT_PATH

# Make kernel
make ARCH=arm64 -j32;
make ARCH=arm64 -j$(nproc)
# Deploy kernel Image to out/
cp $kpath/Image $BUILD_TOP/out/
cp $KPATH/Image $OUT_PATH

# Make modules
mkdir -p $BUILD_TOP/out/modules/
mkdir -p $OUT_PATH/modules/
make ARCH=arm64 modules
# Deploy kernel modules to out/
make ARCH=arm64 modules_install INSTALL_MOD_PATH=$BUILD_TOP/out/modules INSTALL_MOD_STRIP=1
make ARCH=arm64 modules_install INSTALL_MOD_PATH=$OUT_PATH/modules INSTALL_MOD_STRIP=1

# Deploy device tree blobs to out/
[ -f "$CRD_DTB" ] && cp "$CRD_DTB" "$BUILD_TOP/out/"
[ -f "$EVK_DTB" ] && cp "$EVK_DTB" "$BUILD_TOP/out/"
[ -f "$QCS6490_DTB" ] && cp "$QCS6490_DTB" "$BUILD_TOP/out/"
[ -f "$QCS8300_DTB" ] && cp "$QCS8300_DTB" "$BUILD_TOP/out/"
[ -f "$QCS9100_DTB" ] && cp "$QCS9100_DTB" "$BUILD_TOP/out/"
for dtb in "${DTBS[@]}"; do
[ -f "$dtb" ] && cp "$dtb" "$OUT_PATH/"
done
Loading