# Kernel autoconfig? -- solved.

## 1clue

Hi,

I compiled my kernel last night.  I'm not really familiar with the hardware yet, as far as processor type, compiler options and that sort of thing.  So I got to wondering about something that has recurred over and over in my Linux experience.

Is there some way to programmatically scan my hardware and set kernel compile options?  I'm talking about only those features related directly to hardware:

Processor type and features.

Chipsets

Driver support

Extra driver features, such as VLAN support or bonding of network adapters.

I realize that this is a huge can of worms.  However, it would be neat if I could at least get a tool that tells me which options pertain to my existing hardware.  Obviously setting everything off except those features would be a bit scary, but if there were a way to get a diff on my hardware's requirements and the actual configuration, that would be an immense help.

For that matter, even if I could get just the well-known items it would save me an hour.

Am I totally off base?

Thanks.Last edited by 1clue on Tue May 04, 2010 6:13 pm; edited 1 time in total

----------

## NeddySeagoon

1clue,

There is a semi automatic way to help you get a lean mean kernel right first time.

Go to kernel-seeds.org and post questions in the sticky thread in Unsupported Software

----------

## platojones

You can find a lot of the devices on your system and their associated kernel module names just by doing an lspci -k.  It's very helpful in identifying your hardware components, aside from the CPU.

----------

## maxime1986

this site can help you to find which module you have to compile for some of your hardware.

(like lspci -k)

----------

## chithanh

Since kernel 2.6.32 there is the new "make localconfig" target, which will create a kernel config based on /proc/config.gz and lsmod output. This is especially useful if run chrooted from livecd (/proc and /dev and maybe /sys need to be mounted into the chroot)

----------

## 1clue

Awesome!  I'll give that a try.

----------

## pontus1970

Did you get that to work? If so, how? This is what I get...

linux-2.6.33.3 # make localconfig

  HOSTCC  scripts/basic/fixdep

  HOSTCC  scripts/basic/docproc

  HOSTCC  scripts/basic/hash

make[1]: *** No rule to make target `localconfig'.  Stop.

make: *** [localconfig] Error 2

linux-2.6.33.3 #

----------

## 1clue

Sorry I've been really busy lately, and haven't had the chance to try it again.  I'll post back no matter what, either to announce victory or ask more questions.

Thanks a bunch for your help everyone!

----------

## 1clue

BTW, when I get the sources is there a safest way to set options I don't know about?  I'm using amd64, so I'm not sure the defaults would be in my best interest.  I mean for non-hardware things like network protocols and such.

----------

## 1clue

OK, I am finally booted off my own kernel.  The delay was due to lack of time, not repeated failures, thankfully enough.

Here are my observations:

Make localconfig does not work.  I also looked in the Makefile and did not find anything that was close.

I suddenly became very suspicious of Pappy for no apparent reason, and in a fit of epic paranoia I used maxime1986's recommendation instead.

maxime1986's site gave me a very small number of drivers that I made sure were there.  I turned off almost everything else and then I went on to mess with my own extras.

I started emerge -DNuv world gnome right before bed.

I have not yet started X.  I woke up this morning to discover that from the end of the handbook to the deep rebuild plus gnome, took about an hour and 3 minutes on my box.  So it was done before I fell asleep, rather than taking the hours I expected.

I'll find out whether it all works sometime this weekend.

Thanks for the help everyone!

----------

## Ant P.

 *1clue wrote:*   

> 
> 
> Make localconfig does not work.  I also looked in the Makefile and did not find anything that was close.
> 
> 

 

"make help" will tell you all the options you have (it's localmodconfig BTW).

----------

