aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorAndreas Buschmann <[email protected]>2015-08-19 13:01:40 +0200
committerBrian Behlendorf <[email protected]>2015-08-30 10:03:56 -0700
commitbba365cfc810161cf63b6e07100b7a6bd082ee6d (patch)
treed8ed55c3f3d943843e9a92f77e08f213f92a4790 /cmd
parentd439f63ff5ebc3ce0c96e8a284e9c642c4b7663c (diff)
Add extra keyword 'slot' to vdev_id.conf
Add new keyword 'slot' to vdev_id.conf This selects from where to get the slot number for a SAS/SATA disk Needed to enable access to the physical position of a disk in a Supermicro 2027R-AR24NV . Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Ned Bass <[email protected]> Closes #3693
Diffstat (limited to 'cmd')
-rwxr-xr-xcmd/vdev_id/vdev_id27
1 files changed, 26 insertions, 1 deletions
diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id
index 6fddd12f3..0d617a803 100755
--- a/cmd/vdev_id/vdev_id
+++ b/cmd/vdev_id/vdev_id
@@ -32,6 +32,7 @@
# multipath no
# topology sas_direct
# phys_per_port 4
+# slot bay
#
# # PCI_ID HBA PORT CHANNEL NAME
# channel 85:00.0 1 A
@@ -93,6 +94,7 @@ PHYS_PER_PORT=
DEV=
MULTIPATH=
TOPOLOGY=
+BAY=
usage() {
cat << EOF
@@ -252,7 +254,25 @@ sas_handler() {
i=$(($i + 1))
done
- SLOT=`cat $end_device_dir/bay_identifier 2>/dev/null`
+ SLOT=
+ case $BAY in
+ "bay")
+ SLOT=`cat $end_device_dir/bay_identifier 2>/dev/null`
+ ;;
+ "phy")
+ SLOT=`cat $end_device_dir/phy_identifier 2>/dev/null`
+ ;;
+ "id")
+ i=$(($i + 1))
+ d=$(eval echo \${$i})
+ SLOT=`echo $d | sed -e 's/^.*://'`
+ ;;
+ "lun")
+ i=$(($i + 2))
+ d=$(eval echo \${$i})
+ SLOT=`echo $d | sed -e 's/^.*://'`
+ ;;
+ esac
if [ -z "$SLOT" ] ; then
return
fi
@@ -356,10 +376,15 @@ if [ -z "$TOPOLOGY" ] ; then
TOPOLOGY=`awk "\\$1 == \"topology\" {print \\$2; exit}" $CONFIG`
fi
+if [ -z "$BAY" ] ; then
+ BAY=`awk "\\$1 == \"slot\" {print \\$2; exit}" $CONFIG`
+fi
+
# First check if an alias was defined for this device.
ID_VDEV=`alias_handler`
if [ -z "$ID_VDEV" ] ; then
+ BAY=${BAY:-bay}
TOPOLOGY=${TOPOLOGY:-sas_direct}
case $TOPOLOGY in
sas_direct|sas_switch)