[package] option to allow boot to run to completion before starting shell
authorflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 13 Apr 2010 19:57:25 +0000 (19:57 +0000)
committerflorian <florian@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Tue, 13 Apr 2010 19:57:25 +0000 (19:57 +0000)
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>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20841 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/base-files/files/etc/init.d/rcS

index c135024..ea40d68 100755 (executable)
@@ -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"