summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2020-11-06 07:05:21 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2020-11-06 07:05:24 +0100
commitdae6b6b81075aa294c9150473c7f9fb6252d9807 (patch)
treeb97bcddc437afe7586abcfeb2184631c88fabe49
parenteb02a7aef7602aaef1e882671f7fd94f4fb6e11c (diff)
downloadptxdist-dae6b6b81075aa294c9150473c7f9fb6252d9807.tar.gz
ptxdist-dae6b6b81075aa294c9150473c7f9fb6252d9807.tar.xz
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 <m.olbrich@pengutronix.de>
-rw-r--r--scripts/lib/ptxd_lib_kconfig.sh34
1 files 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}"
;;
*)