mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolabs.com>
To: Bill Davidsen <davidsen@tmr.com>
Cc: Padraig Brady <padraig@antefacto.com>,
	Daniel Phillips <phillips@bonn-fries.net>,
	linux-kernel@vger.kernel.org
Subject: Re: How to check the kernel compile options ?
Date: Tue, 12 Feb 2002 14:06:24 -0700	[thread overview]
Message-ID: <20020212140624.R9826@lynx.turbolabs.com> (raw)
In-Reply-To: <3C695035.6040902@antefacto.com> <Pine.LNX.3.96.1020212132711.6082B-100000@gatekeeper.tmr.com>
In-Reply-To: <Pine.LNX.3.96.1020212132711.6082B-100000@gatekeeper.tmr.com>; from davidsen@tmr.com on Tue, Feb 12, 2002 at 01:32:11PM -0500

On Feb 12, 2002  13:32 -0500, Bill Davidsen wrote:
> On Tue, 12 Feb 2002, Padraig Brady wrote:
> > I'd go for tacking it on at the end of the bzImage. Advantages would be
> > that it can be read even when the kernel isn't loaded, and also there
> > is no danger of loading a module in another kernel.
> 
> There are several problems with that:
> 1 - built into the kernel it is compressed and needs a tool to read
> 2 - the reason kernels are compressed is to make them fit in small boot
>     media, so adding something to the image is not to be done lightly.
> 3 - modules are NOT compressed, and can be read with the strings command.
> 4 - other files in the modules directory are pure text and if the config
>     was just text it could be read with `cat.'

My thought on this is to make it a tristate [y/m/n] and have it print
output via /dev/kconfig or similar.  There could be a dep_bool which
keeps it in-core, or puts it in an init function which is discarded
after boot.  If you don't want to have it at all, you turn it off.
If you want it in the kernel, but not in memory all the time, it can
be in an init function (maybe printk'ing it before startup is done?).
It can be in a module and you can get the original plain-text config
back with "cat /dev/kconfig" and if it is a module it will be auto-loaded
from wherever it is.

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.

The reason you need all of these config options (which don't end up
making the code much more complex) is because, for example, if you
are netbooting your kernel, you do not have access to any external
data or even the original kernel image on that system.  If it is in-memory
you use 15kB of RAM (5kB in the compressed image) for a fully-configured
vendor kernel, but you have the config options for THIS kernel and not
any "maybe it is right, maybe not" external file.

If it is a module, you can "cat /dev/kconfig > .config" to get a valid
config file, as long as you are sure this is the right module (maybe
modversions would help a bit, maybe not, or you could explicitly have
the kernel version string compiled into the module and compare it).

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/


  reply	other threads:[~2002-02-12 21:11 UTC|newest]

Thread overview: 118+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-05 23:56 Andries.Brouwer
2002-02-06  0:14 ` Ian S. Nelson
2002-02-06  0:19 ` H. Peter Anvin
2002-02-06  0:20 ` Alan Cox
2002-02-06 10:36   ` Christoph Rohland
2002-02-06 14:16     ` Alan Cox
2002-02-06 15:31       ` Christoph Rohland
2002-02-06 22:13         ` Alex Bligh - linux-kernel
2002-02-06 15:59       ` Randy.Dunlap
2002-02-06 16:32         ` Padraig Brady
2002-02-09 18:15         ` Bill Davidsen
2002-02-11  0:29           ` Daniel Phillips
2002-02-11 19:05             ` Bill Davidsen
2002-02-11 21:17               ` Alex Bligh - linux-kernel
2002-02-12  0:32               ` Daniel Phillips
2002-02-12 16:38                 ` Bill Davidsen
2002-02-12 17:23                   ` Daniel Phillips
2002-02-12 17:26                     ` Padraig Brady
2002-02-12 18:32                       ` Bill Davidsen
2002-02-12 21:06                         ` Andreas Dilger [this message]
2002-02-12 22:10                           ` Ville Herva
2002-02-12 22:33                             ` Andreas Dilger
2002-02-13  0:49                           ` Randy.Dunlap
2002-02-13  2:35                             ` Andreas Dilger
2002-02-13 15:37                             ` [lkml] " Ian Soboroff
2002-02-12 18:26                     ` Bill Davidsen
2002-02-13 14:19                     ` Horst von Brand
2002-02-13 15:58                       ` Daniel Phillips
2002-02-13 23:00                         ` Bill Davidsen
2002-02-13 16:25                       ` Richard B. Johnson
2002-02-13 18:09                         ` Randy.Dunlap
2002-02-13 18:26                           ` Daniel Phillips
2002-02-13 18:27                           ` Richard B. Johnson
2002-02-13 18:35                             ` Daniel Phillips
2002-02-13 18:40                           ` Randy.Dunlap
2002-02-13 21:51                         ` Bill Davidsen
2002-02-13 22:02                           ` Richard B. Johnson
2002-02-13 23:08                             ` Bill Davidsen
2002-02-13 23:21                               ` Ben Greear
2002-02-13 23:39                                 ` Andreas Dilger
2002-02-13 22:17                           ` Ben Greear
2002-02-13 23:13                             ` Bill Davidsen
2002-02-14 16:48                               ` Randy.Dunlap
2002-02-15 22:51                                 ` Andreas Dilger
2002-02-15 23:04                                   ` Randy.Dunlap
2002-02-16  1:10                                     ` Randy.Dunlap
2002-02-19 11:14                                       ` Andreas Dilger
2002-02-16  0:58                                   ` Andreas Ferber
2002-02-22 19:56                                     ` Randy.Dunlap
2002-02-23  7:02                                       ` Andreas Ferber
2002-02-26  6:30                                         ` Andreas Ferber
2002-03-01 21:01                                           ` Randy.Dunlap
2002-02-14  1:02                           ` Daniel Phillips
2002-02-17 12:11                             ` Bill Davidsen
2002-02-12 17:35                   ` Chris Friesen
2002-02-11 18:37           ` Randy.Dunlap
2002-02-11 19:26             ` Bill Davidsen
2002-02-06 16:26       ` Ville Herva
2002-02-06 17:26         ` Thomas Capricelli
2002-02-06 18:16       ` David Relson
2002-02-07  7:56         ` Ville Herva
2002-02-07  9:12           ` Thomas Capricelli
2002-02-07 12:22             ` Ville Herva
2002-02-07 21:11           ` Horst von Brand
2002-02-08  8:25             ` Ville Herva
2002-02-07  8:52       ` Horst von Brand
2002-02-06 11:29 ` Marco Colombo
2002-02-06 13:26   ` Horst von Brand
     [not found] <0C01A29FBAE24448A792F5C68F5EA47D217218@nasdaq.ms.ensim.com>
2002-02-12 21:26 ` Paul Menage
  -- strict thread matches above, loose matches on Subject: below --
2002-02-06  4:55 Rick A. Hohensee
     [not found] <fa.c5n369v.1a10827@ifi.uio.no>
2002-02-04 16:21 ` Giacomo Catenazzi
2002-02-04 16:01 David Balazic
2002-02-04 16:54 ` Alan Cox
2002-02-04 17:02   ` David Balazic
2002-02-04 17:23     ` Alan Cox
2002-02-04 17:12       ` David Balazic
2002-02-04 17:16         ` Allan Sandfeld
2002-02-04 18:05           ` Daniel Phillips
2002-02-04 18:14             ` Arjan van de Ven
2002-02-04 18:24               ` Ben Greear
2002-02-04 18:24               ` Daniel Phillips
2002-02-04 22:11                 ` H. Peter Anvin
2002-02-04 23:46                   ` Daniel Phillips
2002-02-04 23:34               ` J.A. Magallon
2002-02-04 18:09     ` Samuli Suonpaa
2002-02-04 17:34 ` Thomas Capricelli
2002-02-04 17:50 ` David Relson
2002-02-04 18:22   ` H. Peter Anvin
2002-02-05 22:02     ` Alex Bligh - linux-kernel
2002-02-05 22:13       ` H. Peter Anvin
2002-02-06  9:15         ` Daniel Phillips
2002-02-07  4:13           ` Mike Touloumtzis
2002-02-07  9:32             ` Marco Colombo
2002-02-07 13:18             ` Daniel Phillips
2002-02-07 18:26               ` Mike Touloumtzis
2002-02-07 19:19                 ` Daniel Phillips
2002-02-07 20:34                   ` Mike Touloumtzis
2002-02-07 20:54                     ` Daniel Phillips
2002-02-07 21:08                       ` Mike Touloumtzis
2002-02-07 21:33                         ` Daniel Phillips
2002-02-07 23:58                         ` John Alvord
2002-02-09 21:59                         ` Alex Bligh - linux-kernel
2002-02-07 21:08                     ` Daniel Phillips
2002-02-07 21:41                       ` Mike Touloumtzis
2002-02-07 22:09                         ` Daniel Phillips
2002-02-07 22:13                           ` Mike Touloumtzis
2002-02-07 22:27                             ` Daniel Phillips
2002-02-08 20:53                           ` Horst von Brand
2002-02-09 12:22                             ` Daniel Phillips
2002-02-11 16:07                             ` Randy.Dunlap
2002-02-09 21:39                     ` Alex Bligh - linux-kernel
2002-02-06 16:37       ` Bill Davidsen
2002-02-04 18:34   ` David Relson
2002-02-04 21:09     ` Keith Owens
2002-02-05 16:30       ` Thomas Capricelli
2002-02-04 22:12     ` H. Peter Anvin
2002-02-04 16:01 David Balazic
2002-02-04 21:47 ` Matti Aarnio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020212140624.R9826@lynx.turbolabs.com \
    --to=adilger@turbolabs.com \
    --cc=davidsen@tmr.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=padraig@antefacto.com \
    --cc=phillips@bonn-fries.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®