localmodconfig: Fix missing depends of config files included in if statements
Subsystems (3)
Linus,
[
Sorry for the previous confusion. My scripts to make my patch sets key off of the tag name. Thus by using the ktest tag, my scripts put in the linux-ktest.git tree.
]
A bug was recently found in the make localmodconfig where it would miss dependencies of config files are include in other config files inside an if statement.
Also added a debug print that helped in solving this bug.
Please pull the latest localmodconfig-v3.10 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-kconfig.git
localmodconfig-v3.10
Head SHA1: 0d0f18b32c5382431163391f224195dea251cae8
Steven Rostedt (2):
localmodconfig: Add debug prints for dependencies of module configs
localmodconfig: Process source kconfig files as they are found
----
scripts/kconfig/streamline_config.pl | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
PATCH 1/2 localmodconfig: Add debug prints for dependencies of module configs
From: Steven Rostedt <[email protected]>
When a config for a module is added to the list to save in the final config file, add a print to show what dependencies are used. This is useful to debug when a config is disabled by the make oldconfig after localmodconfig is finished.
This print only appears if the environment variable LOCALMODCONFIG_DEBUG is defined.
--- scripts/kconfig/streamline_config.pl | 9 +++++++++ 1 file changed, 9 insertions(+)
scripts/kconfig/streamline_config.pl +9 -0
@@ -396,6 +396,15 @@ foreach my $module (keys(%modules)) { foreach my $conf (@arr) { $configs{$conf} = $module; dprint "$conf added by direct ($module)\n"; + if ($debugprint) { + my $c=$conf; + $c =~ s/^CONFIG_//; + if (defined($depends{$c})) { + dprint " deps = $depends{$c}\n"; + } else { + dprint " no deps\n"; + } + } } } else { # Most likely, someone has a custom (binary?) module loaded.
Signature · 1 line
1.7.10.4
PATCH 2/2 localmodconfig: Process source kconfig files as they are found
In reply to Steven RostedtFrom: Steven Rostedt <[email protected]>
A bug was reported that caused localmodconfig to not keep all the dependencies of ATH9K. This was caused by the kconfig file:
In drivers/net/wireless/ath/Kconfig:
---
if ATH_CARDS
config ATH_DEBUG
bool "Atheros wireless debugging"
---help---
Say Y, if you want to debug atheros wireless drivers. Right now only ath9k makes use of this.
source "drivers/net/wireless/ath/ath5k/Kconfig" source "drivers/net/wireless/ath/ath9k/Kconfig" source "drivers/net/wireless/ath/carl9170/Kconfig" source "drivers/net/wireless/ath/ath6kl/Kconfig" source "drivers/net/wireless/ath/ar5523/Kconfig" source "drivers/net/wireless/ath/wil6210/Kconfig"
endif
---
The current way kconfig works, it processes new source files after the first file is completed. It creates an array of new source config files and when the one file is finished, it continues with the next file.
Unfortunately, this means that it loses the fact that the source file is within an "if" statement, and this means that each of these source file's configs will not have the proper dependencies set.
As ATH9K requires ATH_CARDS set, the localmodconfig did not see that dependency, and did not enable ATH_CARDS. When the oldconfig was run, it forced ATH9K to be disabled.
--- scripts/kconfig/streamline_config.pl | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
scripts/kconfig/streamline_config.pl +7 -10
@@ -156,7 +156,6 @@ sub read_kconfig { my $state = "NONE"; my $config; - my @kconfigs; my $cont = 0; my $line;
@@ -190,7 +189,13 @@ sub read_kconfig { # collect any Kconfig sources if (/^source\s*"(.*)"/) { - $kconfigs[$#kconfigs+1] = $1; + my $kconfig = $1; + # prevent reading twice. + if (!defined($read_kconfigs{$kconfig})) { + $read_kconfigs{$kconfig} = 1; + read_kconfig($kconfig); + } + next; } # configs found
@@ -250,14 +255,6 @@ sub read_kconfig { } } close($kinfile); - - # read in any configs that were found. - foreach my $kconfig (@kconfigs) { - if (!defined($read_kconfigs{$kconfig})) { - $read_kconfigs{$kconfig} = 1; - read_kconfig($kconfig); - } - } } if ($kconfig) {
Signature · 1 line
1.7.10.4