create /dev/root on boot - fixes cf2nand on rb532
[openwrt.git] / package / base-files / files / etc / init.d / boot
index c644b2f..3461eab 100755 (executable)
@@ -31,9 +31,15 @@ start() {
        for iface in $(awk -F: '/:/ {print $1}' /proc/net/dev); do
                /usr/bin/env -i ACTION=add INTERFACE="$iface" /sbin/hotplug-call net
        done
-
-       /sbin/hotplug2 --persistent &
+       
+       /sbin/hotplug2 --persistent --max-children 5 &
        echo /sbin/hotplug-call > /proc/sys/kernel/hotplug
 
+       # create /dev/root if it doesn't exist
+       [ -e /dev/root ] || {
+               rootdev=$(awk 'BEGIN { RS=" "; FS="="; } $1 == "root" { print $2 }' < /proc/cmdline)
+               [ -n "$rootdev" ] && ln -s "$rootdev" /dev/root
+       }
+
        load_modules /etc/modules.d/*
 }