summaryrefslogtreecommitdiff
path: root/meta/recipes-core/initscripts
diff options
context:
space:
mode:
authorKai Kang <kai.kang@windriver.com>2014-06-19 15:31:52 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-06-24 19:53:01 +0100
commitcc4b0936c7a6a1563dc88d62d8c9020791eaa446 (patch)
treeb59fe7b1947cf313aead239b345082e5976d5df8 /meta/recipes-core/initscripts
parent9b43af77d112e75fa9827a9080b7e94f41f9a116 (diff)
downloadopenembedded-core-cc4b0936c7a6a1563dc88d62d8c9020791eaa446.tar.gz
openembedded-core-cc4b0936c7a6a1563dc88d62d8c9020791eaa446.tar.bz2
openembedded-core-cc4b0936c7a6a1563dc88d62d8c9020791eaa446.zip
initscripts: update populate-volatile.sh
If a partition such as /tmp mounted on a volatile directory which create by script populate-volatile.sh from initscripts, it will show errors. In /var/log/boot, error message: Thu Jun 19 05:39:09 2014: bootlogd. Thu Jun 19 05:39:10 2014: rm: cannot remove '/tmp': Device or resource busy Check volatile directories and if it is be mounted then don't force make it as a link. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/initscripts')
-rwxr-xr-xmeta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh10
1 files changed, 6 insertions, 4 deletions
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 e707b20049..904037eeaa 100755
--- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
+++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -72,10 +72,12 @@ link_file() {
if [ -L \"$2\" ]; then
[ \"\$(readlink -f \"$2\")\" != \"\$(readlink -f \"$1\")\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; };
elif [ -d \"$2\" ]; then
- cp -a $2/* $1 2>/dev/null;
- cp -a $2/.[!.]* $1 2>/dev/null;
- rm -rf \"$2\";
- ln -sf \"$1\" \"$2\";
+ if awk '\$2 == \"$2\" {exit 1}' /proc/mounts; then
+ cp -a $2/* $1 2>/dev/null;
+ cp -a $2/.[!.]* $1 2>/dev/null;
+ rm -rf \"$2\";
+ ln -sf \"$1\" \"$2\";
+ fi
else
ln -sf \"$1\" \"$2\";
fi