From 686e1c011b93bbe7803978d8d0952d4ab04b1f34 Mon Sep 17 00:00:00 2001 From: hackbard Date: Wed, 28 Jul 2004 21:34:01 +0000 Subject: [PATCH] more init fixes --- misc/sysfiles/etc/init.d/boot | 2 ++ misc/sysfiles/etc/init.d/down | 4 ++-- misc/sysfiles/etc/initscript | 7 ------- packages/base/00-init-conf/00-init-conf | 1 + packages/base/udev/init_udev.sh | 13 ++++++------- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/misc/sysfiles/etc/init.d/boot b/misc/sysfiles/etc/init.d/boot index 9e1a3be..7352c7e 100755 --- a/misc/sysfiles/etc/init.d/boot +++ b/misc/sysfiles/etc/init.d/boot @@ -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 diff --git a/misc/sysfiles/etc/init.d/down b/misc/sysfiles/etc/init.d/down index bca54fc..a93bca0 100755 --- a/misc/sysfiles/etc/init.d/down +++ b/misc/sysfiles/etc/init.d/down @@ -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 ..." diff --git a/misc/sysfiles/etc/initscript b/misc/sysfiles/etc/initscript index aaffd25..39cbdcf 100755 --- a/misc/sysfiles/etc/initscript +++ b/misc/sysfiles/etc/initscript @@ -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 diff --git a/packages/base/00-init-conf/00-init-conf b/packages/base/00-init-conf/00-init-conf index 7e27a45..0e16593 100644 --- a/packages/base/00-init-conf/00-init-conf +++ b/packages/base/00-init-conf/00-init-conf @@ -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 diff --git a/packages/base/udev/init_udev.sh b/packages/base/udev/init_udev.sh index 7528085..25fdf0f 100644 --- a/packages/base/udev/init_udev.sh +++ b/packages/base/udev/init_udev.sh @@ -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) -- 2.39.2