LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-07-2009, 05:34 PM   #1
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Rep: Reputation: Disabled
Easier kernel configuration with 2.6.32


According to release notes for Linux-2.6.32 @ kernelnewbies.org:
Quote:
1.8. Easy local kernel configuration

Most people uses the kernel shipped by distros - and that's good. But some people like to compile their own kernels from kernel.org, or maybe they like following the Linux development and want to try it. Configuring your own kernel, however, has become a very difficult and tedious task - there're too many options, and some times userspace software will stop working if you don't enable some key option. You can use a standard distro .config file, but it takes too many time to compile all the options it enables.

To make easier the process of configuration, a new build target has been added: make localmodconfig. It runs "lsmod" to find all the modules loaded on the current running system. It will read all the Makefiles to map which CONFIG enables a module. It will read the Kconfig files to find the dependencies and selects that may be needed to support a CONFIG. Finally, it reads the .config file and removes any module "=m" that is not needed to enable the currently loaded modules. With this tool, you can strip a distro .config of all the unuseful drivers that are not needed in our machine, and it will take much less time to build the kernel. There's an additional "make localyesconfig" target, in case you don't want to use modules and/or initrds.
That's good news for those of us needing or wanting to build a new kernel and using a Slackware config file as a starting point
 
Old 12-07-2009, 06:22 PM   #2
swampdog2002
Member
 
Registered: Jul 2005
Distribution: Slackware 12.2, 13.0, openSUSE 11.2
Posts: 400

Rep: Reputation: 33
That is interesting news, and which will be very useful. On this note, I have always wondered if it was problematic with using a .config file from an earlier kernel release to use to build a new kernel from source. For example, if going from 2.6.29.6 to 2.6.32, if you load the .config from 2.6.29.6 into 2.6.32 when compiling, would problems result from this? The reason I ask is that I have done this before, and noticed when I loaded an older .config from an older kernel branch that there a few text exceptions thrown in the background, but couldn't quite make them out due to the kernel configuration menu being in the foreground. All seemed to build well with no errors in the process, so I don't know. Anyway, I'll be trying this new method in the future to see what results. Thanks for sharing this.

Last edited by swampdog2002; 12-07-2009 at 06:23 PM.
 
Old 12-07-2009, 06:35 PM   #3
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,682

Rep: Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375
This is very interesting. I'll have to give this a try when I get off work tonight. Thanks for the heads up. I always have my custom configs saved but maybe this can help me thin out a few unneeded modues.

Last edited by Daedra; 12-08-2009 at 01:27 AM.
 
Old 12-07-2009, 06:46 PM   #4
Chuck56
Member
 
Registered: Dec 2006
Location: Colorado, USA
Distribution: Slackware
Posts: 930

Rep: Reputation: 479Reputation: 479Reputation: 479Reputation: 479Reputation: 479
Nice find. Thanks!
 
Old 12-07-2009, 08:14 PM   #5
drumz
Member
 
Registered: Apr 2005
Location: Oklahoma, USA
Distribution: Slackware
Posts: 903

Rep: Reputation: 692Reputation: 692Reputation: 692Reputation: 692Reputation: 692Reputation: 692
As to using an old config file, yes it's what I always do. Copy the old .config file to your new build directory and then run
Code:
make O=/your/build/directory oldconfig
And it will only ask you questions for new or changed features. After that you can double check with menuconfig/xconfig to make sure it's how you want it.

localmodconfig does look interesting but I haven't used it yet. I feel like I already have my configuration the way I want it. Of course there's always room for improvement.
 
Old 12-08-2009, 04:22 AM   #6
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,682

Rep: Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375
So I just tried it out using 2.6.32 with a custom .config from 2.6.30.10. I managed to shave off 45kb from the finished kernel. I'm impressed.
 
Old 12-08-2009, 05:31 AM   #7
BrZ
Member
 
Registered: Apr 2009
Distribution: Slackware
Posts: 543

Rep: Reputation: 121Reputation: 121
And:

Quote:
It's worth mentioning that the 'low_latency' setting defaults to on.
Sounded very cool =]
 
Old 12-08-2009, 06:43 AM   #8
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Rep: Reputation: 139Reputation: 139
Very useful for people who do not "chop & change" their hardware. If this works well it should be possible to take a newly installed system with a huge.s kernel, run a script and have a kernel (optimised for your system) created and automatically added to your boot loader.

samac
 
Old 12-08-2009, 06:51 AM   #9
~sHyLoCk~
Senior Member
 
Registered: Jul 2008
Location: /dev/null
Posts: 1,173
Blog Entries: 12

Rep: Reputation: 129Reputation: 129
Has anyone tested this yet? I will be trying it out this weekend, too much work now. Let us know your experience if you have done it.
 
Old 12-08-2009, 06:56 AM   #10
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Original Poster
Rep: Reputation: Disabled
... But I would start with a generic kernel as if I understand well the only removed drivers with "make localmodconfig" are among those previously configured as modules.
 
Old 12-08-2009, 09:30 AM   #11
sahko
Senior Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 1,041

Rep: Reputation: Disabled
Thanks for the news. Very interesting and very needed.
 
Old 12-08-2009, 12:33 PM   #12
wadsworth
Member
 
Registered: Aug 2007
Distribution: Slackware64 13.37
Posts: 215

Rep: Reputation: 65
A couple of gotchas.

Modules that aren't already loaded won't be available with your new kernel,
plug in a USB stick before running "make localmodconfig". Or else no USB support.

Support for filesystems not currently in use will also be removed.
Check the config for excluded filesystems you may need (XFS, JFS and the like).
 
1 members found this post helpful.
Old 12-08-2009, 12:56 PM   #13
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Thanks, this is useful info and will probably save plenty of time when building a kernel. Thanks also goes out to all the Linux kernel devs that made this possible.

Personally, I would start with perhaps a generic kernel, then run the 'make localmodconfig', then 'make menuconfig' and make sure things look good. You may want to enable some things that were not detected, but I'm sure it will help in keeping the kernel small, and possibly fast.
 
Old 12-08-2009, 10:32 PM   #14
~sHyLoCk~
Senior Member
 
Registered: Jul 2008
Location: /dev/null
Posts: 1,173
Blog Entries: 12

Rep: Reputation: 129Reputation: 129
Ok I finally did it. Now with a customized 2.6.32 kernel. localmodconfig is quite useful but not that well implemented yet. I had inserted my USB drive before running localmodconfig, but at the end of the compilation process I was left without any USB support. I did a make clean and make menuconfig again to check out what happened and saw that "USB Mass storage support" was off and many USB options weren't auto-detected. My soundcard module wasnt picked up either. It's a generic Intel sound card. So I had to enable those modules and recompile kernel. Now everything works great. However this option did help me getting rid of a lot of unnecessary stuffs quite easily.

Last edited by ~sHyLoCk~; 12-08-2009 at 10:41 PM. Reason: bad grammar :((
 
Old 12-10-2009, 07:52 AM   #15
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,055

Original Poster
Rep: Reputation: Disabled
I just tried "make localmodconfig" and it worked well.

My starting point was a 2.6.32 kernel already slightly customized and stripped down from a Slackware generic 2.6.29.6 kernel.

As space on disk is not really an issue here, major visible benefit is (a lot) less time to run "make modules". FYI anyway:
Code:
bash-3.1$ du --max-depth=1 -h /lib/modules/
75M     /lib/modules/2.6.29.6
40M     /lib/modules/2.6.32
14M     /lib/modules/2.6.32strip
65M     /lib/modules/2.6.29.6-didier
193M    /lib/modules/
bash-3.1$
As seen through "make help", "make localyesconfig" could be handy too for people preferring having everything built-in.

Caveat: as already said, plug in your USB devices (or, more generally, removable devices) needing a specific driver first, or at least take a note of the modules they use so you can add it afterwards. For instance issue "make localmodconfig" then "make menuconfig" to add what would have been be missing.

Last edited by Didier Spaier; 12-10-2009 at 08:40 AM. Reason: typo corrected
 
  


Reply

Tags
kernel



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what am I missing in my kernel configuration, kernel panic Kristian2 Slackware 16 10-05-2009 07:01 PM
Hosed my kernel - LUKS partition is not making it easier king111 Linux - General 1 11-23-2008 02:24 PM
[SOLVED] Diff between Kernel Compilation and Kernel Configuration ?? vikas027 Linux - Enterprise 8 09-20-2008 01:01 AM
New FAQ topic: Should I edit my kernel configuration?/Should I build a custom kernel? chort *BSD 10 09-10-2004 11:15 PM
Windows route configuration easier than Linux??? hdalle Linux - Networking 5 08-25-2004 06:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration