<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 9, 2016 at 12:43 AM, Paul Eggleton <span dir="ltr">&lt;<a href="mailto:paul.eggleton@linux.intel.com" target="_blank">paul.eggleton@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">A lot of the IMAGE_FSTYPES items require the appropriate filesystem<br>
driver to be enabled in the kernel configuration; e.g. in order to read<br>
a btrfs filesystem, the kernel must enable CONFIG_BTRFS_FS. Add a check<br>
to ensure that is the case.<br></blockquote><div><br></div><div><br></div><div>So what&#39;s the overall design for this ? Is it documented anywhere ? This is something</div><div>that we talked about a couple of years and I have reservations and objections to </div><div>the current implementation.</div><div><br></div><div>.. but since I can only see bits and chunks of patches, I&#39;d rather read something</div><div>complete and offer some more detailed feedback.</div><div><br></div><div>Bottom line: I see a slippery slope to tightly specified option that depend on kernel</div><div>versions, I see kernel options sprayed all over layers, etc, etc. Which is exactly</div><div>what we&#39;ve been trying to avoid with the centralized kernel meta-data, and again,</div><div>there&#39;s a mechanism that I finished early this year to extend those options to any</div><div>kernel, enforce, warn, error, etc .. but now, I&#39;ll just toss it into the bin.</div><div><br></div><div>Cheers,</div><div><br></div><div>Bruce</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Fixes [YOCTO #5574].<br>
<br>
Signed-off-by: Paul Eggleton &lt;<a href="mailto:paul.eggleton@linux.intel.com">paul.eggleton@linux.intel.com</a>&gt;<br>
---<br>
 meta/classes/image.bbclass       | 23 +++++++++++++++++++++++<br>
 meta/classes/image_types.bbclass | 11 +++++++++++<br>
 2 files changed, 34 insertions(+)<br>
<br>
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass<br>
index 4542e95..c56b053 100644<br>
--- a/meta/classes/image.bbclass<br>
+++ b/meta/classes/image.bbclass<br>
@@ -238,9 +238,32 @@ do_rootfs[cleandirs] += &quot;${S}&quot;<br>
 do_rootfs[umask] = &quot;022&quot;<br>
 addtask rootfs before do_build<br>
<br>
+inherit kernel-check<br>
+<br>
+def check_image_fstypes_kernel(d):<br>
+    &quot;&quot;&quot;<br>
+    Check that the kernel we have built has the appropriate config options enabled<br>
+    to support the image formats specified in IMAGE_FSTYPES<br>
+    &quot;&quot;&quot;<br>
+    fstypes = (d.getVar(&#39;IMAGE_FSTYPES&#39;, True) or &#39;&#39;).split()<br>
+    ctypes = (d.getVar(&#39;COMPRESSIONTYPES&#39;, True) or &#39;&#39;).split()<br>
+    for fstype in fstypes:<br>
+        kernconfig = (d.getVar(&#39;IMAGE_TYPE_KERNEL_OPTIONS_&#39; + fstype, True) or &#39;&#39;).split()<br>
+        for ctype in ctypes:<br>
+            if fstype.endswith(&quot;.&quot; + ctype):<br>
+                basetype = fstype[:-len(&quot;.&quot; + ctype)]<br>
+                kernconfig.extend((d.getVar(&#39;IMAGE_TYPE_KERNEL_OPTIONS_&#39; + basetype, True) or &#39;&#39;).split())<br>
+        kernconfig = list(set(kernconfig))<br>
+        if kernconfig:<br>
+            missing, diffvalue = check_kernel_config_options(kernconfig, d)<br>
+            if missing or diffvalue:<br>
+                bb.warn(&#39;IMAGE_FSTYPES contains %s, but the following required kernel configuration items are not present in the kernel configuration:\n  %s&#39; % (fstype, &#39;\n  &#39;.join(missing + [&#39;%s=%s (actual value %s)&#39; % item for item in diffvalue])))<br>
+<br>
 fakeroot python do_image () {<br>
     from oe.utils import execute_pre_post_process<br>
<br>
+    check_image_fstypes_kernel(d)<br>
+<br>
     pre_process_cmds = d.getVar(&quot;IMAGE_PREPROCESS_COMMAND&quot;, True)<br>
<br>
     execute_pre_post_process(d, pre_process_cmds)<br>
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass<br>
index 53af7ca..dd79726 100644<br>
--- a/meta/classes/image_types.bbclass<br>
+++ b/meta/classes/image_types.bbclass<br>
@@ -240,6 +240,17 @@ IMAGE_DEPENDS_ubifs = &quot;mtd-utils-native&quot;<br>
 IMAGE_DEPENDS_multiubi = &quot;mtd-utils-native&quot;<br>
 IMAGE_DEPENDS_wic = &quot;parted-native&quot;<br>
<br>
+IMAGE_TYPE_KERNEL_OPTIONS_jffs2 = &quot;CONFIG_JFFS2_FS&quot;<br>
+IMAGE_TYPE_KERNEL_OPTIONS_jffs2.sum = &quot;CONFIG_JFFS2_SUMMARY&quot;<br>
+IMAGE_TYPE_KERNEL_OPTIONS_cramfs = &quot;CONFIG_CRAMFS&quot;<br>
+IMAGE_TYPE_KERNEL_OPTIONS_ext2 = &quot;CONFIG_EXT2_FS|CONFIG_EXT4_USE_FOR_EXT23&quot;<br>
+IMAGE_TYPE_KERNEL_OPTIONS_ext3 = &quot;CONFIG_EXT3_FS|CONFIG_EXT4_USE_FOR_EXT23&quot;<br>
+IMAGE_TYPE_KERNEL_OPTIONS_ext4 = &quot;CONFIG_EXT4_FS&quot;<br>
+IMAGE_TYPE_KERNEL_OPTIONS_btrfs = &quot;CONFIG_BTRFS_FS&quot;<br>
+IMAGE_TYPE_KERNEL_OPTIONS_squashfs = &quot;CONFIG_SQUASHFS&quot;<br>
+IMAGE_TYPE_KERNEL_OPTIONS_squashfs-xz = &quot;CONFIG_SQUASHFS_XZ&quot;<br>
+IMAGE_TYPE_KERNEL_OPTIONS_squashfs-lzo = &quot;CONFIG_SQUASHFS_LZO&quot;<br>
+<br>
 # This variable is available to request which values are suitable for IMAGE_FSTYPES<br>
 IMAGE_TYPES = &quot; \<br>
     jffs2 jffs2.sum \<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.5<br>
<br>
--<br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">&quot;Thou shalt not follow the NULL pointer, for chaos and madness await thee at its end&quot;</div>
</div></div>