From owner-freebsd-current Wed Mar 27 19: 7:26 2002 Delivered-To: freebsd-current@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id B928E37B405; Wed, 27 Mar 2002 19:07:20 -0800 (PST) Received: from fledge.watson.org (fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.6/8.11.6) with SMTP id g2S35ww45072; Wed, 27 Mar 2002 22:05:59 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Wed, 27 Mar 2002 22:05:58 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: hiten@uk.FreeBSD.org Cc: current@FreeBSD.org, bug-followup@FreeBSD.org Subject: Re: Some info on the kgmon(8) manual page (regarding current) needed In-Reply-To: <20020328004410.9310.qmail@web21102.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 27 Mar 2002, Hiten Pandya wrote: > According to me, the utility shouldn't be using a hardcoded path to the > booting kernel, as this would affect kernels which were made by: > > makeoptions KERNEL=foo #Build kernel "foo" and install "/foo" > > What are your suggestions? The utility doesn't appear to have any hard-coded paths in it at all. It gets them from one of two places: getbootfile(), or the command line. If getbootfile() is used then it's right. If you specify it on the command line and that's wrong, it's your fault. It's worth noting, as I did to Garance out-of-band, that the path returned by getbootfile() may be wrong for a variety of reasons, including: - The kernel at that path has been replaced for some or another reason, including kernel upgrade. - The file system root doesn't match that used by the boot loader, either because chroot() has occurred for the current process, or because the root and boot devices differ (e.g., network load of kernel, local root file system). getbootfile() is relatively unreliable, as such, but is a decent default. > In any case, I will take the precautions which Giorgos has put in place, > and will produce the patches accordingly. :) I'd avoid your later changes involving describing how getbootfile() relies on sysctl in the kgmon(8) man page. That's an implementation detail of the API, not of kgmon, and while it probably won't change, putting the information there increases the chances of it getting stale, as well as exposing system MIB information that has a well-documented API for accessing it. Talking about the possible failure modes of the call probably is relevant, since that impacts correct functionality of kgmon(8). Giorgos' patch, modulo reference to -N, is probably the right answer. Robert N M Watson FreeBSD Core Team, TrustedBSD Project robert@fledge.watson.org NAI Labs, Safeport Network Services To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message