[CentOS] Trying to find all the kernel modules needed for my machine using shell script

Fri Jul 13 12:29:37 UTC 2012
Aft nix <aftnix at gmail.com>


I'm developing kernel modules right now, and the build times are
starting to get under my skin. As a side effect i'm taking way too
many "coffee" breaks during builds.

So i was looking for a way to build only the stuffs i need for my
platform. Chapter 7 and 8 of "linux kernel in a nutshell" gave a good
detail of how to do that by hand. Its a good read :

But Although i understand the stuffs, this is still a lot of tweaks to
make that work.

2.6.32 and later kernels added a new target "make localmodconfig".
which scans through "lsmod" and change the .config appropriately. So i
thought i found my "automation". But this perl script has some problem

This thread describes the problems :

There was also a proposed solution which apparently worked for others
, is to run the script directly instead of using make's target.

Although for me, make localmodconfig does not work at all. its because
of the following :

    $make clean
    $make mrproper
    $cp /boo/config-'uname -r' .config
    $make localmodconfig

and it haults with

    vboxguest config not found!!
    nf_defrag_ipv6 config not found!!
    vboxsf config not found!!
    vboxvideo config not found!!

The thing is my kernel development environment is inside virtualbox.
These vbox modules were installed when i chose to install "virtualbox
guest addtion".

And the netfilter module might be a Distribution specific module(Lot
of netfilter modules are not part of the mainline kernel, so its not a
shock to me), which is not included in mainline kernel.

Now the workaround this obviously unloading these module and trying
again. But I'm thinking if there is patch for the
"streamline_config.pl" which will enable the user to exclude certain
modules if s/he wants. Problem is i have "zero" knowledge about perl
and i like it that way.

So my problems in "nutshell"

1) Patching streamline_config.pl so i can give a list of module name
as argument which it will exclude from processing the config file.

2) I've tried to run the script by myself. But running it directly
fails with a error.

    [root at kernel-host-rh6 linux-2.6]# sh scripts/kconfig/streamline_config.pl
    scripts/kconfig/streamline_config.pl: line 45: my: command not found
    scripts/kconfig/streamline_config.pl: line 47: my: command not found
    scripts/kconfig/streamline_config.pl: line 48: chomp: command not found
    scripts/kconfig/streamline_config.pl: line 50: syntax error near
unexpected token `('
    scripts/kconfig/streamline_config.pl: line 50: `my @searchconfigs = ('

Again my "zero" knowledge about perl does not helping my case.

Additional info:

I have faced the same thing in 2.6.32, 2.6.33, 2.6.35, 3.4, 3.4.rc1
.....(I constantly switch version for various reasons, everywhere the
problem is same)

You can access the script from kernel.org gitweb:

Its from 3.4.0. `git log --stat scripts/kconfig/streamline_config.pl`
shows some activity recently on this file. But my problem persists.

3) Is there any way i can get the "Centos specific" patches in "plain
patch" format? That means i dont wanna do things in src-rpm way.
If the patches are available in normal patch format i can keep
everything tidy in my kernel git tree.