Subject: Re: proposed mods to config(8) and the kernel build process
To: Luke Mewburn <lukem@wasabisystems.com>
From: Todd Vierling <tv@wasabisystems.com>
List: tech-kern
Date: 12/11/2000 15:21:15
On Tue, 12 Dec 2000, Luke Mewburn wrote:

: a) Add `-DKERNEL_foo' to the IDENT line, where `foo' is the kernel
:    config file name. I would find this useful when I'm adding hacks
:    or debugs for a specific machine which has its own config file
:    (e.g, my laptop with semi-borken APM), so I can wrap system
:    specific code with #ifdef KERNEL_foo

Be aware that config(8) can config kernels by a method other than "filename
== kernelname" -- you can also create a directory with a file called CONFIG
in it (usually with a "source /sys" directive in it) and just run config(8).
I do this all the time to build kernels completely outside of the syssrc
tree.  In this case, the kernelname should probably be taken from the last
directory component.

: b) Store a copy of the kernel's config file in the kernel itself,
:    in a manner that's easily extractable by a user.
:
:    My initial experiments were to add something like the following to
:    vers.c (with `"' and `\' appropriately \-quoted):
:
: 	#ifdef STORE_CONFIG
: 	const char kernel_config[] = "

On ELF platforms, you could use objcopy to put the config file into a
special ELF section ignored by the bootloader (".nbsdconfig" or somesuch).
This would save a bit of kmem, and could be done inside the Makefile instead
of config(8).

:    There was a suggestion to use the `.note' section in ELF to do
:    this, but that won't work for a.out, and I'm not sure on how to
:    pump this info into the kernel or extract it out.

Don't create this `feature' on a.out; it'll give more incentive for
platforms to switch to ELF.  <g>

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  http://www.wasabisystems.com/
-- Speed, stability, security, and support.  Wasabi NetBSD:  Run with it.