Subject: Re: passing in the booted kernel name...?
To: Soren S. Jorvang <firstname.lastname@example.org>
From: None <email@example.com>
Date: 01/09/1999 00:32:38
> I was thinking of some more general way of accomplishing what
> machdep.booted_kernel does, i.e. mostly where to point kvm_mkdb at.
What's wrong with some startup script like:
mykernel = /`sysctl machdep.booted_kernel`
if [a version check($mykernel) passes]; do
[print warning or so]
> so perhaps
> simply checking all of /netbsd* for a version string matching
> the running kernel's would be better than trying to improve
One can try to improve `sysctl machdep.booted_kernel`, but it can
never be perfect unless you restrict the ways the system can
be booted. As it looks now, this variable reflects the name
of the booted file, not more, and in particular not whether
or how this file is accessible in the final filesystem.
Only a system administrator can know this, so only he can make
sure that kvm_mkdb etc. get a path to the active kernel.
A standard setup should assume "/`machdep.booted_kernel`" to be
the kernel file, and who has a more exotic setup is on his own.
Of course it would make things safer if the symbol table would
be loaded with the kernel image and accessed via a system call,
but in most cases this as a waste of memory. I'd think that
people loading the kernel from an other place than their own
filesystem's root should be clever enough to set up a startup
script which gets the kernel symbols right.