summaryrefslogtreecommitdiffstats
path: root/meta-ibm/meta-witherspoon/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
diff options
context:
space:
mode:
authorTom Joseph <tomjoseph@in.ibm.com>2018-09-24 07:34:14 -0500
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-09-26 13:25:35 -0400
commit6c09f7a1614f67835e46c088cd2061e41d1e1903 (patch)
tree48c314c6cbb63124be082e92d00a016c75873953 /meta-ibm/meta-witherspoon/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
parentfe3486b5fd44de0aa55fd76a088a6ae6263ffedc (diff)
downloadtalos-openbmc-6c09f7a1614f67835e46c088cd2061e41d1e1903.tar.gz
talos-openbmc-6c09f7a1614f67835e46c088cd2061e41d1e1903.zip
phosphor-ipmi-config: Refactor phosphor-ipmi-config provider
The phopshor-ipmi-config provider witherspoon-ipmi-config is removed to use the default configuration files. cipher_list.json and dcmi_cap.json for the witherspoon is the same as the default configuration file. dcmi_sensors.json, dev_id.json and power_reading.json is specific to witherspoon. do_patch populates the aux field in dev_id.json for witherspoon. (From meta-ibm rev: 5e794ec57243fd8aced04118d8f9fc90a5bbd3a4) Change-Id: Icd355780524b6104f89390dbe0017d2c667e963c Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com> Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-ibm/meta-witherspoon/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend')
-rw-r--r--meta-ibm/meta-witherspoon/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend44
1 files changed, 44 insertions, 0 deletions
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend b/meta-ibm/meta-witherspoon/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
new file mode 100644
index 000000000..8445c835a
--- /dev/null
+++ b/meta-ibm/meta-witherspoon/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
@@ -0,0 +1,44 @@
+FILESEXTRAPATHS_prepend_witherspoon := "${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() {
+ 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)
+}
OpenPOWER on IntegriCloud