Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Jun 2014 21:11:05 -0500
From:      CyberLeo Kitsana <cyberleo@cyberleo.net>
To:        "questions@freebsd.org" <questions@freebsd.org>,  paul beard <paulbeard@gmail.com>
Subject:   Re: what should uname -v be telling me here?
Message-ID:  <53AF75B9.6060107@cyberleo.net>
In-Reply-To: <44y4wi3v5x.fsf@be-well.ilk.org>
References:  <CAMtcK2rBDWwu1=4DbKGB_4kDdi5Fz9Mq3%2Bzf_Ph9jTmrCLZpSg@mail.gmail.com> <44lhsi5ugm.fsf@be-well.ilk.org> <CAMtcK2rZzJPaWBnuZ6s2iZyg4_XjE62JBFTo=iUd%2BT_r4_zoew@mail.gmail.com> <20140627223650.25210a53.freebsd@edvax.de> <CAMtcK2rh3tSF6brU_JxA1%2Btzzuv8SsEoHf_oxAhcW95NRRpKjQ@mail.gmail.com> <44y4wi3v5x.fsf@be-well.ilk.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 06/27/2014 04:22 PM, Lowell Gilbert wrote:
> paul beard <paulbeard@gmail.com> writes:
> 
>> On Fri, Jun 27, 2014 at 1:36 PM, Polytropon <freebsd@edvax.de> wrote:
>>> You need to find out where /boot resides (in my case,
>>> it's on ad4s1a, which is mounted at /) to identify the boot
>>> device (or to be precise, the device the kernel has been read
>>> from).
>>
>>
>> I keep thinking this should be something you ought to be able to
>> discover without being on console. I realize the BIOS can't be
>> interrogated but if I knew that the active kernel was ad3:/boot/kernel
>> or ad2:/boot/kernel, it would be useful. Kind of surprised that
>> doesn't appear anywhere in dmesg or that it can't be read out of
>> somewhere.
> 
> The boot procedure has to load and boot the kernel without having the
> kernel available to create the device nomenclature. [Kind of obvious,
> if you think about it.] So interrogating the firmware is the only way
> the kernel *could* know where it was booted from. That's impossible 
> in the BIOS world, and even if there were a table indicating it in an
> ACPI table, that would only tell you which disk the bootloader came
> from, which isn't necessarily where the kernel came from.

Another bit of information is available if you peek at what loader(8)
told the kernel, via kenv(1).

>From a box booting UFS:
----8<----
# kenv
...
currdev="disk0s4a:"
loaddev="disk0s4a:"
kernelname="/boot/10.0p6-GENERIC/kernel"
...
----8<----

And from one booting ZFS:
----8<----
# kenv
...
currdev="zfs:paka/root/10.0:"
loaddev="zfs:paka/root/10.0:"
kernelname="/boot/10.0p6-PAKA/kernel"
...
----8<----

-- 
Fuzzy love,
-CyberLeo
Technical Administrator
CyberLeo.Net Webhosting
http://www.CyberLeo.Net
<CyberLeo@CyberLeo.Net>

Furry Peace! - http://www.fur.com/peace/



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