diff --git a/smgl/init.d/init.d/devices b/smgl/init.d/init.d/devices
index 8fb142b..bb509cc 100755
--- a/smgl/init.d/init.d/devices
+++ b/smgl/init.d/init.d/devices
@@ -29,9 +29,6 @@ start_devfs()
start_udev()
{ (
. /etc/udev/udev.conf
- # mount sysfs
- echo "Mounting sysfs at /sys"
- mount -n -t sysfs none /sys
echo "Mounting ramfs at $udev_root"
mount -n -t ramfs none $udev_root
# create some needed stuff
@@ -84,6 +81,59 @@ start_udev()
kill -USR1 1
) }
+start_static_udev()
+{ (
+ . /etc/udev/udev.conf
+ # create some needed stuff - and insist on it
+ if [ ! -d $udev_root/fd ]; then
+ ln -fs /proc/self/fd $udev_root/fd
+ fi
+ ln -fs /dev/fd/0 $udev_root/stdin
+ ln -fs /dev/fd/1 $udev_root/stdout
+ ln -fs /dev/fd/2 $udev_root/stderr
+ mkdir -p $udev_root/shm
+ mkdir -p $udev_root/pts
+
+ # strip out kernel sublevel and patchlevel so we can check against them
+ # since we don't support 1.x linux kernels then we don't have to check that
+ PATCHLEVEL=$(uname -r | cut -d. -f2)
+ SUBLEVEL=$(uname -r | cut -d. -f3)
+ tmp=$(uname -r | cut -d. -f3 | sed 's/^[0-9]*//g')
+ SUBLEVEL=${SUBLEVEL/$tmp/}
+
+ # kernel 2.6.15-rc1 and higher don't use hotplug
+ if [ $SUBLEVEL -ge 15 -a $PATCHLEVEL -ge 6 ]; then
+ echo "don't need hotplug for this kernel"
+ builtin echo > /proc/sys/kernel/hotplug
+ else
+ # Now uses udevsend as the hotplug multiplexer
+ echo "Setting udevsend as hotplug agent"
+ sysctl -w kernel.hotplug="/sbin/udevsend" > /dev/null 2>&1
+ echo "Creating initial udev device nodes"
+ /sbin/udevstart
+ fi
+
+ if [ -f /etc/udev/udev.missing ]; then
+ echo "Processing /etc/udev/udev.missing"
+ cd /dev
+ while read line; do
+ if [ "${line:0:1}" == "#" ]; then continue; fi
+ for ((i=0; i<7; i++)); do
+ val[$i]=${line%%:*}
+ line=${line#*:}
+ done
+ if [ "${val[1]}" == "d" ]; then
+ mkdir -p ${val[0]}
+ else
+ mknod ${val[0]} ${val[1]} ${val[2]} ${val[3]}
+ fi
+ chmod ${val[4]} ${val[0]}
+ chown ${val[5]}:${val[6]} ${val[0]}
+ done < /etc/udev/udev.missing
+ cd /
+ fi
+) }
+
start_static()
{
exit 0
@@ -94,6 +144,9 @@ start()
# mount proc
echo "Mounting /proc"
mount -n -t proc proc /proc
+ # mount sys
+ echo "Mounting /sys"
+ mount -n -t sysfs sysfs /sys
eval "start_$DEVICES"
}
diff --git a/smgl/init.d/init.d/devices.conf b/smgl/init.d/init.d/devices.conf
index 287f0cc..aefd80b 100644
--- a/smgl/init.d/init.d/devices.conf
+++ b/smgl/init.d/init.d/devices.conf
@@ -1,2 +1,2 @@
-# type of device management, "static", "devfs" or "udev"
+# type of device management, "static", "devfs", "udev" or "static_udev"
DEVICES=devfs
[SM-Commit] GIT changes to master grimoire by Andraž Levstik (4ed5508ff4895189bf86fd559b40c04623584b18),
Andraž Levstik, 02/27/2009