NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Machinfo struct?



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".


Home | Main Index | Thread Index | Old Index