base-files: Make /etc/init.d/boot restartable
[openwrt.git] / package / base-files / files / etc / init.d / boot
index 4f35eac..ffcc9f7 100755 (executable)
@@ -7,7 +7,7 @@ STOP=98
 system_config() {
        local cfg="$1"
 
-       local hostname conloglevel timezone
+       local hostname conloglevel buffersize timezone zonename
 
        config_get hostname "$cfg" hostname 'OpenWrt'
        echo "$hostname" > /proc/sys/kernel/hostname
@@ -31,6 +31,11 @@ apply_uci_config() {
 }
 
 start() {
+       config_load system
+       config_foreach system_config system
+}
+
+boot() {
        [ -f /proc/mounts ] || /sbin/mount_root
        [ -f /proc/jffs2_bbc ] && echo "S" > /proc/jffs2_bbc
        [ -f /proc/net/vlan/config ] && vconfig set_name_type DEV_PLUS_VID_NO_PAD
@@ -48,11 +53,7 @@ start() {
        grep -q debugfs /proc/filesystems && mount -o noatime -t debugfs debugfs /sys/kernel/debug
        [ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
 
-       if [ -f /sbin/kmodloader ]; then
-               /sbin/kmodloader
-       else
-               load_modules /etc/modules.d/*
-       fi
+       /sbin/kmodloader
 
        # allow wifi modules time to settle
        sleep 1
@@ -64,19 +65,15 @@ start() {
        rm -f /tmp/wireless.tmp
 
        apply_uci_config
-       config_load system
-       config_foreach system_config system
+       
+       # temporary hack until configd exists
+       /sbin/reload_config
+
+       start
 
        # create /dev/root if it doesn't exist
        [ -e /dev/root -o -h /dev/root ] || {
                rootdev=$(awk 'BEGIN { RS=" "; FS="="; } $1 == "root" { print $2 }' < /proc/cmdline)
                [ -n "$rootdev" ] && ln -s "$rootdev" /dev/root
        }
-
-       # early sysctl to avoid networking races
-       if [ -d /proc/sys/net/ipv6/conf ]; then
-               for i in /proc/sys/net/ipv6/conf/*/accept_ra; do
-                       echo 0 > $i
-               done
-       fi
 }