# What does localyesconfig do exactly? It sounds too good.

## C1REX

What does localyesconfig do exactly? It sounds too good to be true.

Does it automatically detect all hardware and set everything as built in in menuconfig while removing everything not detected?

It just sounds freaking amazing if I want to built just the bare minimum kernel for max performance/boot time. I spent so much time manually removing everything by hand and trying if system is still booting.

Can anybody confirm? Why this is not a default recommended option for kernel config?

----------

## Ant P.

It compiles in all the currently loaded modules by changing them from M to Y. If something hasn't loaded them yet they aren't included. Nothing else is removed.

----------

## C1REX

What if I remove the config and start from a clear one? Will it detect my hardware and add the bare minimum and make it a working kernel?

----------

## Ant P.

That depends on if the sum of defconfig + loaded modules would result in a bootable kernel.

The kernel config scripts do not detect hardware. That's udev's job.

----------

## Goverp

Last time I built a config from scratch, I started with a recent bootable linux disk, possibly the Gentoo Minimal Install, booted it, and used "make localmodconfig" to get all and only the modules I need.  Before the boot, I plugged as many USB and other things of that ilk in, so their modules would be needed.  Then I spent some time tweaking the bits with "make nconfig", making some modules built-in, and other stuff.

localmodconfig and localyesconfig are pretty good, they save an awful lot of faffing about with ethernet and multimedia drivers, for example, but not perfect. (a) You need a working config to start with, of course, and (b) they only configure the modules in use at the time you make, so if you have optional hardware that wasn't plugged in, it won't be there, and (c) if you have something exciting like a big video card, you may end up with some level of framebuffer driver that at least works, but not necessarily the custom drivers, depending on what your running system had chosen.

----------

## C1REX

Goverp - thank you for your answer. This is what I hoped to hear.

----------

## krinn

 *C1REX wrote:*   

> What if I remove the config and start from a clear one? Will it detect my hardware and add the bare minimum and make it a working kernel?

 

it doesn't detect any hardware, only detect what is build as module and what is loaded

as example:

configs: Echo the kernel .config file used to build the kernel ; it's the module to enable /proc/config.gz

if your kernel is build with this as module and you load that module it will be set to Y

and i took this example because it has nothing to do with hardware, it's just the module to have /proc/config.gz or not

----------

