Question : Kernel recompilation .config file (make menuconfig)

Once you've installed your distro, in my case its Fedora, and I want to re-compile my kernel, are there any kind of tools that take a snapshot of your existing configuration and create a .config file for you, or make the association between "lsmod" and what's in the "menuconfig"?.  What's upsetting me is that whenever you're running
make mrproper
make menuconfig

A new .config file gets created (I always backup mine) and the same generic selections are given, and you have to go manually and setup once again your selections.  For instance here's my lsmod

Module                  Size  Used by    Not tainted
nfs                    95348   2  (autoclean)
nfsd                   84656   8  (autoclean)
lockd                  58832   1  (autoclean) [nfs nfsd]
sunrpc                 82140   1  (autoclean) [nfs nfsd lockd]
usbserial              23580   0  (autoclean) (unused)
parport_pc             18756   1  (autoclean)
lp                      8964   0  (autoclean)
parport                36832   1  (autoclean) [parport_pc lp]
autofs4                15928   7  (autoclean)
audit                  89848   3
tg3                    63592   1
floppy                 56656   0  (autoclean)
sg                     36204   0  (autoclean)
sr_mod                 17784   0  (autoclean)
microcode               5688   0  (autoclean)
ide-scsi               12336   0
ide-cd                 33920   0
cdrom                  32416   0  [sr_mod ide-cd]
keybdev                 2944   0  (unused)
mousedev                5524   1
hid                    22116   0  (unused)
input                   5888   0  [keybdev mousedev hid]
ehci-hcd               20008   0  (unused)
usb-uhci               25740   0  (unused)
usbcore                77376   1  [usbserial hid ehci-hcd usb-uhci]
ext3                   85736   3
jbd                    50604   3  [ext3]
ata_piix                5096   0  (unused)
libata                 38932   0  [ata_piix]
mptscsih               39696   5
mptbase                40736   3  [mptscsih]
diskdumplib             4940   0  [mptscsih mptbase]
sd_mod                 13744  10
scsi_mod              106408   6  [sg sr_mod ide-scsi ata_piix libata mptscsih sd_mod]

I want to know which of these entries is associated in the entry in the menuconfig, and I usually just vi .config and do searches, but then I have to go do make menuconfig and TRY to find out where they are. Its pretty annoying.  Are there any kind of kernel optimization tools out there that take a) a look at your system then b) make a skeleton .config file for you with ONLY what the system requires and then its up to you to add/remove more stuff.  

Answer : Kernel recompilation .config file (make menuconfig)

Hi,

   "lsmod" show the modules currently loaded. So in .config file, those are related to the setting "=m", which
are not built into boot kernel image but loaded as modules.

   When you run "make menuconfig", it will show as "m", too. However, not all the device with "m" setting
will shoe on "lsmod" because those hardware devices related to those modules are not exist on your system.
Say you see Adaptec aix79xx is "m" in menuconfig but you don't have Adaptec SCSI card in your PC, so you
won't see aix79xx in "lsmod".

   Other experts have mentioned that /boot/config-`uname -r` is your current kernel configuration file.
You just copy that file as .config and use vi or "make menuconfig" then it is optimized for your system already.
(Well, maybe not optimized, but at least it is tuned for your system).

Regards,

Wesly
Random Solutions  
 
programming4us programming4us