chiark / gitweb /
[PATCH] take out & from wait_for_sysfs_test that I previously missed.
[elogind.git] / test / wait_for_sysfs_test.sh
1 #! /bin/sh
2 #
3
4 # Check for missing binaries (stale symlinks should not happen)
5 UDEV_BIN=../wait_for_sysfs
6 test -x $UDEV_BIN || exit 5
7
8 # Directory where sysfs is mounted
9 SYSFS_DIR=/sys
10
11 run_udev () {
12         # handle block devices and their partitions
13         for i in ${SYSFS_DIR}/block/*; do
14                 # add each drive
15                 export DEVPATH=${i#${SYSFS_DIR}}
16                 $UDEV_BIN block
17
18                 # add each partition, on each device
19                 for j in $i/*; do
20                         if [ -f $j/dev ]; then
21                                 export DEVPATH=${j#${SYSFS_DIR}}
22                                 $UDEV_BIN block
23                         fi
24                 done
25         done
26         # all other device classes
27         for i in ${SYSFS_DIR}/class/*; do
28                 for j in $i/*; do
29 #                       if [ -f $j/dev ]; then
30                                 export DEVPATH=${j#${SYSFS_DIR}}
31                                 CLASS=`echo ${i#${SYSFS_DIR}} | \
32                                         cut --delimiter='/' --fields=3-`
33                                 $UDEV_BIN $CLASS
34 #                       fi
35                 done
36         done
37 }
38
39 export ACTION=add
40 run_udev