From 53edda1e3668752d18b2bbf4c3d6edc7e3ab1b6e Mon Sep 17 00:00:00 2001 From: mirko Date: Wed, 19 Dec 2012 16:07:46 +0000 Subject: Do not overload mount-call - trying to reduce confusion The behaviour of calling 'mount' differed depending on whether it called the busybox-mount, the mount of util-linux, the mount defined in /lib/functions.sh and /lib/functions/boot.sh /etc/preinit even included /lib/functions.sh and /lib/functions/boot.sh, both re-defining 'mount'. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34792 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/etc/init.d/boot | 2 +- package/base-files/files/etc/init.d/usb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'package/base-files/files/etc/init.d') diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot index 43837a80f..ef97383d8 100755 --- a/package/base-files/files/etc/init.d/boot +++ b/package/base-files/files/etc/init.d/boot @@ -66,7 +66,7 @@ start() { touch /var/log/lastlog touch /tmp/resolv.conf.auto ln -sf /tmp/resolv.conf.auto /tmp/resolv.conf - grep -q debugfs /proc/filesystems && mount -t debugfs debugfs /sys/kernel/debug + grep -q debugfs /proc/filesystems && mount -o noatime -t debugfs debugfs /sys/kernel/debug [ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe load_modules /etc/modules.d/* diff --git a/package/base-files/files/etc/init.d/usb b/package/base-files/files/etc/init.d/usb index 7b443b651..43cdfd9a9 100755 --- a/package/base-files/files/etc/init.d/usb +++ b/package/base-files/files/etc/init.d/usb @@ -4,6 +4,6 @@ START=39 start() { [ -d /proc/bus/usb ] && { - /bin/mount -t usbfs none /proc/bus/usb + mount -o noatime -t usbfs none /proc/bus/usb } } -- cgit v1.2.3 From 8ddd158504f4a05bfe91645b347681ad56c8d471 Mon Sep 17 00:00:00 2001 From: cyrus Date: Tue, 29 Jan 2013 10:13:33 +0000 Subject: base-files: Fix race-conditions with IPv6 sysctls git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35368 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/etc/init.d/boot | 3 +++ 1 file changed, 3 insertions(+) (limited to 'package/base-files/files/etc/init.d') diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot index ef97383d8..180034236 100755 --- a/package/base-files/files/etc/init.d/boot +++ b/package/base-files/files/etc/init.d/boot @@ -95,6 +95,9 @@ start() { rootdev=$(awk 'BEGIN { RS=" "; FS="="; } $1 == "root" { print $2 }' < /proc/cmdline) [ -n "$rootdev" ] && ln -s "$rootdev" /dev/root } + + # run early sysctl + [ -f /etc/sysctl_early.conf ] && sysctl -p /etc/sysctl_early.conf -e >&- } stop() { -- cgit v1.2.3 From 8a0e57cc7c94f77a98f973b06e04bdfc8fb5adf6 Mon Sep 17 00:00:00 2001 From: cyrus Date: Fri, 1 Feb 2013 12:28:24 +0000 Subject: base-files: Fix IPv6 early sysctls again * Kernel IPv6 /proc interface inconsistency caused races git-svn-id: svn://svn.openwrt.org/openwrt/trunk@35417 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/etc/init.d/boot | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'package/base-files/files/etc/init.d') diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot index 180034236..005c4ad6f 100755 --- a/package/base-files/files/etc/init.d/boot +++ b/package/base-files/files/etc/init.d/boot @@ -96,8 +96,12 @@ start() { [ -n "$rootdev" ] && ln -s "$rootdev" /dev/root } - # run early sysctl - [ -f /etc/sysctl_early.conf ] && sysctl -p /etc/sysctl_early.conf -e >&- + # 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 } stop() { -- cgit v1.2.3 From 35dde6748e98a2a7725e220c5ea8f63c7d9c185c Mon Sep 17 00:00:00 2001 From: blogic Date: Wed, 13 Mar 2013 18:11:19 +0000 Subject: [base-files] make basefiles aware of procd Signed-off-by: John Crispin git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36003 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/etc/init.d/boot | 32 ---------------------------- package/base-files/files/etc/init.d/rcS | 25 ++++------------------ package/base-files/files/etc/init.d/watchdog | 13 ----------- 3 files changed, 4 insertions(+), 66 deletions(-) delete mode 100755 package/base-files/files/etc/init.d/watchdog (limited to 'package/base-files/files/etc/init.d') diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot index 005c4ad6f..67db0d2a6 100755 --- a/package/base-files/files/etc/init.d/boot +++ b/package/base-files/files/etc/init.d/boot @@ -24,27 +24,6 @@ system_config() { # apply timezone to kernel date -k - - if [ -x /sbin/syslogd ]; then - local args log_ip log_size log_port log_type log_file - config_get log_ip "$cfg" log_ip - config_get log_size "$cfg" log_size 16 - config_get log_port "$cfg" log_port 514 - config_get log_type "$cfg" log_type circular - config_get log_file "$cfg" log_file "/var/log/messages" - args="${log_ip:+-L -R ${log_ip}:${log_port}} ${conloglevel:+-l $conloglevel}" - if [ "$log_type" = "file" ]; then - args="$args -s $log_size -O $log_file -S" - else - args="$args -C${log_size}" - fi - service_start /sbin/syslogd $args - fi - if [ -x /sbin/klogd ]; then - config_get klogconloglevel "$cfg" klogconloglevel - args="${klogconloglevel:+-c $klogconloglevel}" - service_start /sbin/klogd $args - fi } apply_uci_config() { @@ -84,12 +63,6 @@ start() { config_load system config_foreach system_config system - killall -q hotplug2 - [ -x /sbin/hotplug2 ] && /sbin/hotplug2 --override --persistent \ - --set-rules-file /etc/hotplug2.rules \ - --set-coldplug-cmd /sbin/udevtrigger \ - --max-children 1 >/dev/null 2>&1 & - # 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) @@ -103,8 +76,3 @@ start() { done fi } - -stop() { - service_stop /sbin/klogd - service_stop /sbin/syslogd -} diff --git a/package/base-files/files/etc/init.d/rcS b/package/base-files/files/etc/init.d/rcS index 3ec9bfef6..9599bbf32 100755 --- a/package/base-files/files/etc/init.d/rcS +++ b/package/base-files/files/etc/init.d/rcS @@ -1,26 +1,9 @@ #!/bin/sh # Copyright (C) 2006 OpenWrt.org -run_scripts() { - for i in /etc/rc.d/$1*; do - [ -x $i ] && $i $2 2>&1 - done | $LOGGER -} - -system_config() { - config_get_bool foreground $1 foreground 0 -} - LOGGER="cat" -[ -x /usr/bin/logger ] && LOGGER="logger -s -p 6 -t sysinit" - -. /lib/functions.sh - -config_load system -config_foreach system_config system +[ -x /usr/bin/logger ] && LOGGER="logger -p 6 -t sysinit" -if [ "$1" = "S" -a "$foreground" != "1" ]; then - run_scripts "$1" "$2" & -else - run_scripts "$1" "$2" -fi +for i in /etc/rc.d/$1*; do + [ -x $i ] && $i $2 2>&1 +done | $LOGGER diff --git a/package/base-files/files/etc/init.d/watchdog b/package/base-files/files/etc/init.d/watchdog deleted file mode 100755 index 299c89142..000000000 --- a/package/base-files/files/etc/init.d/watchdog +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh /etc/rc.common -# Copyright (C) 2008-2011 OpenWrt.org - -START=97 - -start() { - [ -c /dev/watchdog ] || return 1 - [ -x /sbin/watchdog ] || return 1 - service_start /sbin/watchdog -t 5 /dev/watchdog -} -stop() { - service_stop /sbin/watchdog -} -- cgit v1.2.3 From 30c3e72a1e4893019786eff1d4cd9dfa9dad72e5 Mon Sep 17 00:00:00 2001 From: jow Date: Mon, 25 Mar 2013 18:43:30 +0000 Subject: package/base-files: change sysctl handling Move /etc/init.d/sysctl to index 00 and add hotplug script that applies interface specific sysctls for interfaces that only appear later - this allows to reliably configure per-interface parameters in sysctl.conf, e.g. to disable ipv6 autoconfig on a specific iface. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36129 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/etc/init.d/sysctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package/base-files/files/etc/init.d') diff --git a/package/base-files/files/etc/init.d/sysctl b/package/base-files/files/etc/init.d/sysctl index 239779055..beeb79f7e 100755 --- a/package/base-files/files/etc/init.d/sysctl +++ b/package/base-files/files/etc/init.d/sysctl @@ -1,7 +1,7 @@ #!/bin/sh /etc/rc.common # Copyright (C) 2006 OpenWrt.org -START=99 +START=0 start() { [ -f /etc/sysctl.conf ] && sysctl -p -e >&- } -- cgit v1.2.3 From d208aa2b0bbd43ffab2d54960c8b695632f9948f Mon Sep 17 00:00:00 2001 From: jow Date: Mon, 25 Mar 2013 18:45:23 +0000 Subject: base-files: fix bad start index in previous commit git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36130 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/etc/init.d/sysctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package/base-files/files/etc/init.d') diff --git a/package/base-files/files/etc/init.d/sysctl b/package/base-files/files/etc/init.d/sysctl index beeb79f7e..81b0c9ba1 100755 --- a/package/base-files/files/etc/init.d/sysctl +++ b/package/base-files/files/etc/init.d/sysctl @@ -1,7 +1,7 @@ #!/bin/sh /etc/rc.common # Copyright (C) 2006 OpenWrt.org -START=0 +START=00 start() { [ -f /etc/sysctl.conf ] && sysctl -p -e >&- } -- cgit v1.2.3 From 0b02cb7ac6a0503d174b64f16fc08f152124f7f9 Mon Sep 17 00:00:00 2001 From: jow Date: Tue, 26 Mar 2013 10:02:58 +0000 Subject: base-files: move sysctl init after boot git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36131 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/etc/init.d/sysctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package/base-files/files/etc/init.d') diff --git a/package/base-files/files/etc/init.d/sysctl b/package/base-files/files/etc/init.d/sysctl index 81b0c9ba1..3480d6641 100755 --- a/package/base-files/files/etc/init.d/sysctl +++ b/package/base-files/files/etc/init.d/sysctl @@ -1,7 +1,7 @@ #!/bin/sh /etc/rc.common # Copyright (C) 2006 OpenWrt.org -START=00 +START=11 start() { [ -f /etc/sysctl.conf ] && sysctl -p -e >&- } -- cgit v1.2.3 From 533fc89abaf81ccf6965f1d1c917421238a83817 Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 25 Apr 2013 19:02:28 +0000 Subject: boot: make use of kmodloader if it is available Signed-off-by: John Crispin git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36428 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/etc/init.d/boot | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'package/base-files/files/etc/init.d') diff --git a/package/base-files/files/etc/init.d/boot b/package/base-files/files/etc/init.d/boot index 67db0d2a6..4f35eac7b 100755 --- a/package/base-files/files/etc/init.d/boot +++ b/package/base-files/files/etc/init.d/boot @@ -48,7 +48,11 @@ start() { grep -q debugfs /proc/filesystems && mount -o noatime -t debugfs debugfs /sys/kernel/debug [ "$FAILSAFE" = "true" ] && touch /tmp/.failsafe - load_modules /etc/modules.d/* + if [ -f /sbin/kmodloader ]; then + /sbin/kmodloader + else + load_modules /etc/modules.d/* + fi # allow wifi modules time to settle sleep 1 -- cgit v1.2.3 From b5367474cba180d7b2555e4e30421a7340f63264 Mon Sep 17 00:00:00 2001 From: blogic Date: Thu, 25 Apr 2013 19:02:32 +0000 Subject: mount_root: prepare base-files Signed-off-by: John Crispin git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36429 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/base-files/files/etc/init.d/done | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package/base-files/files/etc/init.d') diff --git a/package/base-files/files/etc/init.d/done b/package/base-files/files/etc/init.d/done index 827866912..8040766dc 100755 --- a/package/base-files/files/etc/init.d/done +++ b/package/base-files/files/etc/init.d/done @@ -5,7 +5,7 @@ START=95 boot() { [ -d /tmp/root ] && { lock /tmp/.switch2jffs - firstboot switch2jffs + switch2jffs lock -u /tmp/.switch2jffs } -- cgit v1.2.3