Comment 2 for bug 1352376

Revision history for this message
Jeff Lane  (bladernr) wrote :

Ok, so I ended up gutting and rewriting the script.

I needed code to handle both dmi (x86) and device-tree (armhf/arm64).

The problem is that device-tree is entirely arbitrary, so one system may not have the same device-tree nodes as another, and some don't support device-tree at all.

So, I converted the script to instead get the data from lshw as that comes on both x86 and arm systems rather than a bunch of platform dependent ID code.

lshw is at least "fairly" universal and does support both interfaces for system info. The script will return output like so:

Version: NOT FOUND
Model: Model Name
Manufacturer: Big OEM Company

We are looking for three items specifically, and if lshw doesn't provide that item, we simply return NOT FOUND.

I ran this on an x86 system that provided all three via DMI, an armhf system that provided only 1 of them and an arm64 system that provided 2 of the three. I pinged about whether it would work on Power, but that's still an unknown. We can deal with that separately if it comes to it.