diff options
author | P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com> | 2022-03-31 00:20:48 +0300 |
---|---|---|
committer | P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com> | 2022-05-06 02:21:19 +0300 |
commit | 18f97faa411078b95d042d207f5fff32bc8ece1d (patch) | |
tree | c557da2136640a8ce48439f19fe5f7071faffeca /meta-openbmc-mods/meta-common/recipes-network/network/ncsi-monitor/check-for-host-in-reset | |
parent | 2af35ee50ce9918ee3626c59f2cff62cd3ab9568 (diff) | |
download | openbmc-18f97faa411078b95d042d207f5fff32bc8ece1d.tar.xz |
Update to internal 1-0.91
Signed-off-by: P Dheeraj Srujan Kumar <p.dheeraj.srujan.kumar@intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-network/network/ncsi-monitor/check-for-host-in-reset')
-rwxr-xr-x | meta-openbmc-mods/meta-common/recipes-network/network/ncsi-monitor/check-for-host-in-reset | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-network/network/ncsi-monitor/check-for-host-in-reset b/meta-openbmc-mods/meta-common/recipes-network/network/ncsi-monitor/check-for-host-in-reset index aa17aebf2..be01092a2 100755 --- a/meta-openbmc-mods/meta-common/recipes-network/network/ncsi-monitor/check-for-host-in-reset +++ b/meta-openbmc-mods/meta-common/recipes-network/network/ncsi-monitor/check-for-host-in-reset @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # PFR Boot Time Detection # @@ -51,14 +51,20 @@ RSMRST="RSMRST_N" # Read the assertion state from the RSMRST_N input function get_rsmrst_state { local __resultVal=$1 - local gpio_state=$($GPIOGET $($GPIOFIND "$RSMRST")) + local gpioFound=$($GPIOFIND $RSMRST) + # Test to see if the RSMRST_N input exists. This test does not cover the + # case where an input is already owned by another service/process. + if [ -z "$gpioFound" ] + then + return 1 + fi + local gpio_state=$($GPIOGET $gpioFound) eval $__resultVal="'$gpio_state'" return 0 } get_rsmrst_state rsmrst_val - -if [ "$rsmrst_val" -eq 0 ] +if [[ $? == 0 && $rsmrst_val -eq 0 ]] then echo "RSMRST_N is asserted, take eth1 down" ip link set down dev eth1 |