From owner-freebsd-arch Sun Mar 10 2:42:50 2002 Delivered-To: freebsd-arch@freebsd.org Received: from mass.dis.org (dhcp45-21.dis.org [216.240.45.21]) by hub.freebsd.org (Postfix) with ESMTP id 2F61237B400; Sun, 10 Mar 2002 02:42:48 -0800 (PST) Received: from mass.dis.org (localhost [127.0.0.1]) by mass.dis.org (8.11.6/8.11.6) with ESMTP id g2AAgCj03522; Sun, 10 Mar 2002 02:42:12 -0800 (PST) (envelope-from msmith@mass.dis.org) Message-Id: <200203101042.g2AAgCj03522@mass.dis.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Luigi Rizzo Cc: Michael Smith , arch@FreeBSD.ORG Subject: Re: For review: machdep.bootdev sysctl (for i386) In-reply-to: Your message of "Sun, 10 Mar 2002 02:03:43 PST." <20020310020343.J28779@iguana.icir.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 10 Mar 2002 02:42:12 -0800 From: Michael Smith Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > On Sun, Mar 10, 2002 at 01:09:47AM -0800, Michael Smith wrote: > > > I am not claiming that bootdev gives the correct answer in 100% of > > > the cases. As you correctly notice, there is probably not a "perfect" > > > solution. > > > > This isn't really the issue. The issue is that one cannot tell whether > > it's giving you an accurate answer unless you already know what the > > answer is, in which case it's useless anyway. > > "you" as a human being know the answer when you have the box in > front of you and know where you have installed your code. > But the system (which is booting the exact same image > from either a floppy or a CF or from the net) does not. > > _This_ is the issue. No, it is not. The issue is that even *with* your hack, the system cannot tell from whence it booted without knowing more about the system's configuration. The loader guesses better than boot2, but you still can't trust the value. I was going to rant at greater length about this whole topic, but frankly it's rather pointless. What you're asking for is a nasty hack that's useless in most configurations, but I can see why in your special case you want it. If it's added as something like machdep.guessed_bootdev, then I'll probably just barf into a bag and forget about it. I can't promise that the code won't get cleaned out at some point, but it's been quietly rotting for a few years now, so I wouldn't consider it too much of a risk. Though frankly, if you want to find out where you booted from - just go look. You're unlikely to find your boot config on more than one of your potential booted-from vectors. And unlike trusting bootdev, if you search for it, you'll find it. = Mike -- To announce that there must be no criticism of the president, or that we are to stand by the president, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public. - Theodore Roosevelt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message