]> code.ossystems Code Review - openembedded-core.git/commitdiff
rm_work.bbclass: ignore failure for removing pseudo folder
authorMing Liu <ming.liu@windriver.com>
Thu, 23 May 2013 07:33:43 +0000 (15:33 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 24 May 2013 13:14:30 +0000 (14:14 +0100)
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 ]

Signed-off-by: Ming Liu <ming.liu@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/classes/rm_work.bbclass

index 1642af7936d416353ff2fb5026185d53b1e6a073..f0f6d18249bf020f3d089c0012dfec7f2eaf481a 100644 (file)
@@ -30,15 +30,18 @@ do_rm_work () {
     cd ${WORKDIR}
     for dir in *
     do
-        # Retain only logs and other files in temp.
-        if [ $dir != 'temp' ]; then
+        # Retain only logs and other files in temp, safely ignore
+        # 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
         fi
     done
 
     # Need to add pseudo back or subsqeuent work in this workdir
     # 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
     # fact WORKDIR is now empty