Perform a readlink on the device name if path is /dev/disk/by-id...
See Oracle bug 24487.
Change-Id: I964b224d764677d60064901f4238ae77b9cfb5ea
Signed-off-by: Wally Wang <wang@cray.com>
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1120
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Li Wei <liwei@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
fi
for d in $scsidevs; do
- devs[$i]=`sg_map | awk "{if (\\\$2 == \"$d\") print \\\$1}"`
+ if [[ -L "$d" ]]; then
+ echo "Device $d specified by alias. Will 'readlink' for device name"
+ d=$(readlink -f $d)
+ fi
+ devs[$i]=`sg_map | awk "{if (\\\$2 == \"$d\") print \\\$1}"`
if [ -z "${devs[i]}" ]; then
echo "Can't find SG device for $d, testing for partition"
pt=`echo $d | sed 's/[0-9]*$//'`