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 <phil...@redfish-solutions.com>
---

Index: package/base-files/files/etc/init.d/rcS
===================================================================
--- package/base-files/files/etc/init.d/rcS     (revision 20795)
+++ package/base-files/files/etc/init.d/rcS     (working copy)
@@ -10,7 +10,12 @@
 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"



_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to