]> code.ossystems Code Review - openembedded-core.git/commitdiff
initscripts: populate-volatile.sh: run create_file synchronously
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Wed, 21 Jul 2021 14:10:15 +0000 (16:10 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 24 Jul 2021 15:33:42 +0000 (16:33 +0100)
The behavior of running create_file in the background was introduced in
d44816bedade ("initscripts: Populate volatile from existing file")
without further explanation. Besides its questionable benefit, this
causes actual issues:

- Not all create_file processes may have finished by the time the
  initscript exits (or when it moves /etc/volatile.cache.build !)
- By making the order of commands nondeterminstic, it could hide
  dependency issues where it was attempted to create files before their
  containing directories

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh

index f8b42c6893646f670eb647fc069e2d4e7a65fc16..b56b72f83340a8950bac435cb9fa1e584717f3a6 100755 (executable)
@@ -201,7 +201,7 @@ apply_cfgfile() {
                        "f")  [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-."
                                TSOURCE="$TLTARGET"
                                [ "${TSOURCE}" = "none" ] && TSOURCE=""
-                               create_file "${TNAME}" "${TSOURCE}" &
+                               create_file "${TNAME}" "${TSOURCE}"
                                ;;
                        "d")  [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-."
                                mk_dir "${TNAME}"