From e161514219e0dc8a957dabbb8529fb9fcac4e115 Mon Sep 17 00:00:00 2001 From: Brad Bishop Date: Wed, 22 Apr 2020 14:06:02 -0400 Subject: meta-ibm: move all meta-witherspoon metadata The metadata common to all IBM systems is confusingly split between meta-ibm and meta-witherspoon. Move everything to meta-ibm. The meta-ibm README is re-written to more accurately reflect the scope of the layer. Allow the configuration samples (bblayers.conf.sample, local.conf.sample) to be sourced from either meta-ibm or meta-witherspoon until such a time that any workflows and tooling have had the opportunity to move to meta-ibm. (From meta-ibm rev: 6e05ef2e90b214eaf4e43ee7027bbbb1d8d09442) Change-Id: I3ec890d5300f9649c974ea6b9dca93a2e8a889ab Signed-off-by: Brad Bishop Signed-off-by: Andrew Geissler --- .../ipmi/phosphor-ipmi-config.bbappend | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend (limited to 'meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend') diff --git a/meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend b/meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend new file mode 100644 index 0000000000..e3e5002bbb --- /dev/null +++ b/meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend @@ -0,0 +1,44 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +# Calculate the auxiliary firmware revision to be updated in the dev_id.json +# file. It is calculated from the VERSION_ID field which currently has two +# formats. The revision field is 4 bytes, the first two bytes represent the +# count of commits from the tagging and next two bytes represent the version. +# Both fields are represented in BCD encoded format, so 9999 is the maximum +# value both fields can take. With the format "v2.1-216-ga78ace8", Petitboot +# would display the firmware revision as "Firmware version: 2.01.02160000", +# "0216" is count and the revision is "0000". With the format +# "ibm-v2.0-10-r41-0-gd0c319e" Petitboot would display the firmware revision +# as "Firmware version: 2.00.00100041", "0010" is count and the revision +# is "0041". +inherit image_version + +unset do_patch[noexec] +do_patch[depends] = "os-release:do_populate_sysroot" + +python do_patch_ibm-ac-server() { + import json + import re + from shutil import copyfile + version_id = do_get_version(d) + + # count from the commit version + count = re.findall("-(\d{1,4})-", version_id) + + release = re.findall("-r(\d{1,4})", version_id) + if release: + auxVer = count[0] + "{0:0>4}".format(release[0]) + else: + auxVer = count[0] + "0000" + + workdir = d.getVar('WORKDIR', True) + file = os.path.join(workdir, 'dev_id.json') + + # Update dev_id.json with the auxiliary firmware revision + with open(file, "r+") as jsonFile: + data = json.load(jsonFile) + jsonFile.seek(0) + jsonFile.truncate() + data["aux"] = int(auxVer, 16) + json.dump(data, jsonFile) +} -- cgit v1.2.3