diff options
author | George Hung <george.hung@quantatw.com> | 2021-01-20 16:40:31 +0300 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2021-01-22 01:17:27 +0300 |
commit | df4f8775c6b6bc4db577fab2f33027483e072b26 (patch) | |
tree | f0a56727667d5b2af4649e5382a475a7ad465371 /meta-quanta | |
parent | a6c933e024518d30123f119bd7332b383ce474a9 (diff) | |
download | openbmc-df4f8775c6b6bc4db577fab2f33027483e072b26.tar.xz |
meta-quanta: gbs: fix the config json issue
Since the fan hwmon sysfs path may change, if the hwmon path of config
json is already replaced by fan-table-init.sh, it would never change
in rw partition. Add config-sku.json to make sure the correct fan hwmon
sysfs path is replaced
(From meta-quanta rev: fb6723490cc9cbc8fd806cdd6d795e7feca4173b)
Signed-off-by: George Hung <george.hung@quantatw.com>
Change-Id: Ic4ae24f3311a1ced845b60bddf247cef6b3c1e1e
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-quanta')
-rw-r--r-- | meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config-sku.json (renamed from meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json) | 4 | ||||
-rw-r--r-- | meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh | 11 | ||||
-rw-r--r-- | meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend | 8 |
3 files changed, 14 insertions, 9 deletions
diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config-sku.json index d28a182160..f2997efd0d 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config.json +++ b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/config-sku.json @@ -1,6 +1,6 @@ { "version": "R03", - "sensors" : [ + "sensors": [ { "name": "fan0", "type": "fan", @@ -102,7 +102,7 @@ "timeout": 0 } ], - "zones" : [ + "zones": [ { "id": 0, "minThermalOutput": 0.0, diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh index 5706a73fb8..68b699e0ff 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh +++ b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control/fan-table-init.sh @@ -1,5 +1,11 @@ #!/bin/bash +FAN_TABLE_SKU_FILE="/usr/share/swampd/config-sku.json" +FAN_TABLE_FILE="/usr/share/swampd/config.json" + +# determine sku +cp $FAN_TABLE_SKU_FILE $FAN_TABLE_FILE + # wait for fan dbus mapper wait /xyz/openbmc_project/sensors/fan_tach/fan0 mapper wait /xyz/openbmc_project/sensors/fan_tach/fan1 @@ -12,9 +18,8 @@ mapper wait /xyz/openbmc_project/sensors/fan_tach/fb_fan2 # generate fan table writePath Fan_0_To_4_Hwmon="$(ls -la /sys/class/hwmon |grep pwm | head -n 1| tail -n +1|cut -d '/' -f 9)" -if [[ "$Fan_0_To_4_Hwmon" != "" ]] -then - sed -i "s/Fan_0_To_4_Hwmon/$Fan_0_To_4_Hwmon/g" /usr/share/swampd/config.json +if [[ "$Fan_0_To_4_Hwmon" != "" ]]; then + sed -i "s/Fan_0_To_4_Hwmon/$Fan_0_To_4_Hwmon/g" $FAN_TABLE_FILE fi # start read margin temp wait diff --git a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend index f87a49394d..4f21d3bcf8 100644 --- a/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend +++ b/meta-quanta/meta-gbs/recipes-phosphor/fans/phosphor-pid-control_%.bbappend @@ -1,11 +1,11 @@ FILESEXTRAPATHS_prepend_gbs := "${THISDIR}/${PN}:" -SRC_URI_append_gbs = " file://config.json" +SRC_URI_append_gbs = " file://config-sku.json" SRC_URI_append_gbs = " file://fan-table-init.sh" SRC_URI_append_gbs = " file://fan-default-speed.sh" SRC_URI_append_gbs = " file://phosphor-pid-control.service" SRC_URI_append_gbs = " file://fan-reboot-control.service" -FILES_${PN}_append_gbs = " ${datadir}/swampd/config.json" +FILES_${PN}_append_gbs = " ${datadir}/swampd/config-sku.json" FILES_${PN}_append_gbs = " ${bindir}/fan-default-speed.sh" FILES_${PN}_append_gbs = " ${bindir}/fan-table-init.sh" @@ -20,8 +20,8 @@ do_install_append_gbs() { install -m 0755 ${WORKDIR}/fan-table-init.sh ${D}/${bindir} install -d ${D}${datadir}/swampd - install -m 0644 -D ${WORKDIR}/config.json \ - ${D}${datadir}/swampd/config.json + install -m 0644 -D ${WORKDIR}/config-sku.json \ + ${D}${datadir}/swampd/config-sku.json install -d ${D}${systemd_system_unitdir} install -m 0644 ${WORKDIR}/phosphor-pid-control.service \ |