diff options
Diffstat (limited to 'meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs.sh')
-rw-r--r-- | meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs.sh b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs.sh index b52a68bb8..e529049d5 100644 --- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs.sh +++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipes-phosphor/chassis/vcs-pre-post/ucd_disable_vcs.sh @@ -6,13 +6,17 @@ # 11/10/16 PGR - unbind/bind UCD driver ucd_retries=5 +ucd= # unbind ucd driver to permit i2cset ucdpath="/sys/bus/i2c/drivers/ucd9000" if [ -e $ucdpath ] then - ucd=`ls $ucdpath | grep 64` - echo $ucd > $ucdpath/unbind + ucd=`ls -1 $ucdpath | grep 64` + if [ -n "$ucd" ] + then + echo $ucd > $ucdpath/unbind + fi fi # Setup UCD module (in standby) to disable VCS rails from power-on: @@ -28,8 +32,8 @@ i2cset -y 11 0x64 0x02 0x1A i i2cset -y 11 0x64 0x00 0x0F i i2cset -y 11 0x64 0x02 0x1A i -# re-bind ucd driver -if [ -e $ucdpath ]; then +# re-bind ucd driver only if we unbound it (i.e. ucd has been set with a value) +if [ -e $ucdpath -a -n "$ucd" ]; then j=0 until [ $j -ge $ucd_retries ] || [ -e $ucdpath/$ucd ]; do j=$((j+1)) |