Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Mar 2002 02:42:12 -0800
From:      Michael Smith <msmith@freebsd.org>
To:        Luigi Rizzo <rizzo@icir.org>
Cc:        Michael Smith <msmith@FreeBSD.ORG>, arch@FreeBSD.ORG
Subject:   Re: For review: machdep.bootdev sysctl (for i386) 
Message-ID:  <200203101042.g2AAgCj03522@mass.dis.org>
In-Reply-To: Your message of "Sun, 10 Mar 2002 02:03:43 PST." <20020310020343.J28779@iguana.icir.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 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




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