libipfix: specify the number of the wprobe ie append script on the command line
[openwrt.git] / package / base-files / files / etc / init.d / boot
1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006 OpenWrt.org
3
4 START=10
5
6 system_config() {
7 local cfg="$1"
8
9 local hostname conloglevel timezone
10
11 config_get hostname "$cfg" hostname 'OpenWrt'
12 echo "$hostname" > /proc/sys/kernel/hostname
13
14 config_get conloglevel "$cfg" conloglevel
15 config_get buffersize "$cfg" buffersize
16 [ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
17
18 config_get timezone "$cfg" timezone 'UTC'
19 echo "$timezone" > /tmp/TZ
20
21 if [ -x /sbin/syslogd ]; then
22 local log_ip log_size log_port log_type log_file
23 config_get log_ip "$cfg" log_ip
24 config_get log_size "$cfg" log_size 16
25 config_get log_port "$cfg" log_port 514
26 config_get log_type "$cfg" log_type circular
27 config_get log_file "$cfg" log_file "/var/log/messages"
28 if [ "$log_type" = "file" ]; then
29 syslogd -s $log_size -O $log_file ${log_ip:+-L -R ${log_ip}:${log_port}} -S
30 else
31 syslogd -C${log_size} ${log_ip:+-L -R ${log_ip}:${log_port}}
32 fi
33 fi
34 config_get klogconloglevel "$cfg" klogconloglevel
35 [ -x /sbin/klogd ] && klogd ${klogconloglevel:+-c $klogconloglevel}
36 }
37
38 apply_uci_config() {
39 sh -c '. /etc/functions.sh; include /lib/config; uci_apply_defaults'
40 }
41
42 start() {
43 [ -f /proc/mounts ] || /sbin/mount_root
44 [ -f /proc/jffs2_bbc ] && echo "S" > /proc/jffs2_bbc
45 [ -f /proc/net/vlan/config ] && vconfig set_name_type DEV_PLUS_VID_NO_PAD
46
47 apply_uci_config
48 config_load system
49 config_foreach system_config system
50
51 mkdir -p /var/run
52 mkdir -p /var/log
53 mkdir -p /var/lock
54 mkdir -p /var/state
55 mkdir -p /tmp/.uci
56 chmod 0700 /tmp/.uci
57 touch /var/log/wtmp
58 touch /var/log/lastlog
59 touch /tmp/resolv.conf.auto
60 ln -sf /tmp/resolv.conf.auto /tmp/resolv.conf
61 grep -q debugfs /proc/filesystems && mount -t debugfs debugfs /sys/kernel/debug
62 [ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe
63
64 killall -q hotplug2
65 [ -x /sbin/hotplug2 ] && /sbin/hotplug2 --override --persistent \
66 --set-worker /lib/hotplug2/worker_fork.so \
67 --set-rules-file /etc/hotplug2.rules \
68 --max-children 1 >/dev/null 2>&1 &
69
70 # the coldplugging of network interfaces needs to happen later, so we do it manually here
71 for iface in $(awk -F: '/:/ {print $1}' /proc/net/dev); do
72 /usr/bin/env -i ACTION=add INTERFACE="$iface" /sbin/hotplug-call net
73 done
74
75 # create /dev/root if it doesn't exist
76 [ -e /dev/root ] || {
77 rootdev=$(awk 'BEGIN { RS=" "; FS="="; } $1 == "root" { print $2 }' < /proc/cmdline)
78 [ -n "$rootdev" ] && ln -s "$rootdev" /dev/root
79 }
80
81 load_modules /etc/modules.d/*
82 }
This page took 0.082796 seconds and 5 git commands to generate.