Subject: proposed mods to config(8) and the kernel build process
To: None <tech-kern@netbsd.org>
From: Luke Mewburn <lukem@wasabisystems.com>
List: tech-kern
Date: 12/12/2000 06:28:18
Hi people.

I've had a couple of ideas for changes to the way kernels are
configured and built, because I think it might make things easier
(for me at least ;-).

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


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[] = "
	#       $NetBSD: GENERIC,v 1.381 2000/11/28 19:44:07 augustss Exp $
	#
	#       GENERIC -- everything that's currently supported
	#
	   [...]
	# mouse & keyboard multiplexor pseudo-devices
	pseudo-device   wsmux           2
	";
	#endif /* STORE_CONFIG */

   That way you'd only get the config file compiled in if you asked for it,
   which possibly could be the default. It's ~ 25K extra on a 3000K i386
   GENERIC kernel.

   I'm not 100% sure of the easiest way to extract this info though;
   using gdb and 'print kernel_config' displays the LFs as the literal
   \n.

   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.


Comments or objections or improvements?

Luke.

PS: I'm soliciting opinions on these as separate issues; I believe the
first as being less contentious and probably will go in without much
objection.

--
Luke Mewburn  <lukem@wasabisystems.com>  http://www.wasabisystems.com
Luke Mewburn     <lukem@netbsd.org>      http://www.netbsd.org
Wasabi Systems - providing NetBSD sales, support and service.