Skip to contentSkip to conversation

genericx86-common.inc: add dependency do_image_wic -> do_bootimg

PATCH In review Ed Bartosh 2 participants 4 messages Oct 10, 2016 – Oct 12, 2016

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 genericx86-common.inc: add dependency do_image_wic -> do_bootimg

do_image_wic depends on do_bootimg on genericx86 machines as it copies files from hddimg/EFI/BOOT directory to boot partition.

---
 meta-yocto-bsp/conf/machine/include/genericx86-common.inc | 1 +
 1 file changed, 1 insertion(+)
meta-yocto-bsp/conf/machine/include/genericx86-common.inc +1 -0
index 7d3b93f..2e59a95 100644
@@ -23,3 +23,4 @@ EXTRA_OECONF_append_pn-matchbox-panel-2 = " --with-battery=acpi"
 IMAGE_FSTYPES += "wic"
 WKS_FILE ?= "mkefidisk.wks"
 do_image_wic[depends] += "gptfdisk-native:do_populate_sysroot"
+do_image_wic[recrdeptask] += "do_bootimg"
Signature · 1 line
2.1.4
#1 lore raw
Quoted 5 lines · Ed Bartosh

do_image_wic depends on do_bootimg on genericx86 machines as it copies files from hddimg/EFI/BOOT directory to boot partition.

Thoughts on adding
https://github.com/MentorEmbedded/meta-mentor/blob/master/meta-mentor-staging/classes/bootimg-wic.bbclass
to
image.bbclass? I think we can assume the existence of do_bootimg means we should depend on it, as the class was inherited.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
author
#2 lore raw
Quoted 6 lines · Christopher Larson
Quoted 3 lines · Ed Bartosh

do_image_wic depends on do_bootimg on genericx86 machines as it copies files from hddimg/EFI/BOOT directory to boot partition.

Quoted 8 lines
Quoted 2 lines

Thoughts on adding
https://github.com/MentorEmbedded/meta-mentor/blob/master/meta-mentor-staging/classes/bootimg-wic.bbclass
to
image.bbclass? I think we can assume the existence of do_bootimg means we should depend on it, as the class was inherited.

Thank you for the idea! I was looking for something like that.

BTW, even adding dependency without checking anything would work:
do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}"
+do_image_wic[recrdeptask] += "do_bootimg"

but it's too implicit. Your suggestion is much better.

I'll send a patch soon.

--
Regards,
Ed

author
#3 lore raw

PATCH 1/1 image_types.bbclass: add dependency do_image_wic -> do_bootimg

In reply to Christopher Larson

To produce certain types of images wic uses do_bootimg results to assemble final image. For example, it copies BOOT/EFI directory produced by do_bootimg to boot partition for every EFI image.

The tricky part of this is that do_bootimg task is not always run, so we can't always make do_image_wic depend on do_bootimg. We only need to do it if do_bootimg present in task graph.

Thank to Cristopher Larson for this fix.

---
 meta/classes/image_types.bbclass | 5 +++++
 1 file changed, 5 insertions(+)
meta/classes/image_types.bbclass +5 -0
index 5ef6f60..a7fffbc 100644
@@ -219,6 +219,11 @@ USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s
 WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if '${USING_WIC}' else ''}"
 do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}"
 
+python () {
+    if d.getVar('USING_WIC', True) and 'do_bootimg' in d:
+        bb.build.addtask('do_image_wic', '', 'do_bootimg', d)
+}
+
 python do_write_wks_template () {
     """Write out expanded template contents to WKS_FULL_PATH."""
     import re
Signature · 1 line
2.1.4