[PATCH] make udev init script run udev in the background to let startup go much faster
This commit is contained in:
parent
07562d6ecf
commit
5779dd31f4
|
@ -28,13 +28,13 @@ case "$1" in
|
||||||
for i in ${sysfs_dir}/block/*; do
|
for i in ${sysfs_dir}/block/*; do
|
||||||
# add each drive
|
# add each drive
|
||||||
export DEVPATH=${i#${sysfs_dir}}
|
export DEVPATH=${i#${sysfs_dir}}
|
||||||
$bin block
|
$bin block &
|
||||||
|
|
||||||
# add each partition, on each device
|
# add each partition, on each device
|
||||||
for j in $i/*; do
|
for j in $i/*; do
|
||||||
if [ -f $j/dev ]; then
|
if [ -f $j/dev ]; then
|
||||||
export DEVPATH=${j#${sysfs_dir}}
|
export DEVPATH=${j#${sysfs_dir}}
|
||||||
$bin block
|
$bin block &
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
@ -45,13 +45,14 @@ case "$1" in
|
||||||
export DEVPATH=${j#${sysfs_dir}}
|
export DEVPATH=${j#${sysfs_dir}}
|
||||||
CLASS=`echo ${i#${sysfs_dir}} | \
|
CLASS=`echo ${i#${sysfs_dir}} | \
|
||||||
cut --delimiter='/' --fields=3-`
|
cut --delimiter='/' --fields=3-`
|
||||||
$bin $CLASS
|
$bin $CLASS &
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
# be careful
|
# be careful
|
||||||
|
action "Removing udev device nodes: " /bin/true
|
||||||
if [ $udev_dir -a "$udev_dir" != "/" ]; then
|
if [ $udev_dir -a "$udev_dir" != "/" ]; then
|
||||||
# clear out /udev
|
# clear out /udev
|
||||||
rm -rf ${udev_dir}/*
|
rm -rf ${udev_dir}/*
|
||||||
|
|
Loading…
Reference in New Issue