# universal kernel .config?

## agrypa1

Hi,

I would like to know what options should be builtin, modularized or none at all when I am building a kernel? My pracatice so far was that I would start with:

make allmodconfig

and then in menuconfig I would look for those settings that I necessary for the kernel to boot, like root/boot partition driver, vesafb frame buffer driver, AT keybord, usb mouse, file system of the root/boot partition driver. I know that there are many settings that are unnecessary for a particular CPU and yet they will be built in when kernel config is started with "allmodconfig". And much more, like verbose debugging for many modules. How to turn those off in some automatic way?

In essence, a universal kernel config is what I look for. But not only that. I wonder what happens if I exchange devices frequently in my machine. Can I do without a kernel rebuild?

I thought that genkernel way of buiding my kernel will do the job. My first attempt was an unbootable kernel, then a kernel without keyboard support. Finally I noticed that genkernel has to have essential parts of the system builtin to be able boot. Could anyone, please, explain how liveCD handles that issue? LiveCD will boot from any machine with any configuration, won't it? Why can't I do the same?

and one more thing, has anyone tried yet "make allyesconfig", does it boot and how fast?

thanks for even partial answers to the above.

Agryppa

----------

## desultory

 *agrypa1 wrote:*   

> In essence, a universal kernel config is what I look for. But not only that. I wonder what happens if I exchange devices frequently in my machine. Can I do without a kernel rebuild?

 You should be able to.

 *agrypa1 wrote:*   

> Could anyone, please, explain how liveCD handles that issue?

 By way of hwsetup (sys-apps/hwsetup), last I checked.

 *agrypa1 wrote:*   

> LiveCD will boot from any machine with any configuration, won't it?

 Within limits, though it does cover a rather broad range of hardware.

 *agrypa1 wrote:*   

> Why can't I do the same?

 Insufficient shameless thievery. Consider that all of the configuration data and all of the software from the live CD is available for use. Use what is useful.Last edited by desultory on Sat Dec 23, 2006 8:36 am; edited 1 time in total

----------

## RoundsToZero

You kind of answered your own question when you said allmodconfig has some stuff that's unnecessary for a particular system, then said you wanted to be able to move the kernel between systems.  I imagine the way the Live CD kernel works is that everything is compiled as a module.  Everything.  So then it only takes a lot of time to compile, it doesn't contribute to the size of the running kernel.  Modules that are not needed (not supported by the system) will never be loaded.  You are right of course that some things will need to be built in in order to boot, like filesystem drivers.

So if you want a universal kernel, for potentially any hardware, you have to have all supported options enabled, at least as modules.  I think this is how Red Hat kernels are.  You can't have it both ways (i.e., you can't just indiscriminately turn off modules, automatic or otherwise, without losing some of that portability).

So which do you want?  Faster compile times by disabling everything that's unneeded for the current system, or longer compile times because of enabling everything, so that the kernel is portable?

----------

## salahx

"allyesconfig" is really isn't aimed at end-users or even distributions, its purpose to verify everything the says it can be built as a modules actually DOES build. Same for "allyesconfig" and "allnoconfig", (and, to a lesser extent, "defconfig")

I borrowed by .config from Fedora CVS. Genkernel comes with a pre-made .config file as well. 

However, the kernel developers do move these options around, and keeping up is hard (especially for the recent 2.6.18->2.6.19 update, where all the SATA drivers were moved).

----------

## AaronPPC

It sounds to me like you are looking for:

```
# make defconfig
```

----------

## Gentree

 *Quote:*   

> I wonder what happens if I exchange devices frequently in my machine. Can I do without a kernel rebuild?

 

depends what you want to change .  If you want to handle _any_ change you will need all available modules. If you have a couple of gfx cards or sound cards you frequently want to swap around just compile support for both.

once you have the necessary modules , no rebuild is needed , just reboot and the kernel will pull in what it needs from what is available.

eg I recently moved from KX7-333 to AN7 motherboard, so I did a bit of googling to find out stuff like chipset that was likely to be different, added a couple of new modules to the kernel , swapped motherboards and rebooted.

The only reboot I needed was to swap the hardware , not like the windows' five times round the block rebooting lark.

Many kernels , esp. on liveCDs are build with config.gz support. This means that the running system can be interrogated as to the .config that built it.

```
zcat /proc/config.gz
```

you may find that useful.

 :Cool: 

----------

