Bug 7114 - rm_work for rootfs skipping the RM_WORK_EXCLUDE variable, results in a wic images with empty rootfs
Summary: rm_work for rootfs skipping the RM_WORK_EXCLUDE variable, results in a wic i...
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: 1.8
Hardware: x86 arm
: Undecided normal
Target Milestone: ---
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-01-06 14:18 UTC by Toby Flynn
Modified: 2015-01-08 09:27 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Toby Flynn 2015-01-06 14:18:30 UTC
With version 1.7 adding RM_WORK_EXCLUDE +="image-name"  would leave the rootfs in the work area fully populated and wic would use it to build an image.  After updating to master I began getting empty rootfs images generated by wic.  

I removed the patch 
http://git.openembedded.org/openembedded-core/commit/meta/classes/rm_work.bbclass?id=6bf06d80c2ce03dfdedac5ad8cf42ef8e36b0ecb and then I received fully populated wic images again.

With the patch in place rootfs contents are removed after performing bitbake image-name. The empty rootfs directory is left so wic will succeed in building an image with an empty rootfs and not report an error.
Comment 1 Phlip Balister 2015-01-06 14:44:16 UTC
This change is also in dizzy now and broke some stuff I had running.
Comment 2 Richard Purdie 2015-01-07 16:22:10 UTC
diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass
index 7b1ec17..e68d02a 100644
--- a/meta/classes/rm_work.bbclass
+++ b/meta/classes/rm_work.bbclass
@@ -110,3 +110,11 @@ rm_work_rootfs () {
 }
 rm_work_rootfs[cleandirs] = "${WORKDIR}/rootfs"
 
+python () {
+    # If the recipe name is in the RM_WORK_EXCLUDE, skip the recipe.
+    excludes = (d.getVar("RM_WORK_EXCLUDE", True) or "").split()
+    pn = d.getVar("PN", True)
+    if pn in excludes:
+        d.delVarFlag('rm_work_rootfs', 'cleandirs')
+        d.delVarFlag('rm_work_populatesdk', 'cleandirs')
+}
Comment 3 Phlip Balister 2015-01-07 21:45:11 UTC
That patch resolved the problem for me. Can we get this into dizzy ASAP?
Comment 4 Toby Flynn 2015-01-07 21:59:52 UTC
This patch worked for me. I verified a correct image is generated.