meta-quanta: olympus-nuvoton: power: update psu inventory over pmbus
According to PMBUS spec, there is an Inventory Information we can update to PSU inventory.
MFR_ID - Manufacturer
MFR_MODEL - Model
MFR_SERIAL - SerialNumber
IC_DEVICE_ID - PartNumber
redfish/v1/Chassis/chassis/Power
"PowerSupplies": [{
"@odata.id": "/redfish/v1/Chassis/chassis/Power#/PowerSupplies/0",
"Manufacturer": "FlexPower",
"MemberId": "powersupply0",
"Model": "MIS-S-1020",
"Name": "powersupply0",
"PartNumber": "FPS-213-D0000293-101",
"PowerInputWatts": 104.0,
"PowerOutputWatts": 61.5,
"SerialNumber": "MISPS1839A0A0RW",
"Status": {
"Health": "OK",
"State": "Enabled"
}}],
Tested: Verified for Olympus platform
Signed-off-by: Joseph Liu <kwliu@nuvoton.com>
Signed-off-by: Tim Lee <timlee660101@gmail.com>
Change-Id: I8284a80e6bee3742c47862a86eb08c443d9d9814
diff --git a/meta-olympus-nuvoton/recipes-olympus-nuvoton/power/first-boot-set-psu.bb b/meta-olympus-nuvoton/recipes-olympus-nuvoton/power/first-boot-set-psu.bb
new file mode 100644
index 0000000..ed9c136
--- /dev/null
+++ b/meta-olympus-nuvoton/recipes-olympus-nuvoton/power/first-boot-set-psu.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Init PSU inventory"
+DESCRIPTION = "Setup PSU inventory read from PSU"
+PR = "r1"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+inherit allarch systemd
+
+RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_base-utils}"
+RDEPENDS_${PN} += "bash"
+
+SYSTEMD_SERVICE_${PN} = "first-boot-set-psu@.service"
+SYSTEMD_SERVICE_${PN} += "first-boot-set-psu@0-2-0x58.service"
+
+SRC_URI = "file://${BPN}.sh file://${BPN}@.service"
+
+S = "${WORKDIR}"
+do_install() {
+ install -d ${D}${bindir} ${D}${systemd_system_unitdir}
+ install ${BPN}.sh ${D}${bindir}/
+ install -m 644 ${BPN}@.service ${D}${systemd_system_unitdir}/
+}