chiark / gitweb /
[PATCH] add test for ! in partition name
[elogind.git] / test / test.all
1 #! /bin/sh
2 #
3 # test.block - run udev(8) on each block device in /sys/block
4
5 if [ $# = "0" ] ; then
6         echo
7         echo "usage: $0 <action>"
8         echo "where <action> is \"add\" or \"remove\""
9         echo
10         exit 1
11 fi
12
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'
16
17 # do the block devices first
18 for i in ${SYSFSDIR}/block/*; do
19         # add each drive
20         export DEVPATH=${i#${SYSFSDIR}}
21         $BIN block
22
23         # add each partition, on each device
24         for j in $i/*; do
25                 if [ -f $j/dev ]; then
26                         export DEVPATH=${j#${SYSFSDIR}}
27                         $BIN block
28                 fi
29         done
30 done
31
32 # now all the devices in the class directories
33 for i in ${SYSFSDIR}/class/*; do
34         for j in $i/*; do
35                 if [ -f $j/dev ]; then
36                         export DEVPATH=${j#${SYSFSDIR}}
37                         CLASS=`echo ${i#${SYSFSDIR}} | cut --delimiter='/' --fields=3-`
38                         $BIN $CLASS
39                 fi
40         done
41 done