diff --git a/kernel/scripts/build_kernel.sh b/kernel/scripts/build_kernel.sh index 77d0561..82d09a7 100755 --- a/kernel/scripts/build_kernel.sh +++ b/kernel/scripts/build_kernel.sh @@ -11,21 +11,17 @@ # Author: Bjordis Collaku # =================================================== -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 +treedir=${1:-$BUILD_TOP/qcom-next/} +kpath="$(cd "$treedir" && pwd)/arch/arm64/boot" # Clean previous build rm -rf $BUILD_TOP/out/*; # Make config -cd $BUILD_TOP/qcom-next/ +cd $treedir make ARCH=arm64 defconfig qcom.config # Deploy boot config to out/ -cp $BUILD_TOP/qcom-next/.config $BUILD_TOP/out/ +cp $treedir/.config $BUILD_TOP/out/ # Make kernel make ARCH=arm64 -j32; @@ -38,9 +34,5 @@ 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 -# 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/" +# Deploy ALL device tree blobs (*.dtb) to out/ (recursively) +find "$kpath/dts" -type f -name '*.dtb' -print0 | xargs -0 -I{} cp "{}" "$BUILD_TOP/out/"