[PATCH] more init script cleanups, the stop target now calls udev to cleanup instead of just removing the whole /udev directory.
This commit is contained in:
parent
5779dd31f4
commit
18c783a7e6
|
@ -11,20 +11,8 @@ udev_dir=/udev
|
||||||
sysfs_dir=/sys
|
sysfs_dir=/sys
|
||||||
bin=/sbin/udev
|
bin=/sbin/udev
|
||||||
|
|
||||||
case "$1" in
|
run_udev () {
|
||||||
start)
|
# handle block devices and their partitions
|
||||||
if [ ! -d $udev_dir ]; then
|
|
||||||
mkdir $udev_dir
|
|
||||||
fi
|
|
||||||
if [ ! -d $sysfs_dir ]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# propogate /udev from /sys - we only need this while we do not
|
|
||||||
# have initramfs and an early user-space with which to do early
|
|
||||||
# device bring up
|
|
||||||
action "Creating initial udev device nodes: " /bin/true
|
|
||||||
export ACTION=add
|
|
||||||
# add block devices and their partitions
|
|
||||||
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}}
|
||||||
|
@ -49,14 +37,29 @@ case "$1" in
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
if [ ! -d $udev_dir ]; then
|
||||||
|
mkdir $udev_dir
|
||||||
|
fi
|
||||||
|
if [ ! -d $sysfs_dir ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
# propogate /udev from /sys - we only need this while we do not
|
||||||
|
# have initramfs and an early user-space with which to do early
|
||||||
|
# device bring up
|
||||||
|
action "Creating initial udev device nodes: " /bin/true
|
||||||
|
export ACTION=add
|
||||||
|
run_udev
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
# be careful
|
# be careful
|
||||||
action "Removing udev device nodes: " /bin/true
|
action "Removing udev device nodes: " /bin/true
|
||||||
if [ $udev_dir -a "$udev_dir" != "/" ]; then
|
export ACTION=remove
|
||||||
# clear out /udev
|
run_udev
|
||||||
rm -rf ${udev_dir}/*
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
if [ -d $udev_dir ]; then
|
if [ -d $udev_dir ]; then
|
||||||
|
|
Loading…
Reference in New Issue