Skip to content

Commit

Permalink
Merge commit 'refs/top-bases/linux-have-idmap' into linux-have-idmap
Browse files Browse the repository at this point in the history
  • Loading branch information
behlendorf committed Aug 17, 2010
2 parents b1a57d8 + 204ed75 commit abce06d
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cmd/zpool_layout/zpool_layout
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
# current script enumerates each port on a bus before moving on to
# 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}
BUSES=( 01 02 03 )
PORTS=( 4 0 )
Expand Down Expand Up @@ -84,7 +91,7 @@ for (( i=0, k=0; i<${#BUSES[*]}; i++ )); do
for (( j=0; j<${#PORTS[*]}; j++, k++ )); do
printf "# %-9s" ${CHANNELS[$k]}
ls *:${BUSES[$i]}:*:${PORTS[$j]}* 2>/dev/null | \
cut -f7 -d'-' | sort -n | tr '\n' ','
cut -f7 -d'-' | sort -u -n | tr '\n' ','
echo
done
done
Expand All @@ -96,8 +103,8 @@ AWK=${AWK:-/bin/awk}

for (( i=0, k=0; i<${#BUSES[*]}; i++ )); do
for (( j=0; j<${#PORTS[*]}; j++, k++ )); do
ls *:${BUSES[$i]}:*:${PORTS[$j]}* 2>/dev/null | \
sort -n -k7 -t'-'>${TMP_FILE}
ls *:${BUSES[$i]}:*:${PORTS[$j]}* 2>/dev/null | \
grep -v part | sort -n -k7 -t'-'>${TMP_FILE}

echo
echo -n "# Channel ${CHANNELS[$k]}, "
Expand Down

0 comments on commit abce06d

Please sign in to comment.