# Hardware detection and kernel config [SOLVED]

## motaito

Hi,

I was thinking about the manjaro hardware detection tools. Basically they detect the hardware and install the necessary drivers. I wondered if gentoo has something similar to offer. What I am looking for is some tool that detects the hardware and then pre-configures the .config for your kernel with a minimal configuration. So that if you want to install a new kernel you can just run the tool and then make some adjustment specific to your needs if necessary. From what I gather genkernel has only a default setting that should work for most cases but I am looking for something that is specifically detecting your hardware. Does anything like this exist or is something like this planned for the future?Last edited by motaito on Mon Aug 18, 2014 8:15 pm; edited 1 time in total

----------

## krinn

Build your kernel with allmodconfig and then turn to yes the ones you get from lspci -k output.

----------

## motaito

Thanks for the info.

I have always been following tutorials and the only thing they mentioned was make menuconfig. It never occurred to me that make has more options to offer... I will try it out.

----------

## motaito

Ok, I tried your suggestion. This just enables everything. I am looking for the opposite. I would like to enable nothing but what's necessary to cover all installed hardware. That get's me back to square one. Use lspci -k as you pointed out and enable the hardware by hand.

Whenever you follow a wiki entry about e.g. install nvidia drivers. There are some kernel options that need to be selected. Ideally there would be a tool that let's you choose what you want to do and then configures the kernel. e.g.

- select xorg

- select nvidia

- select kde

Then pre-configure the kernel for those settings with minimal (but complete) hardware support. Does something like this exist or do I have to manually configure the kernel?

----------

## NeddySeagoon

motaito,

To my knowledge, no such tool exists.

----------

## creaker

There are some on-line services for such goals, one of them:

http://kernel-seeds.org/working.html

----------

## motaito

Thanks for the input. I guess maintaining such a tool would be a pain in the butt especially if you consider all kernel versions. I was familiar with kernel-seeds.org but that wasn't quite what I was looking for.

I have a follow up question though. How does it impact a gentoo system if you just enable everything (allmodconfig or allyesconfig)? Is the kernel getting much bigger or are there possible conflicts to look out for?

----------

## NeddySeagoon

motaito,

The kernel gets bigger and their are conflicts..

Some hardware demands that some options are off and others are on.

----------

## creaker

 *motaito wrote:*   

> How does it impact a gentoo system if you just enable everything (allmodconfig or allyesconfig)? Is the kernel getting much bigger or are there possible conflicts to look out for?

 

Why wouldn't to use localmodconfig? Yes, it's not a best solution, but it creates the kernel of a reasonable size. And it may be used as a good starting point to deal with kernel further.

----------

## motaito

@NeddySeagoon 

Thanks, though it's not quite the news I was hopping for. Last time it took me about 4 hours to find every info to configure the kernel. And then you are left wondering if you missed something. Also, every time I install a package/driver I need to go back and re-configure the kernel again if the package requires some settings. So, trying out a new kernel is not as straight forward as I was hopping. I guess I just have to bite the bullet and go through the config by hand.

----------

## motaito

@creaker

I was just writing a post and missed your reply... Yes, that's probably what I will end up doing. I was hoping there would be a way to automate the process of configuring to a point that doesn't require manual interaction. Thanks for the tip.

----------

## NeddySeagoon

motaito,

The kernel seeds method works well for many users.

Its not normally the hardware options that are the difficult ones to get right.  Its all the others.

----------

## motaito

@NeddySeagoon

I didn't mean to imply the kernel seeds options aren't any good. Actually, I think it's awesome that someone went through all the trouble of explaining it and helping others. Right now my system works nice. Stable and fluid. I was just hoping to spend less time maintaining the system. It's my only issue with gentoo. It needs a lot of love to maintain the system. I would rather spend that time using it and try out some new things. Looks like there is no way to quickly test a new kernel or gentoo-source vs vanilla. All changes require quite some work. That's also why I haven't yet tried KF5. No time to read though everything and figuring out all angles. So I am still using KDE4. I don't mind the time for compiling but setting everything up is hard for me. I have to read a lot and that's unfortunately not my strength. Hopefully that will fade out if I get more familiar with gentoo.

----------

## NeddySeagoon

motaito,

You can migrate your working kernel configuration from kernel to kernel.

Even between kernels with different versions an patch sets.  There is no need to start over every time.

Copy your working .config file to the new kernel.

In the new kernel. run make oldconfig

This will silently drop things that no longer exist and ask you about new items.

The larger the differences between the old and new kernels, the more questions you get.

This method does rely on having a working .config to start with, but its very rare to set a a kernel from scratch.

----------

## motaito

@NeddySeagoon

I did that when the kernel updated from 3.12 to 3.14. I found it quite awkward. Mostly it asked for new features and I had no clue what they were. And the questions didn't seam to end. That's why I wanted to find a tool that gives me a minimal setup to start with. If I have a basic running kernel I can enable things when I run into a situation in which I need them. I guess I might end up doing something like that and simply say no to all new features. Then go into menuconfig and work through it by hand. It seams easier to get the point in a menu when you at least see where (in what hierarchy) the features belong. Maybe I am too worried to break the hardware with a badly configured kernel and I should just fiddle around a bit to get more comfortable with it?

I will play a bit with localmodconfig and other options of make and then compare it with my existing .config. Or use genkernel as a starting point then adjust the .config and compile the kernel. In the end I would like to find a method that also works in a fresh install when I might not have a .config ready.

Thanks for all the tips and the help!

----------

## NeddySeagoon

motaito,

In oldconfig, use ? to read the help.

Also the case of the option letters shows the default setting. e.g. (N/y/?)  so No is the default.

If yo are progressing to a newer kernel, N is normally safe but there have been a few rare instances where an existing feature has been restructured and it was very easy to get oldconfig wrong.

The last one that bit me was the network card menu being restructured.  I turned all the network cards off at the new vendor level menus.

At least it still booted.

Everyone builds a sub optimal kernel sometime.

----------

## depontius

 *NeddySeagoon wrote:*   

> Everyone builds a sub optimal kernel sometime.

 

Isn't that a polite way of saying, "#$%^& machine won't boot!"

----------

## NeddySeagoon

depontius,

:)  Its like there are no failed Gentoo installs, only varying degrees of success.

----------

## motaito

@NeddySeagoon

It sure helps to know the notations. I will try it out next time. Thanks for the additional input.

----------

