[OE-core] [PATCH 1/1] image_types_wic: schedule prepare_wic_build correctly

Ed Bartosh ed.bartosh at linux.intel.com
Fri May 26 13:49:55 UTC 2017


When EFI is enabled we need to ensure that kernel and bootloader
artifacts are fully deployed before running prepare_wic_build.
This is done by scheduling this task after do_bootimg and
by adding dependencty to virtual/kernel:do_deploy task.

Scheduled prepare_wic_build only if wic build is enabled to
avoid running it when it's not needed.

Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
---
 meta/classes/image_types_wic.bbclass | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/meta/classes/image_types_wic.bbclass b/meta/classes/image_types_wic.bbclass
index d8430e4..baf375b 100644
--- a/meta/classes/image_types_wic.bbclass
+++ b/meta/classes/image_types_wic.bbclass
@@ -69,6 +69,12 @@ python () {
                 # file in process_wks_template as well, so just put it in
                 # a variable and let the metadata deal with the deps.
                 d.setVar('_WKS_TEMPLATE', body)
+
+        if d.getVar('EFI_CLASS'):
+            bb.build.addtask('do_prepare_wic_build', 'do_image_wic', 'do_bootimg', d)
+            d.appendVarFlag('do_prepare_wic_build', 'depends', 'virtual/kernel:do_deploy')
+        else:
+            bb.build.addtask('do_prepare_wic_build', 'do_image_wic', None, d)
 }
 
 #
@@ -139,19 +145,15 @@ python do_prepare_wic_build() {
         with open(wks_file, 'w') as f:
             f.write(template_body)
 
-    if d.getVar('USING_WIC'):
-        # Generate parition UUID
-        from uuid import uuid4
-        partuuid = str(uuid4())
-        d.setVar("ROOTFS_PARTUUID", partuuid)
+    # Generate parition UUID
+    from uuid import uuid4
+    partuuid = str(uuid4())
+    d.setVar("ROOTFS_PARTUUID", partuuid)
 
-        if d.getVar("EFI_CLASS"):
-            populate_bootfs(partuuid)
+    if d.getVar("EFI_CLASS"):
+        populate_bootfs(partuuid)
 
-        template = d.getVar("_WKS_TEMPLATE")
-        if template:
-            write_wks_template(template, d.getVar('WKS_FULL_PATH'))
+    template = d.getVar("_WKS_TEMPLATE")
+    if template:
+        write_wks_template(template, d.getVar('WKS_FULL_PATH'))
 }
-
-addtask do_prepare_wic_build before do_image_wic
-do_prepare_wic_build[depends] = "${MLPREFIX}${EFI_PROVIDER}:do_deploy virtual/kernel:do_deploy"
-- 
2.1.4




More information about the Openembedded-core mailing list