Subject: Re: hardware check in /etc/rc.local?
To: Andrew Gillham <>
From: Bill Studenmund <>
List: current-users
Date: 09/09/1996 10:37:05
On Thu, 5 Sep 1996, Andrew Gillham wrote:

> Part 2... :)
> I revised the code slightly, to take into account the fact that
> dmesg may have multiple "boot logs."  By looking for a line beginning
> with 'NetBSD', and grabbing everything from that line on, I then have
> the last boot log.  But, if the message buffer has overflowed because
> of the number of devices, looking for the regexp '^NetBSD' won't
> work.  This all works if I reverse the output of dmesg (via tail -r) and
> search for the _first_ (which is the _last_ really) occurence of '^NetBSD.'
> If '^NetBSD' is found, sed quits, and the output is reversed again, so
> it is back to normal.  This results in the last boot information if there
> is more than one, otherwise the whole output.  This works fine on my 
> i386 system, but I can't test it on the sparc at the moment.
> This seems to cover the possibilities, but.. :)

I have a question about this. I think the idea looks cool, but why go
looking in /var/log/dmsglog? Doesn't the kernel export the message log for
this boot in /kern/msglog? Why not just look in there?

Don't most GENERIC kernels include kernfs? (`set soapbox = true`) The more
I understand how it works, the more useful it seems to me. Not only does
it permit mucking around with kernel parameters (as do the sysctl and
libkvm interfaces), but it permits the kernel exporting the hierarcy and
location of these parameters. With libkvm, binaries have to match kernels. 
With sysctl, the match isn't as strict, but sysctl has the hierarchy
compiled in (from parsing include files). So if you add something to the
kernel, you have to recompile sysctl. :-( With kernfs, the hierarchy and
interface are kept with the parameters to be changed, so they stay in
sync. `unset soapbox` :-)

Take care,