From 1cdcb2c62dc74664726e6ad2047116dcaaa05d03 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Fri, 8 May 2020 03:35:48 +0800 Subject: [PATCH] [Mellanox] Add patch to disable hw-management thermal control shell script (#4550) * [Mellanox] Add patch to disable hw-management thermal control shell script * Remove SimX patch since https://github.com/Azure/sonic-buildimage/pull/4364/files has already handle it --- ...agement-thermal-control-shell-script.patch | 28 ++++++++++ .../0001-Make-hw-mgmt-SimX-compatiable.patch | 53 ------------------- 2 files changed, 28 insertions(+), 53 deletions(-) create mode 100644 platform/mellanox/hw-management/0001-Disable-hw-management-thermal-control-shell-script.patch delete mode 100644 platform/mellanox/hw-management/0001-Make-hw-mgmt-SimX-compatiable.patch diff --git a/platform/mellanox/hw-management/0001-Disable-hw-management-thermal-control-shell-script.patch b/platform/mellanox/hw-management/0001-Disable-hw-management-thermal-control-shell-script.patch new file mode 100644 index 0000000000..eef970ed23 --- /dev/null +++ b/platform/mellanox/hw-management/0001-Disable-hw-management-thermal-control-shell-script.patch @@ -0,0 +1,28 @@ +From 3bce9e33132a86c0a53a7b0a49ee1932d65bfb7f Mon Sep 17 00:00:00 2001 +From: junchao +Date: Wed, 6 May 2020 11:37:56 +0800 +Subject: [PATCH] Disable hw-management thermal control shell script + +--- + usr/usr/bin/hw-management.sh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh +index 65e5d39..cffff7a 100755 +--- a/usr/usr/bin/hw-management.sh ++++ b/usr/usr/bin/hw-management.sh +@@ -832,7 +832,10 @@ do_start() + if [ -f $config_path/max_tachos ]; then + max_tachos=$(<$config_path/max_tachos) + fi +- $THERMAL_CONTROL $thermal_type $max_tachos $max_psus& ++ ++ # Disable thermal control shell script in hw-management ++ # because there has already been that in SONiC ++ # $THERMAL_CONTROL $thermal_type $max_tachos $max_psus& + } + + do_stop() +-- +1.9.1 + diff --git a/platform/mellanox/hw-management/0001-Make-hw-mgmt-SimX-compatiable.patch b/platform/mellanox/hw-management/0001-Make-hw-mgmt-SimX-compatiable.patch deleted file mode 100644 index ccbd6322d2..0000000000 --- a/platform/mellanox/hw-management/0001-Make-hw-mgmt-SimX-compatiable.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 6aecc8fed8cc78c1fb5c6b52bdfa3d07ca66e652 Mon Sep 17 00:00:00 2001 -From: Mykola Faryma -Date: Fri, 21 Feb 2020 12:28:54 +0200 -Subject: [PATCH 1/1] Make hw-mgmt SimX compatiable - -Signed-off-by: Mykola Faryma ---- - usr/usr/bin/hw-management.sh | 29 +++++++++++++++++++++++++++++ - 1 file changed, 29 insertions(+) - -diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh -index cff10fe..7f3c295 100755 ---- a/usr/usr/bin/hw-management.sh -+++ b/usr/usr/bin/hw-management.sh -@@ -737,6 +737,35 @@ do_chip_down() - /usr/bin/hw-management-thermal-events.sh change hotplug_asic down %S %p - } - -+handle_simx() -+{ -+ local -r onie_platform="$(cat /host/machine.conf | grep onie_platform | cut -d= -f2)" -+ -+ local -r syseeprom_cache_path="/var/cache/sonic/decode-syseeprom/syseeprom_cache" -+ local -r syseeprom_hex_path="/usr/share/sonic/device/${onie_platform}/syseeprom.hex" -+ local -r syseeprom_vpd_path="/var/run/hw-management/eeprom/vpd_info" -+ -+ case $ACTION in -+ start) -+ /bin/bash -c "/bin/rm -f ${syseeprom_cache_path}" -+ /bin/bash -c "/bin/mkdir -p ${eeprom_path}" -+ /bin/bash -c "/usr/bin/xxd -r -p ${syseeprom_hex_path} ${syseeprom_vpd_path}" -+ ;; -+ stop) -+ /bin/bash -c "/bin/rm -fr ${hw_management_path}" -+ ;; -+ *) -+ echo "Usage: `basename $0` {start|stop}" -+ exit 1 -+ ;; -+ esac -+} -+ -+if [[ "$(cat /sys/devices/virtual/dmi/id/sys_vendor)" = "QEMU" ]]; then -+ handle_simx -+ exit 0 -+fi -+ - case $ACTION in - start) - if [ -d /var/run/hw-management ]; then --- -1.9.1 -