Check Petitboot version from user-space

Samuel Mendoza-Jonas sam at mendozajonas.com
Thu May 24 11:27:59 AEST 2018


On Wed, 2018-05-23 at 13:05 +0200, Javier Martinez Canillas wrote:
> 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.

Hi Javier,

It's been a while since I have looked at this document but I'm not sure I read
it the same way. "Old" vs "New" style mostly has to do with the format of the
version strings but I think both should be a set of properties under
"ibm,firmware-versions". The new/P9 style just enforces rules about versioning
rules.

This is the point where I'll CC Stewart in :)

But regardless behind the scenes the big split is that on P8 Hostboot put this
in the device tree and now on P9 Skiboot does it. The commit in Skiboot that
adds this is 9727fe3, "DT: Add ibm,firmware-versions node", which exists as of:
	# git describe --tag 9727fe384
	v5.8-12-g9727fe38

Additionally on FSP-based machines (Tuleta, ZZ..) this doesn't exist and finding
the relevant firmware versions is more painful - you'd likely have to match it
up against the FSP image version.

Cheers,
Sam

> 
> 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,



More information about the Petitboot mailing list