X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=package%2Fbase-files%2Ffiles%2Fetc%2Finit.d%2Fboot;h=ccd0afe30d108016429500c4c8188afa136596d6;hb=HEAD;hp=0b7744746bce51bcf8db088ffcc05030cf819b74;hpb=afa5da1d1bf575000d260e9abe26d47b94e3e117;p=openwrt.git diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot index 0b7744746b..ccd0afe30d 100755 --- a/package/base-files/files/etc/init.d/boot +++ b/package/base-files/files/etc/init.d/boot @@ -1,61 +1,61 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2006 OpenWrt.org +# Copyright (C) 2006-2011 OpenWrt.org START=10 +STOP=98 -system_config() { - local cfg="$1" - local hostname - - config_get hostname "$cfg" hostname - echo "${hostname:-OpenWrt}" > /proc/sys/kernel/hostname - - config_get conloglevel "$cfg" conloglevel - [ -n "$conloglevel" ] && dmesg -n "$conloglevel" +uci_apply_defaults() { + . /lib/functions/system.sh - config_get log_ip "$cfg" log_ip - syslogd -C16 ${log_ip:+-L -R $log_ip} - klogd + cd /etc/uci-defaults || return 0 + files="$(ls)" + [ -z "$files" ] && return 0 + mkdir -p /tmp/.uci + for file in $files; do + ( . "./$(basename $file)" ) && rm -f "$file" + done + uci commit } -apply_uci_config() {( - include /lib/config - uci_apply_defaults -)} - -start() { +boot() { [ -f /proc/mounts ] || /sbin/mount_root [ -f /proc/jffs2_bbc ] && echo "S" > /proc/jffs2_bbc - vconfig set_name_type DEV_PLUS_VID_NO_PAD + [ -f /proc/net/vlan/config ] && vconfig set_name_type DEV_PLUS_VID_NO_PAD - apply_uci_config - config_load system - config_foreach system_config system - mkdir -p /var/run mkdir -p /var/log mkdir -p /var/lock mkdir -p /var/state + mkdir -p /var/tmp mkdir -p /tmp/.uci - chown 0700 /tmp/.uci + chmod 0700 /tmp/.uci touch /var/log/wtmp touch /var/log/lastlog + touch /tmp/resolv.conf.auto ln -sf /tmp/resolv.conf.auto /tmp/resolv.conf + grep -q debugfs /proc/filesystems && /bin/mount -o noatime -t debugfs debugfs /sys/kernel/debug [ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe - [ -x /sbin/hotplug2 ] && /sbin/hotplug2 --override --persistent \ - --max-children 1 --no-coldplug & + /sbin/kmodloader - # the coldplugging of network interfaces needs to happen later, so we do it manually here - for iface in $(awk -F: '/:/ {print $1}' /proc/net/dev); do - /usr/bin/env -i ACTION=add INTERFACE="$iface" /sbin/hotplug-call net - done + # allow wifi modules time to settle + sleep 1 + + /sbin/wifi detect > /tmp/wireless.tmp + [ -s /tmp/wireless.tmp ] && { + cat /tmp/wireless.tmp >> /etc/config/wireless + } + rm -f /tmp/wireless.tmp + + /bin/board_detect + uci_apply_defaults + + # temporary hack until configd exists + /sbin/reload_config # create /dev/root if it doesn't exist - [ -e /dev/root ] || { + [ -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 } - - load_modules /etc/modules.d/* }