From dae6b6b81075aa294c9150473c7f9fb6252d9807 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Fri, 6 Nov 2020 07:05:21 +0100 Subject: ptxd_kconfig: handle BSP local toplevel Kconfig file correctly with layers The toplevel Kconfig file for the ptxconfig and platformconfig is found once at the beginning of ptxd_kconfig(). This can break oldconfig: When iterating over layers, the Kconfig file found for the top layer is always used. This is incorrect. Different layers may have a different Kconfig file. So update PTXDIST_PATH_LAYERS and look for the correct Kconfig file in ptxd_kconfig_update() for each layer separately. Signed-off-by: Michael Olbrich --- scripts/lib/ptxd_lib_kconfig.sh | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/scripts/lib/ptxd_lib_kconfig.sh b/scripts/lib/ptxd_lib_kconfig.sh index ca56a65a1..2c51f0e2a 100644 --- a/scripts/lib/ptxd_lib_kconfig.sh +++ b/scripts/lib/ptxd_lib_kconfig.sh @@ -539,7 +539,7 @@ export -f ptxd_kconfig_sync_config ptxd_kconfig_update() { - local mode + local mode file_kconfig if [ "${PTXDIST_LAYERS[0]}" = "${PTXDIST_TOPDIR}" ]; then # nothing to do for PTXdist itself return @@ -548,6 +548,10 @@ ptxd_kconfig_update() { ( # call ptxd_kconfig_update() recursively after removing the last layer PTXDIST_LAYERS=( "${PTXDIST_LAYERS[@]:1}" ) + local orig_IFS="${IFS}" + IFS=: + PTXDIST_PATH_LAYERS="${PTXDIST_LAYERS[*]}:" + IFS="${orig_IFS}" PTX_KGEN_DIR="${PTX_KGEN_DIR}.base" confdir="${confdir}.base" ptxd_init_ptxdist_path && @@ -577,8 +581,15 @@ ptxd_kconfig_update() { ;; esac case "${part}" in - user|board) - mode=single + ptx) + if ! ptxd_in_path PTXDIST_PATH_LAYERS "Kconfig"; then + ptxd_in_path PTXDIST_PATH_LAYERS "config/Kconfig" + fi + file_kconfig="${ptxd_reply}" + ;; + platform) + ptxd_in_path PTXDIST_PATH_LAYERS "platforms/Kconfig" + file_kconfig="${ptxd_reply}" ;; collection) ptxd_kconfig_find_config run ${ptx_relative_file_dotconfig} || return 0 @@ -596,6 +607,16 @@ ptxd_kconfig_update() { # here. # PTXDIST_COLLECTIONCONFIG="" ptxd_colgen || ptxd_bailout "error in colgen" + file_kconfig="${PTXDIST_TOPDIR}/config/collection/Kconfig" + ;; + board) + ptxd_in_path PTXDIST_PATH_LAYERS "config/boardsetup/Kconfig" + file_kconfig="${ptxd_reply}" + mode=single + ;; + user) + file_kconfig="${PTXDIST_TOPDIR}/config/setup/Kconfig" + mode=single ;; esac @@ -677,19 +698,17 @@ ptxd_kconfig() { local config="${1}" local part="${2}" - local file_kconfig file_dotconfig + local file_dotconfig case "${part}" in ptx) if ! ptxd_in_path PTXDIST_PATH_LAYERS "Kconfig"; then ptxd_in_path PTXDIST_PATH_LAYERS "config/Kconfig" fi - file_kconfig="${ptxd_reply}" file_dotconfig="${PTXDIST_PTXCONFIG}" ;; platform) ptxd_in_path PTXDIST_PATH_LAYERS "platforms/Kconfig" - file_kconfig="${ptxd_reply}" file_dotconfig="${PTXDIST_PLATFORMCONFIG}" ;; collection) @@ -699,16 +718,13 @@ ptxd_kconfig() { file_dotconfig="${PTXDIST_PLATFORMCONFIG}" ptxd_normalize_config export platform_relative_file_dotconfig="${relative_file_dotconfig}" - file_kconfig="${PTXDIST_TOPDIR}/config/collection/Kconfig" file_dotconfig="${3}" ;; board) ptxd_in_path PTXDIST_PATH_LAYERS "config/boardsetup/Kconfig" - file_kconfig="${ptxd_reply}" file_dotconfig="${PTXDIST_BOARDSETUP}" ;; user) - file_kconfig="${PTXDIST_TOPDIR}/config/setup/Kconfig" file_dotconfig="${PTXDIST_PTXRC}" ;; *) -- cgit v1.2.3