Re: Machinfo struct?

2018-12-21 Thread Don NetBSD

On 12/19/2018 10:58 AM, Rocky Hotas wrote:


Is there a struct/XML somewhere that describes the hardware
in the machine much like parsing dmesg might?  I.e., to
ensure the "current" state hasn't changed from a "desired"
state?  (boards removed/added, memory complement altered,
etc.)


You almost surely already know it, but anyway, from a root
shell:

drvctl -lt mainbus0

will produce a tree based on the configuration shown in dmesg.
It is a very elementary information, plain/text and not XML.
However, maybe you could do some scripting to compare this
tree with a previously stored one, and then detect the
possible changes between them.


Yes, but I'm looking to do this before init(8) is even invoked...
sometime just after the kernel has finished probing everything
but before it passes control to init(8) -- so the boot will be
unconditionally (and unavoidably) *aborted* if the hardware isn't
"as it should be".


Re: Machinfo struct?

2018-12-19 Thread Rocky Hotas
> Sent: Saturday, December 01, 2018 at 7:59 PM
> From: "Don NetBSD" 
> To: "NetBSD Users Mailing List" 
> Subject: Machinfo struct?
>
> Is there a struct/XML somewhere that describes the hardware
> in the machine much like parsing dmesg might?  I.e., to
> ensure the "current" state hasn't changed from a "desired"
> state?  (boards removed/added, memory complement altered,
> etc.)

You almost surely already know it, but anyway, from a root
shell:

drvctl -lt mainbus0

will produce a tree based on the configuration shown in dmesg.
It is a very elementary information, plain/text and not XML.
However, maybe you could do some scripting to compare this
tree with a previously stored one, and then detect the
possible changes between them.

Rocky


Machinfo struct?

2018-12-01 Thread Don NetBSD

Is there a struct/XML somewhere that describes the hardware
in the machine much like parsing dmesg might?  I.e., to
ensure the "current" state hasn't changed from a "desired"
state?  (boards removed/added, memory complement altered,
etc.)