diff --git a/lib/functions/artifacts/artifact-kernel.sh b/lib/functions/artifacts/artifact-kernel.sh index aa922552e5..e691e573e6 100644 --- a/lib/functions/artifacts/artifact-kernel.sh +++ b/lib/functions/artifacts/artifact-kernel.sh @@ -25,7 +25,7 @@ function artifact_kernel_prepare_version() { # - Get the drivers patch hash (given LINUXFAMILY and the vX.Z.Y version) - the harness can do this by hashing patches and bash code # - Get the kernel patches hash. (@TODO currently hashing files directly, use Python patching proper) # - Get the kernel .config hash, composed of - # - KERNELCONFIG .config hash (contents) + # - KERNELCONFIG .config hash (contents); except if KERNEL_CONFIGURE=yes, then force "999999" (six-nines) # - extensions mechanism, each hook has an array of hashes that is then hashed together; see the hooks docs. # - Hash of the relevant lib/ bash sources involved, say compilation/kernel*.sh etc # All those produce a version string like: @@ -57,6 +57,7 @@ function artifact_kernel_prepare_version() { debug_var LINUXFAMILY debug_var KERNELPATCHDIR debug_var KERNEL_SKIP_MAKEFILE_VERSION + debug_var KERNEL_CONFIGURE declare short_hash_size=4 @@ -93,6 +94,13 @@ function artifact_kernel_prepare_version() { config_hash="${hash_files}" declare config_hash_short="${config_hash:0:${short_hash_size}}" + # detour: if KERNEL_CONFIGURE=yes, then force "999999" (six-nines) + if [[ "${KERNEL_CONFIGURE}" == "yes" ]]; then + display_alert "Forcing kernel config hash to 999999" "due to KERNEL_CONFIGURE=yes" "info" + config_hash="999999 (KERNEL_CONFIGURE=yes, unable to hash)" + config_hash_short="999999" + fi + # run the extensions. they _must_ behave, and not try to modify the .config, instead just fill kernel_config_modifying_hashes declare kernel_config_modifying_hashes_hash="undetermined" declare -a kernel_config_modifying_hashes=() diff --git a/lib/functions/artifacts/artifacts-obtain.sh b/lib/functions/artifacts/artifacts-obtain.sh index e4035f8c88..8d10044afd 100644 --- a/lib/functions/artifacts/artifacts-obtain.sh +++ b/lib/functions/artifacts/artifacts-obtain.sh @@ -218,7 +218,16 @@ function obtain_complete_artifact() { # This is meant to be run after config, inside default build. function build_artifact_for_image() { initialize_artifact "${WHAT}" - obtain_complete_artifact + + # Detour: if building kernel, and KERNEL_CONFIGURE=yes, ignore artifact cache. + if [[ "${WHAT}" == "kernel" && "${KERNEL_CONFIGURE}" == "yes" ]]; then + display_alert "Ignoring artifact cache for kernel" "KERNEL_CONFIGURE=yes" "info" + ARTIFACT_IGNORE_CACHE="yes" obtain_complete_artifact + else + obtain_complete_artifact + fi + + return 0 } function pack_artifact_to_local_cache() { diff --git a/lib/functions/main/config-prepare.sh b/lib/functions/main/config-prepare.sh index b89462d44d..ea668fb175 100644 --- a/lib/functions/main/config-prepare.sh +++ b/lib/functions/main/config-prepare.sh @@ -167,10 +167,6 @@ function config_pre_main() { SELECTED_CONFIGURATION="cli_minimal" fi - # @TODO: remove this? - [[ ${KERNEL_CONFIGURE} == prebuilt ]] && [[ -z ${REPOSITORY_INSTALL} ]] && - REPOSITORY_INSTALL="u-boot,kernel,bsp,armbian-zsh,armbian-config,armbian-bsp-cli,armbian-firmware${BUILD_DESKTOP:+,armbian-desktop,armbian-bsp-desktop}" - return 0 # shortcircuit above }