Re: How about a /proc/patches ?

Mikael Pettersson (Mikael.Pettersson@sophia.inria.fr)
Tue, 3 Mar 1998 14:20:01 +0100 (MET)


I've rewritten my /proc/patches patch of last week to include
most of the features various people have asked for:
* There are now separate configuration options for /proc/config,
/proc/patches, and the "list patches during boot" thing;
there's even some help text in Documentation/Configure.help.
* /proc/config and /proc/patches can be built as modules.
There's little reason to do so if your only concern is kernel
size: my kernel grows about 1k with all three features enabled.
However, making them modular allows them to be upgraded without
forcing a kernel reboot. This might be useful when upgrading a
driver or file system built as a module.
(Question: is it possible to have kerneld autoload a /proc/ file?)
* The new Makefile rules avoid including backup files &c in the
list of patches.

I'm not too pleased with the configuration aspect of the current
patch. It seems that if a new feature is not a file system or a device
driver, then it can only be added by hacking arch/$ARCH/config.in.
For this reason, my patch currently only adds itself to arch/i386/config.in.
(Is there a good clean way of adding "misc" features to the
configuration hierarchy without having to edit _every_ arch's config.in?
I don't want to lie and pretend this stuff is, say, a file system.
The fact that it, in some configurations, presents info in /proc
is irrelevant.)

C. Scott Ananian wrote:
> [can you format /proc/config as closely as possible to .config, so that
> modules/programs that are used to scanning /usr/src/linux/.config for info
> can redirect their search easily to /proc/config instead? Alternatively
> it could look like include/linux/autoconf.h instead.]

Actually, the kernel part of the patch doesn't care at all about
the actual format of the data we record; it's just a char array.
(It also simplifies the /proc/ code if a file's seek offset is
identical to the data offset.)
The current Makefile sets up /proc/config from .config as follows:
* it removes all lines that do not set a variable (saves a lot,
unless you build monster kernels or build everything as modules)
* it removes all CONFIG_ prefixes (saves a lot)
* last, it puts all remaining lines, each terminated by a \n,
in sequence in a char[]

I don't know of any programs that scan .config, but if they
are happy finding FOO=y instead of CONFIG_FOO=y then they'll work.
Otherwise you can do the formatting in user-space:
sed 's/\(.*\)/CONFIG_\1/' </proc/config | theprogram

But since the kernel code doesn't care, you could also store
the .config verbatim, or gzip the thing, or whatever.

Ok, enough. Here's the patch. Tested with 2.1.89-pre3 and -pre5.

/Mikael

begin 644 config-record-patch-0.2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