[lkml]   [2002]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: How to check the kernel compile options ?
On Feb 13, 2002  00:10 +0200, Ville Herva wrote:
> On Tue, Feb 12, 2002 at 02:06:24PM -0700, you [Andreas Dilger] wrote:
> >
> > You can also extract it from an uncompressed kernel (vmlinux) or the
> > module with "strings <file> | grep '[A-Z]*=[ym]$'". It is simple
> > enough to search for the gzip magic (1f 8b 08 00 at about 16-18kB)
> > in a zImage or bzImage, and then pipe it to gunzip and strings as above.

Just as a clarification, the module configs can be stored in the short form:


I checked, in my current kernel/modules nothing matches the above regexp,
and even if it did, having a garbage config value wouldn't be fatal.

> Such script could live in /usr/src/linux/scripts. The same script could
> perhaps extract the version string as well. Anybody got a clue how to find
> it reliably? Is this reliable
> strings /boot/bzImage |
> egrep '^[0-9]+\.[0-9]\.+.*\(.*@.*\).*[0-9]+:[0-9]+:[0-9]+' |
> head -1

This will work for the bzImage, but not the uncompressed kernel. If you
remove the "^" (start of line) requirement it works for both:

egrep '[0-9]+\.[0-9]\.+.*\(.*@.*\).*[0-9]+:[0-9]+:[0-9]+'

Cheers, Andreas
Andreas Dilger

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:18    [W:0.112 / U:1.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site