[OE-core] [PATCH V4 08/10] populate-volatile.sh: use 'cp -a' to avoid potential problem

ChenQi Qi.Chen at windriver.com
Thu Aug 8 02:50:36 UTC 2013


On 08/07/2013 04:08 PM, Qi.Chen at windriver.com wrote:
> From: Chen Qi <Qi.Chen at windriver.com>
>
> 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 at windriver.com>
> ---
>   .../initscripts-1.0/populate-volatile.sh           |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> 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 827fd7d..b1c0245 100755
> --- a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
> +++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
> @@ -76,7 +76,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
> +		cp -a $2/.[!.]* $1
My apologies.
The above two lines are missing colons.
They should be:
cp -a $2/* $1;
cp -a $2/.[!.]* $1;

Remote branch has been updated to fix this error.
Sorry for the inconvenience.

Best Regards,
Chen Qi

>   		rm -rf \"$2\";
>   		ln -sf \"$1\" \"$2\";
>   	else




More information about the Openembedded-core mailing list