From a661744d1dc8b35369bfe0ef305b969e623ab681 Mon Sep 17 00:00:00 2001 From: Igor Velkov <325961+iav@users.noreply.github.com> Date: Thu, 22 Jan 2026 22:51:47 +0200 Subject: [PATCH] kernel: add custom_kernel_make_params extension hook Add a new extension hook point in run_kernel_make_internal() that allows extensions to modify kernel make parameters before compilation. Extensions can now modify: - common_make_params_quoted - parameters passed to make - common_make_envs - environment variables for make This enables features like CROSS_COMPILE_COMPAT for 32-bit compat vDSO on arm64 builds without modifying core build scripts. Refs: https://github.com/armbian/build/issues/9216 Co-Authored-By: Claude Opus 4.5 --- lib/functions/compilation/kernel-make.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/functions/compilation/kernel-make.sh b/lib/functions/compilation/kernel-make.sh index 5b7a230aec..6063d58a67 100644 --- a/lib/functions/compilation/kernel-make.sh +++ b/lib/functions/compilation/kernel-make.sh @@ -74,6 +74,15 @@ function run_kernel_make_internal() { common_make_params_quoted+=("${llvm_flag}") fi + # Allow extensions to modify make parameters and environment variables + call_extension_method "custom_kernel_make_params" <<- 'CUSTOM_KERNEL_MAKE_PARAMS' + *Customize kernel make parameters before compilation* + Called after all standard make parameters are set but before invoking make. + Extensions can modify the following arrays: + - `common_make_params_quoted` - parameters passed to make (e.g., CROSS_COMPILE_COMPAT) + - `common_make_envs` - environment variables for make + CUSTOM_KERNEL_MAKE_PARAMS + # last statement, so it passes the result to calling function. "env -i" is used for empty env full_command=("${KERNEL_MAKE_RUNNER:-run_host_command_logged}" "env" "-i" "${common_make_envs[@]}" make "${common_make_params_quoted[@]@Q}" "$@")