- # add block devices and their partitions
- for i in ${sysfs_dir}/block/*; do
- # add each drive
- export DEVPATH=${i#${sysfs_dir}}
- $bin block
-
- # add each partition, on each device
- for j in $i/*; do
- if [ -f $j/dev ]; then
- export DEVPATH=${j#${sysfs_dir}}
- $bin block
- if [ $? -ne 0 ]; then
- echo "Warning: $DEVPATH failed."
- clean_exit="no"
- fi
- 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-`
- $bin $CLASS
- if [ $? -ne 0 ]; then
- echo "Warning: $DEVPATH failed."
- clean_exit="no"
- fi
- fi
- done
- done
- if [ $clean_exit = "yes" ]; then
- print_status success
- else
- print_status warning
- fi