[lkml]   [2008]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: diet-kconfig: a script to trim unneeded kconfigs
Hi Takashi,

On Wed, 17 Sep 2008 01:55:26 +0200
Takashi Iwai <> wrote:

> Hi,
> a topic that just came up in kernel summit is a script to remove
> unneeded kernel configs automatically to reduce the compile time.
> Incidentally, I already wrote such a script during the last SUSE hack
> week a couple of weeks ago, so I'd like to share here, hopefully to
> give an idea for further improvements.
> The script checks the currently loaded modules and trims other
> CONFIG_XXX=m simply, and tries make oldconfig, and writes out the
> resultant .config in the current directory after some checks.
> You can specify the config file via option, as default, it reads from
> /proc/config.gz.

I agree with Giacomo: you should also check for /boot/config-`uname -r`
and /boot/config-`uname -r`.gz.

Also, if the idea is to make life easier for kernel newbies, I think the better
would be to have the script called at kernel Makefile (something like "make
diet"), and having a few other config's available somewhere at kernel tree,
since even a "minimal" kernel may need (or not) a few random modules, like
usb-storage. So, I think we should open a dialog that allows the selection of
using the previous kernel config or selecting between a few profiles like
"minimalist" (just the auto-detected things), "desktop" (adding things like
usb-storage), "notebook" (with a power-saving optimized config),
"server" (adding stuff like LVM, RAID5 and some advanced network configs).

It seems a good idea to check at /proc/cpuinfo and optimize for that
specific processor, enabling SMP only if needed, and only for the number of
existing cores.

> The script is VERY hackish. I should have begun with perl or whatever
> better script language, but I chose bash and co. So, don't expect
> much code quality. I'm no script guy after all :)

Using just a shellscript and binutils seems to be better than using other
tools, since it allows the usage on minimal configured systems where the user
might not have perl or other scripting languages.


 \ /
  Last update: 2008-09-18 17:29    [W:0.202 / U:14.412 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site