forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Mellanox]Update the hw-mgmt patch for simx on V.7.0000.2308 #22
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
54 changes: 27 additions & 27 deletions
54
platform/mellanox/hw-management/0001-Make-hw-mgmt-SimX-compatiable.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,53 @@ | ||
From 051938b7c49cc18aaddd699939353f591554d635 Mon Sep 17 00:00:00 2001 | ||
From: Mykola Faryma <mykolaf@mellanox.com> | ||
Date: Wed, 3 Apr 2019 14:09:26 +0000 | ||
From c6ee8c86c35f8b1e60bf4df0d7198f349f8552c1 Mon Sep 17 00:00:00 2001 | ||
From: Stephen Sun <stephens@mellanox.com> | ||
Date: Wed, 25 Dec 2019 19:33:17 +0800 | ||
Subject: [PATCH] Make hw-mgmt SimX compatiable. | ||
|
||
Signed-off-by: Mykola Faryma <mykolaf@mellanox.com> | ||
Signed-off-by: Stephen Sun <stephens@mellanox.com> | ||
--- | ||
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 fdb3013..68da9bc 100755 | ||
index cff10fe..0511c7c 100755 | ||
--- a/usr/usr/bin/hw-management.sh | ||
+++ b/usr/usr/bin/hw-management.sh | ||
@@ -646,6 +646,35 @@ do_chip_down() | ||
@@ -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 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" | ||
+ 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 | ||
+ 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/chassis_vendor)" = "QEMU" ]]; then | ||
+ handle_simx | ||
+ exit 0 | ||
+ handle_simx | ||
+ exit 0 | ||
+fi | ||
+ | ||
case $ACTION in | ||
start) | ||
do_start | ||
if [ -d /var/run/hw-management ]; then | ||
-- | ||
1.9.1 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like there are lots of changes but it is in the tab size. it is hard to review only the relevant changes. can you please have a PR with the real fixes only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have a patch in sonic on hw-mgmt from several months before. during this time even though the hw-mgnt has been updated for several versions the patch is still able to be applied. this is because the hw-mgmt code around the patch hasn't been changed across the versions. (/usr/bin/hw-management.sh do_chip_down)
however, from the V.7.0000.2308 there is some code change in that part, which fails the patch from being applied.
So what I did is just to fix the conflicts and re-generate the patch file.