config-prepare: Initialize an empty KERNEL_DRIVERS_SKIP array unless it exists

If the array exists in this location, initializing an empty array
will destroy all the data that was stored in it.
Do not initialize an empty KERNEL_DRIVERS_SKIP array if it exists.

This allows us to create an array anywhere in the script,
including the user configuration, in a secure way.
This commit is contained in:
The-going
2025-06-03 16:52:08 +03:00
committed by Igor
parent c2d1479fa6
commit 699816ddf2

View File

@@ -166,7 +166,11 @@ function config_early_init() {
display_alert "Starting single build process" "${BOARD:-"no BOARD set"}" "info" display_alert "Starting single build process" "${BOARD:-"no BOARD set"}" "info"
declare -g -a KERNEL_DRIVERS_SKIP=() # Prepare array to be filled in by board/family/extensions # Do not initialize an empty array if it exists.
if [ "${KERNEL_DRIVERS_SKIP[*]}" == "" ]; then
# Prepare array to be filled in by board/family/extensions
declare -g -a KERNEL_DRIVERS_SKIP=()
fi
silent="yes" track_general_config_variables "after config_early_init" # don't log anything, just init the change tracking silent="yes" track_general_config_variables "after config_early_init" # don't log anything, just init the change tracking