Merge branch 'linux-have-mntent' into refs/top-bases/linux-zfs-branch

This commit is contained in:
Brian Behlendorf 2010-08-16 21:11:57 -07:00
commit cb2ed434d5
1 changed files with 10 additions and 3 deletions

View File

@ -5,6 +5,13 @@
# current script enumerates each port on a bus before moving on to # current script enumerates each port on a bus before moving on to
# enumerate the next bus. # enumerate the next bus.
# #
# Every distribution, version of udev, and type of attached storage
# seems to result in slightly different formatting of the by-path
# name. For this reason you may need to adjust the parsing below
# to suit your needs. This is one of the reasons to use a custom
# /etc/zfs/zdev.conf file, it allows the by-path naming convertion
# to change and still keep the simple <channel><rank> naming.
#
CONFIG=${CONFIG:-/etc/zfs/zdev.conf} CONFIG=${CONFIG:-/etc/zfs/zdev.conf}
BUSES=( 01 02 03 ) BUSES=( 01 02 03 )
PORTS=( 4 0 ) PORTS=( 4 0 )
@ -84,7 +91,7 @@ for (( i=0, k=0; i<${#BUSES[*]}; i++ )); do
for (( j=0; j<${#PORTS[*]}; j++, k++ )); do for (( j=0; j<${#PORTS[*]}; j++, k++ )); do
printf "# %-9s" ${CHANNELS[$k]} printf "# %-9s" ${CHANNELS[$k]}
ls *:${BUSES[$i]}:*:${PORTS[$j]}* 2>/dev/null | \ ls *:${BUSES[$i]}:*:${PORTS[$j]}* 2>/dev/null | \
cut -f7 -d'-' | sort -n | tr '\n' ',' cut -f7 -d'-' | sort -u -n | tr '\n' ','
echo echo
done done
done done
@ -96,8 +103,8 @@ AWK=${AWK:-/bin/awk}
for (( i=0, k=0; i<${#BUSES[*]}; i++ )); do for (( i=0, k=0; i<${#BUSES[*]}; i++ )); do
for (( j=0; j<${#PORTS[*]}; j++, k++ )); do for (( j=0; j<${#PORTS[*]}; j++, k++ )); do
ls *:${BUSES[$i]}:*:${PORTS[$j]}* 2>/dev/null | \ ls *:${BUSES[$i]}:*:${PORTS[$j]}* 2>/dev/null | \
sort -n -k7 -t'-'>${TMP_FILE} grep -v part | sort -n -k7 -t'-'>${TMP_FILE}
echo echo
echo -n "# Channel ${CHANNELS[$k]}, " echo -n "# Channel ${CHANNELS[$k]}, "