udev, openssh fixes
[hdw-linux/hdw-linux.git] / packages / base / udev / init_udev.sh
index cc924df..e3cf08e 100644 (file)
@@ -29,12 +29,16 @@ run_udev()  {
        # 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 --delimeter='/' --fields=3-`
+                                       cut --delimiter='/' --fields=3-`
                                $bin $CLASS &
                        fi
+                       fi
                done
        done
        return 0
@@ -46,14 +50,11 @@ add_nodes() {
        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
-       mkdir $udev_root/shm
 }
 
 # delete them when shutting down (not used right now)
 del_nodes()    {
-       rm $udev_root/{fd,stdin,stdout,stderr,core}
+       rm -rf $udev_root/{fd,stdin,stdout,stderr,core}
 }
 
 # main procedures
@@ -62,19 +63,20 @@ case "$1"
 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"
-               touch /var/lock/subsys/udev
                ;;
        stop)
                echo -n "stopping udev ..."
@@ -82,7 +84,6 @@ in
                run_udev
                del_nodes
                echo " done"
-               rm /var/lock/subsys/udev
                ;;
        restart)
                /etc/init.d/udev stop