From 07382e87e7273836322e0c3abf617bb0b08c2ea1 Mon Sep 17 00:00:00 2001 From: Lei YU Date: Tue, 15 Dec 2020 16:48:41 +0800 Subject: bytedance: g220a: Add virtual-sensor package Add phosphor-virtual-sensor pakcage and configure it to enable "total_power" sensor that is the sum of PSU0/1's input power. Tested: Verify the Total_Power sensor is on DBus and the value is the sum or PSU0 and PSU1's input power. Signed-off-by: Lei YU Change-Id: Ie8f61800299bef01a8bb74256c24d1f0a90df258 --- .../images/obmc-phosphor-image.bbappend | 1 + .../virtual_sensor_config.json | 32 ++++++++++++++++++++++ .../sensors/phosphor-virtual-sensor_%.bbappend | 8 ++++++ 3 files changed, 41 insertions(+) create mode 100644 meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json create mode 100644 meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend (limited to 'meta-bytedance') diff --git a/meta-bytedance/meta-g220a/recipes-phosphor/images/obmc-phosphor-image.bbappend b/meta-bytedance/meta-g220a/recipes-phosphor/images/obmc-phosphor-image.bbappend index 6369a8311..038e65ec8 100644 --- a/meta-bytedance/meta-g220a/recipes-phosphor/images/obmc-phosphor-image.bbappend +++ b/meta-bytedance/meta-g220a/recipes-phosphor/images/obmc-phosphor-image.bbappend @@ -3,4 +3,5 @@ OBMC_IMAGE_EXTRA_INSTALL:append:g220a = " \ me-time-sync \ static-mac-addr \ phosphor-node-manager-proxy \ + phosphor-virtual-sensor \ " diff --git a/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json b/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json new file mode 100644 index 000000000..0aacc030f --- /dev/null +++ b/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor/virtual_sensor_config.json @@ -0,0 +1,32 @@ +[ + { + "Desc": + { + "Name": "total_power", + "SensorType": "power" + }, + "Params": + { + "DbusParam": + [ + { + "ParamName": "T0", + "Desc": + { + "Name": "PSU0_Input_Power", + "SensorType": "power" + } + }, + { + "ParamName": "T1", + "Desc": + { + "Name": "PSU1_Input_Power", + "SensorType": "power" + } + } + ] + }, + "Expression": "T0 + T1" + } +] diff --git a/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend b/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend new file mode 100644 index 000000000..9c853669f --- /dev/null +++ b/meta-bytedance/meta-g220a/recipes-phosphor/sensors/phosphor-virtual-sensor_%.bbappend @@ -0,0 +1,8 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" +SRC_URI += " \ + file://virtual_sensor_config.json \ +" + +do_install:append() { + install -m 0644 -D ${WORKDIR}/virtual_sensor_config.json ${D}${datadir}/phosphor-virtual-sensor/ +} -- cgit v1.2.3