From bffcfc4f6641f2dd111d7a0f22949af8e68bf217 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Tue, 30 May 2023 11:31:51 +0200 Subject: [PATCH] `uboot`: introduce hook `post_config_uboot_target` - runs after other configuration changes, but before actually compiling a target - useful to hack into `.config` for a specific target --- lib/functions/artifacts/artifact-uboot.sh | 1 + lib/functions/compilation/uboot.sh | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/lib/functions/artifacts/artifact-uboot.sh b/lib/functions/artifacts/artifact-uboot.sh index c1568358fe..0382e9a858 100644 --- a/lib/functions/artifacts/artifact-uboot.sh +++ b/lib/functions/artifacts/artifact-uboot.sh @@ -63,6 +63,7 @@ function artifact_uboot_prepare_version() { declare -a extension_hooks_to_hash=( "post_uboot_custom_postprocess" "fetch_custom_uboot" "build_custom_uboot" "pre_config_uboot_target" "post_uboot_custom_postprocess" "post_uboot_custom_postprocess" + "post_config_uboot_target" ) declare -a extension_hooks_hashed=("$(dump_extension_method_sources_functions "${extension_hooks_to_hash[@]}")") declare hash_hooks="undetermined" diff --git a/lib/functions/compilation/uboot.sh b/lib/functions/compilation/uboot.sh index 0fbb0336e0..0e0cccd5a4 100644 --- a/lib/functions/compilation/uboot.sh +++ b/lib/functions/compilation/uboot.sh @@ -147,6 +147,13 @@ function compile_uboot_target() { fi + # Hook time, for extra post-processing + call_extension_method "post_config_uboot_target" <<- 'POST_CONFIG_UBOOT_TARGET' + *allow extensions prepare after configuring but before compiling an u-boot target* + Some u-boot targets require extra configuration or pre-processing before compiling. + Last chance to change .config for u-boot before compiling. + POST_CONFIG_UBOOT_TARGET + if [[ "${UBOOT_CONFIGURE:-"no"}" == "yes" ]]; then display_alert "Configuring u-boot" "UBOOT_CONFIGURE=yes; experimental" "warn" run_host_command_dialog make menuconfig