diff options
author | greg@kroah.com <greg@kroah.com> | 2004-10-13 22:52:08 -0700 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-04-26 21:56:02 -0700 |
commit | a6150f4a8a45b0d53162b92e574f53a01d94c432 (patch) | |
tree | 371402668498cb36fe53abf7f7c0678b33872087 /test/wait_for_sysfs_test.sh | |
parent | d38c486a519b7ba2acb06d57e0335a4a09adc355 (diff) |
[PATCH] add wait_for_sysfs test script to the tarball to help people debug their boxes.
Diffstat (limited to 'test/wait_for_sysfs_test.sh')
-rw-r--r-- | test/wait_for_sysfs_test.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/wait_for_sysfs_test.sh b/test/wait_for_sysfs_test.sh new file mode 100644 index 0000000000..f299d23c94 --- /dev/null +++ b/test/wait_for_sysfs_test.sh @@ -0,0 +1,40 @@ +#! /bin/sh +# + +# Check for missing binaries (stale symlinks should not happen) +UDEV_BIN=../wait_for_sysfs +test -x $UDEV_BIN || exit 5 + +# Directory where sysfs is mounted +SYSFS_DIR=/sys + +run_udev () { + # handle block devices and their partitions + for i in ${SYSFS_DIR}/block/*; do + # add each drive + export DEVPATH=${i#${SYSFS_DIR}} + $UDEV_BIN block & + + # add each partition, on each device + for j in $i/*; do + if [ -f $j/dev ]; then + export DEVPATH=${j#${SYSFS_DIR}} + $UDEV_BIN block + fi + done + done + # all other device classes + for i in ${SYSFS_DIR}/class/*; do + for j in $i/*; do +# if [ -f $j/dev ]; then + export DEVPATH=${j#${SYSFS_DIR}} + CLASS=`echo ${i#${SYSFS_DIR}} | \ + cut --delimiter='/' --fields=3-` + $UDEV_BIN $CLASS +# fi + done + done +} + +export ACTION=add +run_udev |