Subject: Re: Allow config extract embedded configuration files
To: Greywolf <greywolf@starwolf.com>
From: Andrew Brown <atatat@atatdot.net>
List: tech-userlevel
Date: 04/14/2003 14:04:27
>RP> .... although it doesn't help in the not-running case.
>RP>
>RP> I know Linux examples often aren't well-regarded, but in this case it
>RP> looks like they've got a good one to offer.  Perhaps NetBSD should have
>RP> a /kern/config that can just be read to get the current configuration?
>
>FB> "/kern" isn't well-regarded either, so it would probably be OK. ;-)

fwiw, i've toyed with the idea, but never settled on something that
seemed "right" to me.

>Or you can do what I did and just write a SLSS to handle it as described
>in the man page...
>[note: I probably spent too much time writing this, but if anyone else
>finds it useful, have at.]

fwiw, i use this:

	#!/bin/sh
	if [ $# = 0 ]; then cd /; fi
	if [ $# = 0 ]; then set `sysctl -n machdep.booted_kernel`; fi
	if [ $# = 0 ]; then set netbsd; fi
	strings - "$@" | sed -n 's/^_CFG_//p' | unvis

and then i just redirect the output as i see fit.  it works.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."