Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Oct 2001 11:39:58 -0700
From:      Peter Wemm <peter@wemm.org>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        Brian Somers <brian@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/conf Makefile.i386 
Message-ID:  <20011021183958.24ABB3803@overcee.netplex.com.au>
In-Reply-To: <20011021190723.I46880-100000@delplex.bde.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
Bruce Evans wrote:
> On Sun, 21 Oct 2001, Peter Wemm wrote:
> 
> > Brian Somers wrote:
> > > brian       2001/10/17 06:57:32 PDT
> > >
> > >   Modified files:
> > >     sys/conf             Makefile.i386
> > >   Log:
> > >   Change kern.bootfile when mv'ing the kernel
> > ...
> > This is incomplete..
> > what if it is the second 'make install'?
> 
> This part is handled by the confusing logic.

.. which is broken, because it leaves kern.bootfile pointing to
kernel.old, even though it has trashed kernel.old.  ie: kern.bootfile is
no longer pointing to the booted kernel.

> 
> > Nothing is supposed to be using this sysctl, it's purely informational
> > these days, and even then it has only part of the story.  The booted kernel
> > may not even be reachable (eg: on an EFI filesystem or pulled in via tftp).
> 
> _kvm_open() still uses getbootfile() unconditionally, so it's hard to
> tell what uses the sysctl.

On a live kernel, the getbootfile() thing should be irrelevant.  On a live
kernel it shouldn't be used.  This is probably out of sync with reality
though.

> getbootfile() is also used by:
> - savecore: doesn't use libkvm or kldsym, so it can only get the symbols
>   from the kernel file.  More fundamentally, it can't save the kernel
>   file if the kernel file is unreachable.

Well, yeah. :-)  I dont recall it gracefully dealing with you booting
from a different kernel to the one that crashed either.  Adding this
telepathic "Do What I Mean" mode of operation would probably require the
dumpsys procedure to save the kernel path in a known location in the
dump so that savecore can check it as well if the current booted kernel
version string doesn't match.  Anything more than that will be fun to
implement. :-)

> - syslogd: the name of the kernel file is used as a prefix.  If I kept
>   kernels in the standard place, then I would have complained about the
>   bloatage of syslogd output caused by renaming the kernel from /kernel
>   to /boot/${NAME_OF_MY_KERNEL}/kernel

It used to print "kernel" always, even when the kernel was /vmunix
and on other systems when it is /bsd or /netbsd.  I'd much rather that
we went back.

When syslogd starts up, it could log the value of kern.bootfile and 
kern.module_path once in the kernel log and just use "kernel:" for identifying
kernel originated messages.

> - trpt: doesn't use libkvm or kldsym.  It apparently never got converted
>   to use libkvm.

This is a bug.

> - kgmon: uses libkvm, but bogusly calls getbootfile() itself instead of
>   asking kvm_openfiles() for the default.

This is a bug too..

> Related problems:
> - gprof: needs to read the bootfile if used on kernels, since it doesn't
>   use kldsym.  The bootfile name must be specified on the command line
>   for kernels.  I normally use `sysctl -n kern.bootfile` to get it.
> 
> Not-so-related problems:
> - kgmon: the change of the default output file name from gmon.out to
>   <progam name>.gmon has not reached here, so you have to tell gprof
>   the gmon filename too.
> 
> Bruce
> 
> 
> 

Cheers,
-Peter
--
Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011021183958.24ABB3803>