Check Petitboot version from user-space

Javier Martinez Canillas javierm at redhat.com
Wed May 23 21:05:58 AEST 2018


Hi all,

I would like to know if a given feature is supported by the installed firmware,
so I want to check what's the Petitboot version in the OPAL skiroot initrd. But
it's not clear to me what's the best approach to do that.

Skiboot documents a /sys/firmware/devicetree/base/ibm,firmware-versions OF node
that should contain this information [0]. But says that it is only required for
Power9 and that it may or may not be present on Power8 machines.

Most of the doc also talks about a single version OF property that encodes all
the information in a single string where each part is separated by a '-' char.

It also refers to two different specifications for the ibm,firmware-versions OF
node, a "New style" that only contains the mentioned single version property and
a "Old style" that instead of using '-' as separator, have different properties.

In a Power9 machine I see sysfs entries for the Old style ibm,firmware-versions:

# ls /sys/firmware/devicetree/base/ibm,firmware-versions
hostboot  linux  machine-xml  name  occ  open-power  petitboot  phandle  sbe  skiboot

# cat /sys/firmware/devicetree/base/ibm,firmware-versions/skiboot 
v5.9-rc5-p104faa4

# cat /sys/firmware/devicetree/base/ibm,firmware-versions/petitboot 
v1.6.1-pd8c7a0a

So I've some questions about this:

1. Should I check for both? Or should I check for one or the other depending on
   a given /sys/firmware/devicetree/base/ibm,firmware-versions/skiboot version?
   Since the skiboot property is present in both the Old and New style, that
   should tell me which style is supposed to be used? What's the skiboot version
   where the ibm,firmware-versions style changed?

2. What should I do for Power8 machines? The only OF field I've found is version
   under the ibm,opal node:

   # cd /sys/firmware/devicetree/base/ibm,opal/firmware && lsprop version
   version          "skiboot-5.1.18"

   Should I check for the skiboot version and infer the Petitboot version from it?

[0]: http://open-power.github.io/skiboot/doc/device-tree/ibm,firmware-versions.html

Best regards,
-- 
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat


More information about the Petitboot mailing list