2006-10-04 20:05:48 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
2011-11-07 22:58:34 +00:00
|
|
|
# Copyright (C) 2006-2011 OpenWrt.org
|
2006-06-27 00:36:13 +00:00
|
|
|
|
2006-10-15 21:03:30 +00:00
|
|
|
START=10
|
2010-01-30 18:17:52 +00:00
|
|
|
STOP=98
|
2007-03-06 21:28:57 +00:00
|
|
|
|
2014-04-07 10:01:54 +00:00
|
|
|
uci_apply_defaults() {
|
2014-04-07 10:29:47 +00:00
|
|
|
. /lib/functions/system.sh
|
|
|
|
|
2014-04-07 10:01:54 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2013-11-07 12:45:57 +00:00
|
|
|
boot() {
|
2006-10-04 20:05:48 +00:00
|
|
|
[ -f /proc/mounts ] || /sbin/mount_root
|
|
|
|
[ -f /proc/jffs2_bbc ] && echo "S" > /proc/jffs2_bbc
|
2008-05-13 09:21:17 +00:00
|
|
|
[ -f /proc/net/vlan/config ] && vconfig set_name_type DEV_PLUS_VID_NO_PAD
|
2007-05-09 20:54:41 +00:00
|
|
|
|
2006-10-04 20:05:48 +00:00
|
|
|
mkdir -p /var/run
|
|
|
|
mkdir -p /var/log
|
|
|
|
mkdir -p /var/lock
|
2007-06-16 00:01:33 +00:00
|
|
|
mkdir -p /var/state
|
2008-02-03 06:48:15 +00:00
|
|
|
mkdir -p /tmp/.uci
|
2009-01-06 21:53:45 +00:00
|
|
|
chmod 0700 /tmp/.uci
|
2006-10-04 20:05:48 +00:00
|
|
|
touch /var/log/wtmp
|
|
|
|
touch /var/log/lastlog
|
2008-08-28 14:10:55 +00:00
|
|
|
touch /tmp/resolv.conf.auto
|
2007-06-30 20:00:29 +00:00
|
|
|
ln -sf /tmp/resolv.conf.auto /tmp/resolv.conf
|
2013-12-27 21:15:09 +00:00
|
|
|
grep -q debugfs /proc/filesystems && /bin/mount -o noatime -t debugfs debugfs /sys/kernel/debug
|
2006-10-04 20:05:48 +00:00
|
|
|
[ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
|
2007-06-25 08:32:25 +00:00
|
|
|
|
2013-06-21 16:53:59 +00:00
|
|
|
/sbin/kmodloader
|
2011-11-03 20:02:25 +00:00
|
|
|
|
2012-05-06 21:25:42 +00:00
|
|
|
# allow wifi modules time to settle
|
|
|
|
sleep 1
|
|
|
|
|
2011-11-03 20:02:25 +00:00
|
|
|
/sbin/wifi detect > /tmp/wireless.tmp
|
|
|
|
[ -s /tmp/wireless.tmp ] && {
|
|
|
|
cat /tmp/wireless.tmp >> /etc/config/wireless
|
|
|
|
}
|
|
|
|
rm -f /tmp/wireless.tmp
|
|
|
|
|
2014-04-07 10:01:54 +00:00
|
|
|
uci_apply_defaults
|
2013-07-11 17:00:54 +00:00
|
|
|
|
|
|
|
# temporary hack until configd exists
|
|
|
|
/sbin/reload_config
|
2013-11-07 12:45:57 +00:00
|
|
|
|
|
|
|
start
|
2011-11-03 20:02:25 +00:00
|
|
|
|
2007-04-29 16:57:55 +00:00
|
|
|
# create /dev/root if it doesn't exist
|
2011-04-05 15:09:43 +00:00
|
|
|
[ -e /dev/root -o -h /dev/root ] || {
|
2007-04-29 16:57:55 +00:00
|
|
|
rootdev=$(awk 'BEGIN { RS=" "; FS="="; } $1 == "root" { print $2 }' < /proc/cmdline)
|
|
|
|
[ -n "$rootdev" ] && ln -s "$rootdev" /dev/root
|
|
|
|
}
|
2006-10-04 20:05:48 +00:00
|
|
|
}
|