aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2010-04-13 19:57:25 +0000
committerFlorian Fainelli <florian@openwrt.org>2010-04-13 19:57:25 +0000
commiteafa2ec9622a34a100c44a46e9cb30b90c8aade8 (patch)
tree8928d67876225e9cdc2fd32a7150ef5973ff1902 /package
parent231012cba0aa1c7b4cedb1e512c31a5fe346a84a (diff)
downloadupstream-eafa2ec9622a34a100c44a46e9cb30b90c8aade8.tar.gz
upstream-eafa2ec9622a34a100c44a46e9cb30b90c8aade8.tar.bz2
upstream-eafa2ec9622a34a100c44a46e9cb30b90c8aade8.zip
option to allow boot to run to completion before starting shell
Setting the system variable "foreground" to yes causes the system to run the init scripts in series and wait for completion. This is useful if (a) you don't want the user getting into the console until the system is initialized, or (b) you have things going on in your scripts that require strict ordering (and no possible race conditions). Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> SVN-Revision: 20841
Diffstat (limited to 'package')
-rwxr-xr-xpackage/base-files/files/etc/init.d/rcS7
1 files changed, 6 insertions, 1 deletions
diff --git a/package/base-files/files/etc/init.d/rcS b/package/base-files/files/etc/init.d/rcS
index c135024bea..ea40d68bed 100755
--- a/package/base-files/files/etc/init.d/rcS
+++ b/package/base-files/files/etc/init.d/rcS
@@ -10,7 +10,12 @@ run_scripts() {
LOGGER="cat"
[ -x /usr/bin/logger ] && LOGGER="logger -s -p 6 -t sysinit"
-if [ "$1" = "S" ]; then
+. /etc/functions.sh
+
+config_load system
+config_get_bool foreground system foreground no
+
+if [ "$1" = "S" -a "$foreground" != "yes" ]; then
run_scripts "$1" "$2" &
else
run_scripts "$1" "$2"