From: Brian K. <br...@li...> - 2009-07-30 19:39:49
|
The OpenFirmware binding for Fibre Channel devices permits any leading zeros in the LUN field to be stripped, but does not require it. Fix ofpathname to handle this case when translating OF pathname to logical device name. Signed-off-by: Brian King <br...@li...> --- scripts/ofpathname | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff -puN scripts/ofpathname~ofpathname_fc_strip_fix scripts/ofpathname --- powerpc-utils/scripts/ofpathname~ofpathname_fc_strip_fix 2009-07-30 13:41:44.000000000 -0500 +++ powerpc-utils-bjking1/scripts/ofpathname 2009-07-30 14:37:18.000000000 -0500 @@ -921,10 +921,14 @@ of2l_fc() local fc_lun=`get_fc_scsilun $LUN` local wwpn=`get_fc_wwpn "$device_path/fc_remote_ports*"` + let stripped_lun=`echo "10#$fc_lun"` + let stripped_oflun=`echo "10#$OF_LUN"` - if [[ $fc_lun = $OF_LUN && $wwpn = $OF_WWPN ]]; then - LOGICAL_DEVNAME="${dir##*/}" - return + if [[ $wwpn = $OF_WWPN ]]; then + if [[ $fc_lun = $OF_LUN || $stripped_lun = $stripped_oflun ]]; then + LOGICAL_DEVNAME="${dir##*/}" + return + fi fi done } _ |