# all other devices
for i in ${sysfs_dir}/class/*; do
for j in $i/*; do
+ # cruel hack to not del /dev/null
+ if [ "$j" != "${sysfs_dir}/class/mem/null" -o \
+ "$ACTION" != "remove" ] ; then
if [ -f $j/dev ]; then
export DEVPATH=${j#${sysfs_dir}}
CLASS=`echo ${i#${sysfs_dir}} | \
cut --delimiter='/' --fields=3-`
$bin $CLASS &
fi
+ fi
done
done
return 0
ln -snf /proc/self/fd/1 $udev_root/stdout
ln -snf /proc/self/fd/2 $udev_root/stderr
ln -snf /proc/kcore $udev_root/core
- mkdir $udev_root/pts
- mount $udev_root/pts
- mkdir $udev_root/shm
- mount $udev_root/shm
}
# delete them when shutting down (not used right now)
del_nodes() {
- umount $udev_root/shm
- umount $udev_root/pts
- rm -rf $udev_root/{fd,stdin,stdout,stderr,core,pts,shm}
+ rm -rf $udev_root/{fd,stdin,stdout,stderr,core}
}
# main procedures
in
start)
echo -n "starting udev ..."
- echo "/sbin/udev" > /proc/sys/kernel/hotplug
if [ ! -d $sysfs_dir/block ] ; then
echo "fatal: sysfs not mounted"
exit 1
fi
rm -f $udev_root/.udev.tdb
+ [ ! -c ${udev_root}/null ] && \
+ mknod -m 0660 ${udev_root}/null c 1 3
export ACTION=add
export UDEV_NO_SLEEP=1
- run_udev
+ #run_udev
+ /sbin/udevstart
add_nodes
$udevd &
echo " done"