Skip to content

Commit

Permalink
hw-mgmt: scripts: Fix init error fox SimX paltform
Browse files Browse the repository at this point in the history
Fix SKU/platform reading if it's not exists. This can be when running on
SimX platform.

log messages example before fix:

/usr/bin/hw-management.sh: line 61: /sys/devices/virtual/dmi/id/board_name: No such file or directory
/usr/bin/hw-management.sh: line 62: /sys/devices/virtual/dmi/id/product_sku: No such file or directory
/usr/bin/hw-management-helpers.sh: line 325: /var/run/hw-management/events/: Is a directory

Signed-off-by: Oleksandr Shamray <oleksandrs@nvidia.com>
  • Loading branch information
sholeksandr committed Aug 15, 2024
1 parent 8501e29 commit eff5cf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions usr/usr/bin/hw-management-ready.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
# Report start of hw-management service to console and logger.

source hw-management-helpers.sh
board_type=`cat /sys/devices/virtual/dmi/id/board_name`
product_sku=`cat /sys/devices/virtual/dmi/id/product_sku`
[ -f "$board_type_file" ] && board_type=$(< $board_type_file) || board_type="Unknown"
[ -f "$sku_file" ] && product_sku=$(< $sku_file) || product_sku="Unknown"

if systemctl is-active --quiet hw-management; then
echo "Error: HW management service is already active."
Expand Down
4 changes: 2 additions & 2 deletions usr/usr/bin/hw-management.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
#

source hw-management-helpers.sh
board_type=$(< $board_type_file)
sku=$(< $sku_file)
[ -f "$board_type_file" ] && board_type=$(< $board_type_file) || board_type="Unknown"
[ -f "$sku_file" ] && sku=$(< $sku_file) || sku="Unknown"
source hw-management-devtree.sh
# Local constants and variables

Expand Down

0 comments on commit eff5cf0

Please sign in to comment.