1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
10 config_get hostname
"$cfg" hostname
11 echo "${hostname:-OpenWrt}" > /proc
/sys
/kernel
/hostname
13 config_get conloglevel
"$cfg" conloglevel
14 [ -n "$conloglevel" ] && dmesg
-n "$conloglevel"
16 config_get log_ip
"$cfg" log_ip
17 syslogd
-C16 ${log_ip:+-L -R $log_ip}
27 [ -f /proc
/mounts
] ||
/sbin
/mount_root
28 [ -f /proc
/jffs2_bbc
] && echo "S" > /proc
/jffs2_bbc
29 vconfig set_name_type DEV_PLUS_VID_NO_PAD
33 config_foreach system_config system
40 touch /var
/log
/lastlog
41 ln -s /tmp
/resolv.conf.auto
/tmp
/resolv.conf
42 [ "$FAILSAFE" = "true" ] && touch /tmp
/.failsafe
44 /sbin
/hotplug2
--override --persistent --max-children 1 &
46 # the coldplugging of network interfaces needs to happen later, so we do it manually here
47 for iface
in $
(awk -F: '/:/ {print $1}' /proc
/net
/dev
); do
48 /usr
/bin
/env
-i ACTION
=add INTERFACE
="$iface" /sbin
/hotplug-call net
51 # create /dev/root if it doesn't exist
53 rootdev
=$
(awk 'BEGIN { RS=" "; FS="="; } $1 == "root" { print $2 }' < /proc
/cmdline
)
54 [ -n "$rootdev" ] && ln -s "$rootdev" /dev
/root
57 load_modules
/etc
/modules.d
/*