mbox series

[v3,0/7] streamline_config.pl: fix: process configs set to "y"

Message ID 20241014141345.5680-1-david.hunter.linux@gmail.com (mailing list archive)
Headers show
Series streamline_config.pl: fix: process configs set to "y" | expand

Message

David Hunter Oct. 14, 2024, 2:13 p.m. UTC
An assumption made in this script is that the config options do not need
to be processed because they will simply be in the new config file. This
assumption is incorrect.

Process the config entries set to "y" because those config entries might
have dependencies set to "m". If a config entry is set to "m" and is not
loaded directly into the machine, the script will currently turn off
that config entry; however, if that turned off config entry is a
dependency for a "y" option. that means the config entry set to "y"
will also be turned off later when the conf executive file is called.

Here is a model of the problem (arrows show dependency):

Original config file
Config_1 (m) <-- Config_2 (y)

Config_1 is not loaded in this example, so it is turned off.
After scripts/kconfig/streamline_config.pl, but before scripts/kconfig/conf
Config_1 (n) <-- Config_2 (y)

After  scripts/kconfig/conf
Config_1 (n) <-- Config_2 (n)


It should also be noted that any module in the dependency chain will
also be turned off, even if that module is loaded directly onto the
computer. Here is an example:

Original config file
Config_1 (m) <-- Config_2 (y) <-- Config_3 (m)

Config_3 will be loaded in this example.
After scripts/kconfig/streamline_config.pl, but before scripts/kconfig/conf
Config_1 (n) <-- Config_2 (y) <-- Config_3 (m)

After scripts/kconfig/conf
Config_1 (n) <-- Config_2 (n) <-- Config_3 (n)


I discovered this problem when I ran "make localmodconfig" on a generic
Ubuntu config file. Many hardware devices were not recognized once the
kernel was installed and booted. Another way to reproduced the error I
had is to run "make localmodconfig" twice. The standard error might display
warnings that certain modules should be selected but no config files are
turned on that select that module.

With the changes in this series patch, all modules are loaded properly
and all of the hardware is loaded when the kernel is installed and
booted.


David Hunter (7):
  streamline_config.pl: fix missing variable operator in debug print
  streamline_config.pl: ensure all defaults are tracked
  streamline_config.pl: remove prompt warnings for configs with defaults
  streamline_config.pl: include tool to learn about a config option
  streamline_config.pl: fix: implement choice for kconfigs
  streamline_config.pl: process config options set to "y"
  streamline_config.pl: check prompt for bool

---
V1: https://lore.kernel.org/all/20240913171205.22126-1-david.hunter.linux@gmail.com/

V2: https://lore.kernel.org/all/20240916142939.754911-1-david.hunter.linux@gmail.com/
        - Put in subject.

V3: 
	- changed the order of patches 
	- removed a patch that was unneccessary
	- added a patch for a debugging tool  
---

 scripts/kconfig/streamline_config.pl | 130 ++++++++++++++++++++++++---
 1 file changed, 119 insertions(+), 11 deletions(-)

Comments

Steven Rostedt Oct. 17, 2024, 10:37 p.m. UTC | #1
On Mon, 14 Oct 2024 10:13:30 -0400
David Hunter <david.hunter.linux@gmail.com> wrote:

> An assumption made in this script is that the config options do not need
> to be processed because they will simply be in the new config file. This
> assumption is incorrect.
> 
> Process the config entries set to "y" because those config entries might
> have dependencies set to "m". If a config entry is set to "m" and is not
> loaded directly into the machine, the script will currently turn off
> that config entry; however, if that turned off config entry is a
> dependency for a "y" option. that means the config entry set to "y"
> will also be turned off later when the conf executive file is called.
> 
> Here is a model of the problem (arrows show dependency):
> 
> Original config file
> Config_1 (m) <-- Config_2 (y)
> 
> Config_1 is not loaded in this example, so it is turned off.
> After scripts/kconfig/streamline_config.pl, but before scripts/kconfig/conf
> Config_1 (n) <-- Config_2 (y)
> 
> After  scripts/kconfig/conf
> Config_1 (n) <-- Config_2 (n)
> 
> 
> It should also be noted that any module in the dependency chain will
> also be turned off, even if that module is loaded directly onto the
> computer. Here is an example:
> 
> Original config file
> Config_1 (m) <-- Config_2 (y) <-- Config_3 (m)
> 
> Config_3 will be loaded in this example.
> After scripts/kconfig/streamline_config.pl, but before scripts/kconfig/conf
> Config_1 (n) <-- Config_2 (y) <-- Config_3 (m)
> 
> After scripts/kconfig/conf
> Config_1 (n) <-- Config_2 (n) <-- Config_3 (n)
> 
> 
> I discovered this problem when I ran "make localmodconfig" on a generic
> Ubuntu config file. Many hardware devices were not recognized once the
> kernel was installed and booted. Another way to reproduced the error I
> had is to run "make localmodconfig" twice. The standard error might display
> warnings that certain modules should be selected but no config files are
> turned on that select that module.
> 
> With the changes in this series patch, all modules are loaded properly
> and all of the hardware is loaded when the kernel is installed and
> booted.
> 

So I tried this out and compared it to what it use to do, and it was quite
a big difference! Attached is the diffconfig.

I copied over my special config, ran localmodconfig, saved it, added your
patches, copied over the same config, and then did the diffconfig between
the two results.

There's a lot I know I don't use that was added!

For example:

 BCACHEFS_FS n -> m

Why is that needed?

I can give you the starting config as well as my lsmod. But right now, it's
adding too much that is not needed.

-- Steve
Steven Rostedt Oct. 18, 2024, 2:30 p.m. UTC | #2
On Thu, 17 Oct 2024 18:37:11 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> I can give you the starting config as well as my lsmod. But right now, it's
> adding too much that is not needed.

Attached is the config I started with and the lsmod used. You could copy
the config to .config and then run:

  make LSMOD=lsmod localmodconfig

to test with.

-- Steve