This repository has been archived on 2025-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
sonic-buildimage/platform/mellanox/hw-management/0002-make-hw-mgmt-SimX-compatiable.patch
Mykola F 1aa258d3cb [fw-upgrade] fix issue with fw-upgrade (#2785)
Signed-off-by: Mykola Faryma <mykolaf@mellanox.com>
2019-04-16 10:06:10 -07:00

45 lines
1.3 KiB
Diff

From 2fef49112421ec875029d005069495bca77ab4a3 Mon Sep 17 00:00:00 2001
From: Mykola Faryma <mykolaf@mellanox.com>
Date: Wed, 3 Apr 2019 14:09:26 +0000
Subject: [PATCH 2/2] make hw-mgmt SimX compatiable
Signed-off-by: Mykola Faryma <mykolaf@mellanox.com>
---
usr/usr/bin/hw-management.sh | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/usr/usr/bin/hw-management.sh b/usr/usr/bin/hw-management.sh
index c8261a3..bb27493 100755
--- a/usr/usr/bin/hw-management.sh
+++ b/usr/usr/bin/hw-management.sh
@@ -644,6 +644,26 @@ do_chip_down()
/usr/bin/hw-management-thermal-events.sh change hotplug_asic down %S %p
}
+handle_simx()
+{
+ ONIE_PLATFORM=$(cat /host/machine.conf | grep onie_platform | cut -d= -f2)
+ case $ACTION in
+ start)
+ /bin/bash -c "/bin/rm -f /var/cache/sonic/decode-syseeprom/syseeprom_cache"
+ /bin/bash -c "/bin/mkdir -p /var/run/hw-management/eeprom"
+ /bin/bash -c "/usr/bin/xxd -r -p /usr/share/sonic/device/${ONIE_PLATFORM}/syseeprom.hex /var/run/hw-management/eeprom/vpd_info"
+ ;;
+ stop)
+ /bin/bash -c "/bin/rm -fr /var/run/hw-management"
+ ;;
+ esac
+}
+
+if [[ $(cat /sys/devices/virtual/dmi/id/chassis_vendor) = "QEMU" ]]; then
+ handle_simx
+ exit 0
+fi
+
case $ACTION in
start)
do_start
--
1.9.1