rm_work.bbclass: ignore failure for removing pseudo folder

When building over NFS2/3 server, removal of pseudo folders will fail in
some cases for there are files in it still used by pseudo daemon, thus
cause ".nfsXXXXX" files generated which can't be removed by clients. This
will lead rm_work task fo fail.

These failures could be safely ignored because ".nfsXXXXX" files would be
automatically cleared by NFS server when no clients keep opening them.

[YOCTO #4531]
[ CQID: WIND00412051 ]

(From OE-Core rev: 9742e866f545bc0d04aca697b541ed88f4e1764a)

Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ming Liu 2013-05-23 15:33:43 +08:00 committed by Richard Purdie
parent 7bb6021c4c
commit b08958bc22
1 changed files with 6 additions and 3 deletions

View File

@ -30,15 +30,18 @@ do_rm_work () {
cd ${WORKDIR} cd ${WORKDIR}
for dir in * for dir in *
do do
# Retain only logs and other files in temp. # Retain only logs and other files in temp, safely ignore
if [ $dir != 'temp' ]; then # failures of removing pseudo folers on NFS2/3 server.
if [ $dir = 'pseudo' ]; then
rm -rf $dir 2> /dev/null || true
elif [ $dir != 'temp' ]; then
rm -rf $dir rm -rf $dir
fi fi
done done
# Need to add pseudo back or subsqeuent work in this workdir # Need to add pseudo back or subsqeuent work in this workdir
# might fail since setscene may not rerun to recreate it # might fail since setscene may not rerun to recreate it
mkdir ${WORKDIR}/pseudo/ mkdir -p ${WORKDIR}/pseudo/
# Change normal stamps into setscene stamps as they better reflect the # Change normal stamps into setscene stamps as they better reflect the
# fact WORKDIR is now empty # fact WORKDIR is now empty