diff mbox series

[7/7] linux-kbuild: fix: process config options set to "y"

Message ID 20240913171205.22126-8-david.hunter.linux@gmail.com (mailing list archive)
State New
Headers show
Series [1/7] linux-kbuild: fix: config option can be bool | expand

Commit Message

David Hunter Sept. 13, 2024, 5:12 p.m. UTC
The goal of "make localmodconfig" is to turn off modules that are not
necessary. Some modules are necessary because they are depended on by
config options set with a "y."

Process configs set to "y" so that the modules that are depended on
will not be turned off later.

Signed-off-by: David Hunter <david.hunter.linux@gmail.com>
---
 scripts/kconfig/streamline_config.pl | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index 948437aac535..762bf80408c7 100755
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -466,6 +466,11 @@  foreach my $line (@config_file) {
 
     if (/(CONFIG_[$valid]*)=(m|y)/) {
 	$orig_configs{$1} = $2;
+	# all configs options set to 'y' need to be processed
+	if($2 eq "y") {
+            $configs{$1}= $2;
+        }
+
     }
 }
 
@@ -596,9 +601,11 @@  sub loop_depend {
       forloop:
 	foreach my $config (keys %configs) {
 
-	    # If this config is not a module, we do not need to process it
-	    if (defined($orig_configs{$config}) && $orig_configs{$config} ne "m") {
-		next forloop;
+           # If this config is not set in the original config,
+	    # we do not need to process it
+           if (defined($orig_configs{$config}) && $orig_configs{$config} ne "m"
+		    	&& $orig_configs{$config} ne "y")  {
+		    next forloop;
 	    }
 
 	    $config =~ s/^CONFIG_//;