3 # test.block - run udev(8) on each block device in /sys/block
7 echo "usage: $0 <action>"
8 echo "where <action> is \"add\" or \"remove\""
13 SYSFSDIR=/sys # change this for a nonstand sysfs mount point
14 BIN=../udev # location of your udev binary
15 export ACTION=$1 # 'add' or 'remove'
17 # do the block devices first
18 for i in ${SYSFSDIR}/block/*; do
20 export DEVPATH=${i#${SYSFSDIR}}
23 # add each partition, on each device
25 if [ -f $j/dev ]; then
26 export DEVPATH=${j#${SYSFSDIR}}
32 # now all the devices in the class directories
33 for i in ${SYSFSDIR}/class/*; do
35 if [ -f $j/dev ]; then
36 export DEVPATH=${j#${SYSFSDIR}}
37 CLASS=`echo ${i#${SYSFSDIR}} | cut --delimiter='/' --fields=3-`