Re: kms in defconfig

From: Ingo Molnar
Date: Tue Apr 28 2009 - 15:19:56 EST



* Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> On Tue, 28 Apr 2009, Ingo Molnar wrote:
>
> >
> > * Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > > So yes, it would be good to automate it:
> > >
> > > > If a tool was available to detect the hardware and create a
> > > > config tailored for the box, this use for a default config would
> > > > go away
> > >
> > > Yeah, I've wished for that.
> >
> > Steve (Cc:-ed) submitted such a script last year IIRC. It wasnt
> > particularly complex.
>
> I've submitted the script a few times to LKML but it is not
> exactly what people want, but is quite useful in the mean time.
>
> What people want is a script that will analyze their system
> devices and enable all the configs that will support them.
>
> My script requires that you have booted the kernel (or similar
> kernel with the same config options and modules). It then runs
> lsmod, and searches for the options that enable those modules. It
> then reads the current .config file and prints out a new config
> that disables all module configs that are not used to enable the
> modules found with lsmod.
>
> Here's the code (perl script):
>
> http://rostedt.homelinux.com/code/streamline_config.pl
>
> The instructions on how to use it are at the top of the file.
>
> This script has brought down my full kernel compile times with
> distcc from 50 minutes to under 10.

Looks rather useful IMHO.

I use the following magic incantation in cfs-debug-info.sh to get to
the distro config automatically:

KREL=`uname -r | sed 's/smp$//g'`
( cat "`rpm -ql kernel-$KREL 2>/dev/null | grep /boot/config`"
cat "`rpm -ql kernel-smp-$KREL 2>/dev/null | grep /boot/config`"
cat "`dpkg -L linux-image-$KREL 2>/dev/null | grep /boot/config`"
cat /boot/config-$KREL 2>/dev/null
)

Works on most .rpm and .deb based distros. (If /proc/config.gz is
present that could be added too.)

So if this was added as a 'make builtinconfig' kind of shortcut,
with no extra steps needed (and if the script bailed out if it
cannot find the currently booted .config) - that would be a rather
useful (and easy) way to start kernel development on a new box.

Useful to newbies and oldbies alike IMHO.

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/