updated all base packages
[hdw-linux/hdw-linux.git] / packages / base / udev / init_udev.sh
index 7528085..9596c60 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 --delimiter='/' --fields=3-`
                                $bin $CLASS &
                        fi
+                       fi
                done
        done
        return 0
@@ -46,17 +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
-       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
@@ -65,12 +63,14 @@ case "$1"
 in
        start)
                echo -n "starting udev ..."
-               echo "/sbin/udev" > /proc/sys/kernel/hotplug
+               #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