Patchwork [V2,05/10] populate-volatile.sh: don't spawn background process at rootfs time

login
register
mail settings
Submitter Qi.Chen@windriver.com
Date July 29, 2013, 2:33 a.m.
Message ID <6cc5e07664f3936892adb4be59977cfdedbdbb15.1375065009.git.Qi.Chen@windriver.com>
Download mbox | patch
Permalink /patch/54641/
State Accepted
Commit 0123eb924dbe1c74fe5397e1b3872b2622e32708
Headers show

Comments

Qi.Chen@windriver.com - July 29, 2013, 2:33 a.m.
From: Chen Qi <Qi.Chen@windriver.com>

If we're building a read-only rootfs, we'll get the following error now
and then.

    tar: .: file changed as we read it

The root cause is that we spawn background process at rootfs time.
When the tar command is running, it's possible that files under rootfs
are changed by background processes, thus this error.

[YOCTO #4937]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 .../initscripts-1.0/populate-volatile.sh           |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch

diff --git a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
index d8ae14e..827fd7d 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -46,7 +46,7 @@  create_file() {
 			# but these failures should not be logged to make sure the do_rootfs
 			# process doesn't fail. This does no harm, as this script will
 			# run on target to set up the correct files and directories.
-			eval $EXEC > /dev/null 2>&1 &
+			eval $EXEC > /dev/null 2>&1
 		fi
 	}
 }
@@ -91,7 +91,7 @@  link_file() {
 	else
 		# For the same reason with create_file(), failures should
 		# not be logged.
-		eval $EXEC > /dev/null 2>&1 &
+		eval $EXEC > /dev/null 2>&1
 	fi
 }
 
@@ -160,7 +160,7 @@  apply_cfgfile() {
 		[ "${TTYPE}" = "l" ] && {
 			TSOURCE="$TLTARGET"
 			[ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-."
-			link_file "${TSOURCE}" "${TNAME}" &
+			link_file "${TSOURCE}" "${TNAME}"
 			continue
 		}