[plug] Here's one for the experts.....

Bernard Blackham bernard at blackham.com.au
Mon Nov 8 19:18:22 WST 2004


On Mon, Nov 08, 2004 at 04:15:34PM +0800, tcleary2 at csc.com.au wrote:
> Does anyone know how you can figure out which modules are compiled into a 
> kernel just by looking at the kernel image?

If it's a 2.6 kernel and it has the /proc/config.gz entry enabled,
you can run gz_extract[1] over it one or two times to locate the
config file. Running it once will give you the uncompressed kernel
image. Running it over that image will probably produce a few gz
files (or things that look like gz files), and one of those will be
the kernel config.

> A mate of mine has an issue with a Firewall where what he'd like to do 
> depends upon what's already there.....

As Jim asserted earlier, there may be a file in /boot/ called
something like config-2.X.X where 2.X.X is the kernel version that
will contain all the information you need (and is much easier that
the process I described above :)

Failing that, if you've got some time, then you can boot the kernel
and sift through the contents of /proc/kallsyms (or /proc/ksyms
depending on the kernel version), comparing entries with the
function names in the kernel sources to see what modules have been
built in. This would be the most tedious method and useful only if
things are getting desperate...

Bernard.

[1] http://samba.org/ftp/unpacked/junkcode/gz_extract.c

-- 
 Bernard Blackham <bernard at blackham dot com dot au>



More information about the plug mailing list