3 # Copyright (c) 2004 Marco d'Itri <md@linux.it>
4 # Copyright (c) 2004 Piotr Roszatycki <dexter@debian.org>
7 # KERNEL="cciss!*", PROGRAM="/etc/udev/scripts/raid-devfs.sh %k", NAME="%c{1}", SYMLINK="%k"
8 # KERNEL="ida!*", PROGRAM="/etc/udev/scripts/raid-devfs.sh %k", NAME="%c{1}", SYMLINK="%k"
9 # KERNEL="rd!*", PROGRAM="/etc/udev/scripts/raid-devfs.sh %k", NAME="%c{1}", SYMLINK="%k"
11 get_dev_number_cciss() {
12 grep '^cciss/' /proc/driver/cciss/* | cat -n | \
13 sed -n "/cciss\/$1:/s/cciss.*//p"
16 get_dev_number_ida() {
17 grep '^ida/' /proc/driver/cpqarray/* | cat -n | \
18 sed -n "/ida\/$1:/s/ida.*//p"
22 grep '^ */dev/rd/' /proc/rd/*/initial_status | cat -n | \
23 sed -n "/rd\/$1:/s/\/dev\/rd.*//p"
28 num=$(eval $(echo get_dev_number_$TYPE $dev))
36 # abort if there was no match
37 [ "$TYPE" != "$1" ] || exit 1
41 LONG_NAME=disc$(get_dev_number ${NAME%%p*})/part${NAME##*p}
44 LONG_NAME=disc$(get_dev_number $NAME)/disc
48 echo "$TYPE/$LONG_NAME"