chiark / gitweb /
[PATCH] udev - switch SYSFS_file to SYSFS{file}
[elogind.git] / test / test.block
index 622a66037f3d4494c3bba07e6d410e9dfdc4d04e..294c47c0beef650ab8d3c1a03620b5fd9702152e 100644 (file)
@@ -11,19 +11,18 @@ if [ $# = "0" ] ; then
 fi
 
 SYSFSDIR=/sys          # change this for a nonstand sysfs mount point
-BIN=./udev             # location of your udev binary
+BIN=../udev            # location of your udev binary
 export ACTION=$1       # 'add' or 'remove'
 
 for i in ${SYSFSDIR}/block/*; do
        # add each drive
-       export DEVPATH="/"`echo $i | cut --delimiter='/' --fields=3-`
+       export DEVPATH=${i#${SYSFSDIR}}
        $BIN block
 
        # add each partition, on each device
        for j in $i/*; do
                if [ -f $j/dev ]; then
-                       export DEVPATH="/"`echo $j |  \
-                               cut --delimiter='/' --fields=3-`
+                       export DEVPATH=${j#${SYSFSDIR}}
                        $BIN block
                fi
        done