diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2013-08-07 15:17:15 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-08-16 11:14:15 +0100 |
commit | 742440441222e0627abbdd3eb2ee16401e8f4adf (patch) | |
tree | 40dd4f3d768fd46db9e98ae488179e5c90b4d216 /meta/recipes-core/initscripts | |
parent | 08947869917dc5a9dfff05b0ee19279f60cf6d2b (diff) | |
download | openembedded-core-742440441222e0627abbdd3eb2ee16401e8f4adf.tar.gz openembedded-core-742440441222e0627abbdd3eb2ee16401e8f4adf.tar.bz2 openembedded-core-742440441222e0627abbdd3eb2ee16401e8f4adf.zip |
populate-volatile.sh: use 'cp -a' to avoid potential problem
Previously, dead links in target directory will not be copied.
This is incorrect as dead links are not uncommon in our rootfs.
So we use '-a' option instead.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Diffstat (limited to 'meta/recipes-core/initscripts')
-rwxr-xr-x | meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh | 3 |
1 files changed, 2 insertions, 1 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 0ff0e1af7f..915b7d0b93 100755 --- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh +++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh @@ -72,7 +72,8 @@ link_file() { if [ -L \"$2\" ]; then [ \"\$(readlink -f \"$2\")\" != \"\$(readlink -f \"$1\")\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; }; elif [ -d \"$2\" ]; then - for f in $2/* $2/.[^.]*; do [ -e \$f ] && cp -rf \$f $1; done; + cp -a $2/* $1 2>/dev/null; + cp -a $2/.[!.]* $1 2>/dev/null; rm -rf \"$2\"; ln -sf \"$1\" \"$2\"; else |