2021-04-28 08:21:55 -05:00
|
|
|
From 5858f60aa5948a502ca8a1c9357ac81baa6f68dc Mon Sep 17 00:00:00 2001
|
|
|
|
From: junchao <junchao@nvidia.com>
|
|
|
|
Date: Fri, 23 Apr 2021 09:27:43 +0800
|
|
|
|
Subject: [PATCH] Make hw-mgmt SimX compatible
|
|
|
|
|
|
|
|
---
|
|
|
|
usr/usr/bin/hw-management-ready.sh | 11 +++++++----
|
|
|
|
usr/usr/bin/hw-management.sh | 9 +++++++++
|
|
|
|
2 files changed, 16 insertions(+), 4 deletions(-)
|
|
|
|
|
2021-02-25 04:41:29 -06:00
|
|
|
diff --git a/usr/usr/bin/hw-management-ready.sh b/usr/usr/bin/hw-management-ready.sh
|
|
|
|
index 3c9f7b6..05d143f 100755
|
|
|
|
--- a/usr/usr/bin/hw-management-ready.sh
|
|
|
|
+++ b/usr/usr/bin/hw-management-ready.sh
|
|
|
|
@@ -49,9 +49,12 @@ if [ -d /var/run/hw-management ]; then
|
|
|
|
rm -fr /var/run/hw-management
|
|
|
|
fi
|
|
|
|
|
|
|
|
-while [ ! -d /sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon ]
|
|
|
|
-do
|
|
|
|
- sleep 1
|
|
|
|
-done
|
|
|
|
+if [ -z "$(lspci -vvv | grep SimX)" ]; then
|
|
|
|
+ while [ ! -d /sys/devices/platform/mlxplat/mlxreg-hotplug/hwmon ]
|
|
|
|
+ do
|
|
|
|
+ sleep 1
|
|
|
|
+ done
|
|
|
|
+fi
|
|
|
|
+
|
|
|
|
echo "Start Chassis HW management service."
|
|
|
|
logger -t hw-management -p daemon.notice "Start Chassis HW management service."
|
|
|
|
diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh
|
2021-04-28 08:21:55 -05:00
|
|
|
index 991cf45..16ad0bf 100755
|
2021-02-25 04:41:29 -06:00
|
|
|
--- a/usr/usr/bin/hw-management.sh
|
|
|
|
+++ b/usr/usr/bin/hw-management.sh
|
2021-04-28 08:21:55 -05:00
|
|
|
@@ -1265,6 +1265,13 @@ do_chip_down()
|
2021-02-25 04:41:29 -06:00
|
|
|
/usr/bin/hw-management-thermal-events.sh change hotplug_asic down %S %p
|
|
|
|
}
|
|
|
|
|
|
|
|
+check_simx()
|
|
|
|
+{
|
|
|
|
+ if [ -n "$(lspci -vvv | grep SimX)" ]; then
|
|
|
|
+ exit 0
|
|
|
|
+ fi
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
__usage="
|
2021-04-28 08:21:55 -05:00
|
|
|
Usage: $(basename "$0") [Options]
|
2021-02-25 04:41:29 -06:00
|
|
|
|
2021-04-28 08:21:55 -05:00
|
|
|
@@ -1290,6 +1297,8 @@ Options:
|
2021-02-25 04:41:29 -06:00
|
|
|
force-reload Performs hw-management 'stop' and the 'start.
|
|
|
|
"
|
|
|
|
|
|
|
|
+check_simx
|
|
|
|
+
|
|
|
|
case $ACTION in
|
|
|
|
start)
|
|
|
|
if [ -d /var/run/hw-management ]; then
|
2021-04-28 08:21:55 -05:00
|
|
|
--
|
|
|
|
1.9.1
|
|
|
|
|