more init fixes
authorhackbard <hackbard>
Wed, 28 Jul 2004 21:34:01 +0000 (21:34 +0000)
committerhackbard <hackbard>
Wed, 28 Jul 2004 21:34:01 +0000 (21:34 +0000)
misc/sysfiles/etc/init.d/boot
misc/sysfiles/etc/init.d/down
misc/sysfiles/etc/initscript
packages/base/00-init-conf/00-init-conf
packages/base/udev/init_udev.sh

index 9e1a3be..7352c7e 100755 (executable)
@@ -18,6 +18,8 @@ if [ $FORCEFSCK = 1 ] ; then echo "going to force fsck" ; FASTBOOT=0 ; fi
 
 mount -v -n /dev
 mount -v -n /proc ; mount -v -n /sys
+mkdir -p /dev/shm ; mount -v -n /dev/shm
+mkdir -p /dev/pts ; mount -v -n /dev/pts
 
 echo "loading kernel modules and configuring the kernel ..."
 . /etc/conf/kernel
index bca54fc..a93bca0 100755 (executable)
@@ -69,8 +69,8 @@ else
 
        echo "shutting down udev ..."
        /etc/init.d/udev stop
-       umount /dev/pts
-       umount /dev/shm
+       umount /dev/pts ; rm -rf /dev/pts
+       umount /dev/shm ; rm -rf /dev/shm
        umount /dev
 
        echo "unmounting remaining file systems ..."
index aaffd25..39cbdcf 100755 (executable)
@@ -8,13 +8,6 @@ ulimit -c 2097151
 PATH=/bin:/sbin:/usr/bin:/usr/sbin
 export PATH
 
-# Make sure we have a /dev/console
-#
-if ! [ -e /dev/.devfsd ] ; then
-       mount -v -n -t devfs none /dev
-       echo "Mounted /dev (devfs) from /etc/initscript." > /dev/console
-fi
-
 # Execute the program.
 #
 eval exec "$4" > /dev/console 2>&1 < /dev/console
index 7e27a45..0e16593 100644 (file)
@@ -22,6 +22,7 @@ custmain()    {
                ln -vfs ../$i $root/etc/init.d/rc2.d/K`echo $counter2`$i
                done
                # symbolic link to sbin
+               rm -f $root/sbin/init.d
                ln -svf ../etc/init.d $root/sbin/init.d
        else
                # create minit files
index 7528085..25fdf0f 100644 (file)
@@ -29,12 +29,15 @@ run_udev()  {
        # all other devices
        for i in ${sysfs_dir}/class/*; do
                for j in $i/*; do
+                       # cruel hack, to not add/del /dev/null
+                       if [ "$j" != "${sysfs_dir}/class/mem/null" ] ; 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 +49,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
@@ -71,6 +68,7 @@ in
                        exit 1
                fi
                rm -f $udev_root/.udev.tdb
+               mknod -m 0666 ${udev_root}/null c 1 3
                export ACTION=add
                export UDEV_NO_SLEEP=1
                run_udev
@@ -83,6 +81,7 @@ in
                export ACTION=remove
                run_udev
                del_nodes
+               rm ${udev_root}/null
                echo " done"
                ;;
        restart)