<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 11, 2017 at 9:55 PM, Alejandro Hernandez <span dir="ltr">&lt;<a href="mailto:alejandro.hernandez@linux.intel.com" target="_blank">alejandro.hernandez@linux.intel.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Tom Zanussi &lt;<a href="mailto:tom.zanussi@linux.intel.com">tom.zanussi@linux.intel.com</a>&gt;<br>
<br>
Rather than create an actual image, just put the image artifacts in an<br>
&#39;artifacts&#39; directory that can then be picked up by wic.<br>
<br></blockquote><div><br></div><div>This is a desired goal now that wic is more widely used. However, any particular</div><div>reason why the implementation talks about &quot;live&quot; and copies what the live image</div><div>do_bootimg gives? </div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Signed-off-by: Alejandro Hernandez &lt;<a href="mailto:alejandro.hernandez@linux.intel.com">alejandro.hernandez@linux.<wbr>intel.com</a>&gt;<br>
Signed-off-by: Tom Zanussi &lt;<a href="mailto:tom.zanussi@linux.intel.com">tom.zanussi@linux.intel.com</a>&gt;<br>
---<br>
 meta/classes/image-live-<wbr>artifacts.bbclass | 40 ++++++++++++++++++++++++++++++<wbr>+<br>
 meta/classes/image.bbclass                |  3 +++<br>
 meta/classes/image_types.<wbr>bbclass          |  2 ++<br>
 3 files changed, 45 insertions(+)<br>
 create mode 100644 meta/classes/image-live-<wbr>artifacts.bbclass<br>
<br>
diff --git a/meta/classes/image-live-<wbr>artifacts.bbclass b/meta/classes/image-live-<wbr>artifacts.bbclass<br>
new file mode 100644<br>
index 0000000..1501a9b<br>
--- /dev/null<br>
+++ b/meta/classes/image-live-<wbr>artifacts.bbclass<br>
@@ -0,0 +1,40 @@<br>
+# Create the artifacts only on an ARTIFACTS_DIR,<br>
+# which can be later picked up by wic<br>
+<br>
+inherit live-vm-common<br>
+<br>
+do_bootimg[depends] += &quot;dosfstools-native:do_<wbr>populate_sysroot \<br></blockquote><div><br></div><div>perhaps have &#39;do_image_artifacts&#39; and let users/other classes set additional dependencies.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                        mtools-native:do_populate_<wbr>sysroot \<br>
+                        cdrtools-native:do_populate_<wbr>sysroot \<br>
+                        virtual/kernel:do_deploy \<br>
+                        ${MLPREFIX}syslinux:do_<wbr>populate_sysroot \<br>
+                        syslinux-native:do_populate_<wbr>sysroot \<br></blockquote><div><br></div><div>For example, if I use systemd-boot I don&#39;t need syslinux built at all. The EFI_CLASS/PCBIOS_CLASS</div><div>could define the additional depends here (like they are currently doing for bootimg/bootdirectdisk).</div><div><br></div><div>The defaults should be just kernel and initrd(s) (if defined).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+                        ${@oe.utils.ifelse(d.getVar(&#39;<wbr>COMPRESSISO&#39;, False),&#39;zisofs-tools-native:<wbr>do_populate_sysroot&#39;,&#39;&#39;)} \<br>
+                        &quot;<br>
+<br>
+<br>
+LABELS_LIVE ?= &quot;boot install&quot;<br>
+<br>
+ARTIFACTS_DIR = &quot;${DEPLOY_DIR_IMAGE}/<wbr>artifacts&quot;<br>
+<br>
+populate_bootloader() {<br>
+       populate_kernel ${ARTIFACTS_DIR}<br>
+<br>
+       if [ &quot;${PCBIOS}&quot; = &quot;1&quot; ]; then<br>
+               syslinux_hddimg_populate ${ARTIFACTS_DIR}<br>
+       fi<br>
+       if [ &quot;${EFI}&quot; = &quot;1&quot; ]; then<br>
+               efi_hddimg_populate ${ARTIFACTS_DIR}<br>
+       fi<br>
+}<br>
+<br>
+python do_bootimg() {<br>
+    set_live_vm_vars(d, &#39;LIVE&#39;)<br>
+    if d.getVar(&quot;PCBIOS&quot;, True) == &quot;1&quot;:<br>
+        bb.build.exec_func(&#39;build_<wbr>syslinux_cfg&#39;, d)<br>
+    if d.getVar(&quot;EFI&quot;, True) == &quot;1&quot;:<br>
+        bb.build.exec_func(&#39;build_efi_<wbr>cfg&#39;, d)<br>
+    bb.build.exec_func(&#39;populate_<wbr>bootloader&#39;, d)<br>
+}<br>
+<br>
+addtask bootimg before do_image_complete<br>
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass<br>
index 04fd5f9..fd249c8 100644<br>
--- a/meta/classes/image.bbclass<br>
+++ b/meta/classes/image.bbclass<br>
@@ -130,6 +130,9 @@ do_rootfs[vardeps] += &quot;${@rootfs_variables(d)}&quot;<br>
 do_build[depends] += &quot;virtual/kernel:do_deploy&quot;<br>
<br>
 def build_live(d):<br>
+    if bb.utils.contains(&quot;IMAGE_<wbr>FSTYPES&quot;, &quot;live-artifacts-only&quot;, &quot;live-artifacts-only&quot;, &quot;0&quot;, d) == &quot;live-artifacts-only&quot;:<br>
+         return &quot;image-live-artifacts&quot;<br></blockquote><div><br></div><div>Is there a need for the image artifacts for other than wic? It could be made so that if wic is in IMAGE_FSTYPES,</div><div>image-artifacts are built by default. This means the logic of inheriting image-artifacts has a better place, e.g.,</div><div>in it&#39;s own build_wic() check.</div><div><br></div><div>-- Mikko</div></div></div></div>