summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbuild.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index 873334be..9d13fdc7 100755
--- a/build.sh
+++ b/build.sh
@@ -343,6 +343,13 @@
# modules.builtin.modinfo
# Image.lz4
#
+# DTS_EXT_DIR
+# Set this variable to compile an out-of-tree device tree. The value of
+# this variable is set to the kbuild variable "dtstree" which is used to
+# compile the device tree. If this is set, then it's likely the dt-bindings
+# are out-of-tree as well. So be sure to set DTC_INCLUDE in the
+# BUILD_CONFIG file to the include path containing the dt-bindings.
+#
# Note: For historic reasons, internally, OUT_DIR will be copied into
# COMMON_OUT_DIR, and OUT_DIR will be then set to
# ${COMMON_OUT_DIR}/${KERNEL_DIR}. This has been done to accommodate existing
@@ -515,6 +522,9 @@ function build_vendor_dlkm() {
local vendor_dlkm_modules_root_dir=$(echo ${VENDOR_DLKM_STAGING_DIR}/lib/modules/*)
local vendor_dlkm_modules_load=${vendor_dlkm_modules_root_dir}/modules.load
+ if [ -f ${vendor_dlkm_modules_root_dir}/modules.blocklist ]; then
+ cp ${vendor_dlkm_modules_root_dir}/modules.blocklist ${DIST_DIR}/vendor_dlkm.modules.blocklist
+ fi
# Modules loaded in vendor_boot should not be loaded in vendor_dlkm.
if [ -f ${DIST_DIR}/vendor_boot.modules.load ]; then
@@ -614,6 +624,22 @@ fi
BOOT_IMAGE_HEADER_VERSION=${BOOT_IMAGE_HEADER_VERSION:-3}
+if [ -n "${DTS_EXT_DIR}" ]; then
+ if [[ "${MAKE_GOALS}" =~ dtbs|\.dtb|\.dtbo ]]; then
+ # DTS_EXT_DIR needs to be relative to KERNEL_DIR but we allow one to set
+ # it relative to ROOT_DIR for ease of use. So figure out what was used.
+ if [ -d "${ROOT_DIR}/${DTS_EXT_DIR}" ]; then
+ # DTS_EXT_DIR is currently relative to ROOT_DIR. So recalcuate it to be
+ # relative to KERNEL_DIR
+ DTS_EXT_DIR=$(rel_path ${ROOT_DIR}/${DTS_EXT_DIR} ${KERNEL_DIR})
+ elif [ ! -d "${KERNEL_DIR}/${DTS_EXT_DIR}" ]; then
+ echo "Couldn't find the dtstree -- ${DTS_EXT_DIR}" >&2
+ exit 1
+ fi
+ MAKE_ARGS+=("dtstree=${DTS_EXT_DIR}")
+ fi
+fi
+
cd ${ROOT_DIR}
export CLANG_TRIPLE CROSS_COMPILE CROSS_COMPILE_COMPAT CROSS_COMPILE_ARM32 ARCH SUBARCH MAKE_GOALS
@@ -942,6 +968,7 @@ if [[ -z "${SKIP_EXT_MODULES}" ]] && [[ -n "${EXT_MODULES_MAKEFILE}" ]]; then
make -f "${EXT_MODULES_MAKEFILE}" KERNEL_SRC=${ROOT_DIR}/${KERNEL_DIR} \
O=${OUT_DIR} ${TOOL_ARGS} ${MODULE_STRIP_FLAG} \
+ INSTALL_HDR_PATH="${KERNEL_UAPI_HEADERS_DIR}/usr" \
INSTALL_MOD_PATH=${MODULES_STAGING_DIR} "${MAKE_ARGS[@]}"
fi
@@ -966,6 +993,7 @@ if [[ -z "${SKIP_EXT_MODULES}" ]] && [[ -n "${EXT_MODULES}" ]]; then
make -C ${EXT_MOD} M=${EXT_MOD_REL} KERNEL_SRC=${ROOT_DIR}/${KERNEL_DIR} \
O=${OUT_DIR} "${TOOL_ARGS[@]}" ${MODULE_STRIP_FLAG} \
INSTALL_MOD_PATH=${MODULES_STAGING_DIR} \
+ INSTALL_HDR_PATH="${KERNEL_UAPI_HEADERS_DIR}/usr" \
"${MAKE_ARGS[@]}" modules_install
set +x
done