Subject: Re: using eeprom to find out how to reboot ?
To: Robert Elz <kre@munnari.OZ.AU>
From: Darren Reed <darrenr@reed.wattle.id.au>
List: port-sparc
Date: 11/06/2001 21:04:13
In some email I received from Robert Elz, sie wrote:
> Date: Tue, 6 Nov 2001 20:23:29 +1100 (EST)
> From: Darren Reed <darrenr@reed.wattle.id.au>
> Message-ID: <200111060923.UAA21220@avalon.reed.wattle.id.au>
>
> | > > it won't boot back into netbsd on a
> | > > reboot/crash.
>
> After a crash, the only info that is available to be used is what is
> in the prom. So, if you want to reboot to your current system, then
> you have to put the boot info for it there.
>
> | > > Is it possible to look in the eeprom/ofw to find out the path we booted
> | > > from and pass that back with reboot ?
>
> The former part is possible, more than that, necessary - that's how NetBSD
> finds the correct root partition in the first place.
>
> I don't think that the info is currently exported, but it probably
> should be (via sysctl to machdep.booted_device or something - just like
> machdep.booted_kernel)
>
> Then, rather than altering reboot to do what you want, you could
> trivially create a script that uses those sysctl variables to send
> args to reboot that you're currently doing manually (on the architectures
> where this is possible at all of course).
Yes, that'd solve the problem too.
Darren