diff options
| author | Aaron Tomlin <atomlin@atomlin.com> | 2026-09-25 14:12:30 -0400 |
|---|---|---|
| committer | Nathan Chancellor <nathan@kernel.org> | 2026-10-11 01:14:08 +0100 |
| commit | 46d4ccf3b621368af5e98187e9e21dccd8beb5cc (patch) | |
| tree | 6e022138387536386eba04f998168950814c3b69 /scripts | |
| parent | 3bf2237f59af842e546fa4b2c146198db95d1519 (diff) | |
| download | linux-46d4ccf3b621368af5e98187e9e21dccd8beb5cc.tar.gz linux-46d4ccf3b621368af5e98187e9e21dccd8beb5cc.zip | |
localmodconfig: Explicitly report boolean configs during integrity check
When running make localmodconfig, streamline_config.pl reads loaded
modules and maps each module object to its corresponding Kconfig
symbol(s) using repository Makefiles.
In several instances, a loaded module corresponds to an object
controlled by a boolean symbol (e.g. config FOO declared as bool), or is
a composite module that depends on a boolean configuration. Because
boolean options only accept "=y" or disabled, they cannot be configured
as loadable modules ("=m").
Previously, if such a symbol was not already built-in ("=y") in the
baseline configuration, the final integrity check emitted an ambiguous
diagnostic. For example
foo did not have configs CONFIG_FOO
Further investigation is required by developers to determine whether the
module was out-of-tree, its dependencies were unmet, or it failed due to
a type constraint. Address this by:
1. Tracking symbol types in a %types hash during Kconfig parsing.
2. Enhancing the final integrity check when running localmodconfig
(!$localyesconfig) to explicitly annotate boolean symbols.
For example:
module cec did not have configs CONFIG_CEC_CORE (tristate) CONFIG_RAS_CEC (boolean, not supported with =m)
Signed-off-by: Aaron Tomlin <atomlin@atomlin.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Link: https://patch.msgid.link/20260925181230.130525-1-atomlin@atomlin.com
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/kconfig/streamline_config.pl | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index 8677d1ca06a7..6a52a98eb40e 100755 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -145,6 +145,7 @@ my %prompts; my %objects; my %config2kfile; my %defaults; +my %types; my $var; my $iflevel = 0; my @ifdeps; @@ -224,6 +225,7 @@ sub read_kconfig { } elsif ($state ne "NONE" && /^\s*def(_(bool|tristate)|ault)\s+(\S.*)$/) { my $dep = $3; $defaults{$config} = 1; + $types{$config} = $2 if (defined($2)); if ($dep !~ /^\s*(y|m|n)\s*$/) { $dep =~ s/.*\sif\s+//; $depends{$config} .= " " . $dep; @@ -240,7 +242,13 @@ sub read_kconfig { } # configs without prompts must be selected - } elsif ($state ne "NONE" && /^\s*(tristate\s+\S|prompt\b)/) { + } elsif ($state ne "NONE" && /^\s*(bool|boolean)(\s+\S.*)?$/) { + $types{$config} = "bool"; + $prompts{$config} = 1 if (defined($2)); + } elsif ($state ne "NONE" && /^\s*tristate(\s+\S.*)?$/) { + $types{$config} = "tristate"; + $prompts{$config} = 1 if (defined($1)); + } elsif ($state ne "NONE" && /^\s*prompt\b/) { # note if the config has a prompt $prompts{$config} = 1; @@ -707,7 +715,15 @@ foreach my $module (keys(%modules)) { } print STDERR "module $module did not have configs"; foreach my $conf (@arr) { - print STDERR " " , $conf; + my $c = $conf; + $c =~ s/^CONFIG_//; + if (!$localyesconfig && defined($types{$c}) && $types{$c} eq "bool") { + print STDERR " $conf (boolean, not supported with =m)"; + } elsif (defined($types{$c})) { + print STDERR " $conf ($types{$c})"; + } else { + print STDERR " " , $conf; + } } print STDERR "\n"; } |
