<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13927</bug_id>
          
          <creation_ts>2020-06-02 06:48:24 +0000</creation_ts>
          <short_desc>[meta-virtualization] KERNEL_FEATURES_append vs. SRC_URI +=</short_desc>
          <delta_ts>2020-08-28 20:10:49 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>kernel</component>
          <version>3.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.2 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Berger">pokylinux</reporter>
          <assigned_to name="Bruce Ashfield">bruce.ashfield</assigned_to>
          <cc>randy.macleod</cc>
    
    <cc>tim.orling</cc>
    
    <cc>tom.zanussi</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>87385</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2020-06-02 06:48:24 +0000</bug_when>
    <thetext>1) I don&apos;t quite get the difference between 

KERNEL_FEATURES_append (whatever that is) and SRC_URI +=

https://git.yoctoproject.org/cgit/cgit.cgi/meta-virtualization/tree/recipes-kernel/linux/linux-yocto_virtualization.inc?h=dunfell

up to line 17 KERNEL_FEATURES_append is used, then SRC_URI +=

what&apos;s the difference?

2) In my custom kernel stuff I had to make this change for it to work

+#KERNEL_FEATURES_append = &quot; cfg/virtio.scc&quot;
+SRC_URI += &quot;file://features/virtio/virtio.scc&quot;

3) in case the same files exists in meta-virtualization and in my layer which will be used?

in meta-virtualization we have:

./recipes-kernel/linux/linux-yocto/vswitch.scc
./recipes-kernel/linux/linux-yocto/docker.scc
./recipes-kernel/linux/linux-yocto/xt-checksum.scc
./recipes-kernel/linux/linux-yocto/ebtables.scc
./recipes-kernel/linux/linux-yocto/lxc.scc
./recipes-kernel/linux/linux-yocto/xen.scc


in my layer we have:

./recipes-kernel/linux/config/multi-v7-ml-base/features/vswitch/vswitch.scc
./recipes-kernel/linux/config/multi-v7-ml-base/features/docker/docker.scc
./recipes-kernel/linux/config/multi-v7-ml-base/features/xt-checksum/xt-checksum.scc
./recipes-kernel/linux/config/multi-v7-ml-base/features/ebtables/ebtables.scc
./recipes-kernel/linux/config/multi-v7-ml-base/features/lxc/lxc.scc
./recipes-kernel/linux/config/multi-v7-ml-base/features/virtio/virtio.scc &lt;-- only here</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87386</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2020-06-02 06:50:04 +0000</bug_when>
    <thetext>KERNEL_FEATURES is documented here:

https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#var-KERNEL_FEATURES</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87387</commentid>
    <comment_count>2</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-06-02 08:53:03 +0000</bug_when>
    <thetext>The .inc file needs some tidying up. I see a few different mechanisms mixing in there, += and _append, and even += AND _append. We can just use _append and it should be ok.

The elements in that file have migrated from different places in the layer and hence had different formatting standards/techniques and even were done certain ways for evaluation time issues.

but the difference between KERNEL_FEATURES append and SRC_URI is on purpose.

KERNEL_FEATURES come from the main kernel-cache, and are sanity checked for failure. They are also, by design, the last element applied to the merging process, since they signify a strict dependency.

SRC_URI fragments are merged and applied using the normal fragment rules.

Everything is working in all the meta-virt sanity tests that I have, what is failing in your broken case ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87390</commentid>
    <comment_count>3</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2020-06-03 03:16:50 +0000</bug_when>
    <thetext>I just needed to make some adjustments to be able to work with dunfell compared to zeus.

e.g. since I use my own custom-yocto-kernel recipe I don&apos;t have this:

KERNEL_FEATURES_append = &quot; cfg/virtio.scc&quot;

but I have that

SRC_URI += &quot;file://features/virtio/virtio.scc&quot;

This is at the moment the only thing which troubles me a bit, since I needed to patch meta-virtualization, which I usually try to avoid.

Here[1] is some part of the BSP and I guess you are after this[2]

[1] https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp/-/tree/dunfell

[2] https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp/-/tree/dunfell/recipes-kernel/linux

For a &quot;virtualization&quot; kernel (which is able to run docker) I have this kernel type[3]

It pull in my standard kernel config[4] and the virtualization config[5] on top.

Now it also adds some extra thingy ;)[6]

[3] https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp/-/blob/dunfell/recipes-kernel/linux/config/multi-v7-ml-base/ktypes/virt/virt.scc

[4] https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp/-/blob/dunfell/recipes-kernel/linux/config/multi-v7-ml-base/features-collection/std-collection.scc

[5] https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp/-/blob/dunfell/recipes-kernel/linux/config/multi-v7-ml-base/features-collection/virt-addon-collection.scc

[6] https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp/-/blob/dunfell/recipes-kernel/linux/linux-yocto-custom-common_5.4.inc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87392</commentid>
    <comment_count>4</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-06-03 05:45:26 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; I just needed to make some adjustments to be able to work with dunfell
&gt; compared to zeus.
&gt; 
&gt; e.g. since I use my own custom-yocto-kernel recipe I don&apos;t have this:
&gt; 
&gt; KERNEL_FEATURES_append = &quot; cfg/virtio.scc&quot;
&gt; 
&gt; but I have that
&gt; 
&gt; SRC_URI += &quot;file://features/virtio/virtio.scc&quot;

I&apos;ll have a look at your links in a bit more detail shortly, but I do have a question about this.

With the current .inc, are you seeing your virtio.scc not applied at all ? or some other side effect ?

&gt; 
&gt; This is at the moment the only thing which troubles me a bit, since I needed
&gt; to patch meta-virtualization, which I usually try to avoid.
&gt; 

We can come up with a dunfell solution that doesn&apos;t require you to patch the layer. If the .inc&apos;s aren&apos;t flexible enough, we&apos;ll fix them.

&gt; Here[1] is some part of the BSP and I guess you are after this[2]
&gt; 
&gt; [1] https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp/-/tree/dunfell
&gt; 
&gt; [2]
&gt; https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp/-/tree/dunfell/recipes-
&gt; kernel/linux
&gt; 
&gt; For a &quot;virtualization&quot; kernel (which is able to run docker) I have this
&gt; kernel type[3]
&gt; 
&gt; It pull in my standard kernel config[4] and the virtualization config[5] on
&gt; top.
&gt; 
&gt; Now it also adds some extra thingy ;)[6]

If possible, can you share a local.conf and bblayers.conf to setup your build ? I can spin something up here and see for myself.

Bruce

&gt; 
&gt; [3]
&gt; https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp/-/blob/dunfell/recipes-
&gt; kernel/linux/config/multi-v7-ml-base/ktypes/virt/virt.scc
&gt; 
&gt; [4]
&gt; https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp/-/blob/dunfell/recipes-
&gt; kernel/linux/config/multi-v7-ml-base/features-collection/std-collection.scc
&gt; 
&gt; [5]
&gt; https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp/-/blob/dunfell/recipes-
&gt; kernel/linux/config/multi-v7-ml-base/features-collection/virt-addon-
&gt; collection.scc
&gt; 
&gt; [6]
&gt; https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp/-/blob/dunfell/recipes-
&gt; kernel/linux/linux-yocto-custom-common_5.4.inc</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87394</commentid>
    <comment_count>5</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2020-06-03 10:02:28 +0000</bug_when>
    <thetext>if you can give me ssh access somewhere I can set it up for you, or I can set up something and give you ssh access, otherwise you need these layers:

git://github.com/RobertBerger/poky branch: 2020-05-26-dunfell-3.1+

https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp.git branch: dunfell

https://gitlab.com/meta-layers/meta-u-boot-wic-bsp.git branch: dunfell

https://gitlab.com/meta-layers/meta-resy.git branch: dunfell

git://github.com/RobertBerger/meta-openembedded branch: 2020-04-30-dunfell-3.1

git://github.com/RobertBerger/meta-virtualization branch: 2020-04-30-dunfell-3.1

git://github.com/RobertBerger/meta-wifi-credentials branch: dunfell

--------

I have them all under /workdir/sources

--------

In one of the layers is the templateconf I use:
meta-u-boot-wic-bsp/template-imx6q-phytec-mira-rdk-nand-virt

bblayer.conf.sample, local.conf.sample, conf-notes.txt

--------

In another layer is the siteconf I use:

meta-resy/template-common/site.conf.sample

--------

to see the problem you can bitbake:

    core-image-minimal
    core-image-minimal-virt-docker-ce

--------

In case I forgot something please let me know.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87403</commentid>
    <comment_count>6</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-06-04 06:07:41 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; if you can give me ssh access somewhere I can set it up for you, or I can
&gt; set up something and give you ssh access, otherwise you need these layers:
&gt; 
&gt; git://github.com/RobertBerger/poky branch: 2020-05-26-dunfell-3.1+
&gt; 
&gt; https://gitlab.com/meta-layers/meta-multi-v7-ml-bsp.git branch: dunfell
&gt; 
&gt; https://gitlab.com/meta-layers/meta-u-boot-wic-bsp.git branch: dunfell
&gt; 
&gt; https://gitlab.com/meta-layers/meta-resy.git branch: dunfell
&gt; 
&gt; git://github.com/RobertBerger/meta-openembedded branch:
&gt; 2020-04-30-dunfell-3.1
&gt; 
&gt; git://github.com/RobertBerger/meta-virtualization branch:
&gt; 2020-04-30-dunfell-3.1
&gt; 
&gt; git://github.com/RobertBerger/meta-wifi-credentials branch: dunfell
&gt; 
&gt; --------
&gt; 
&gt; I have them all under /workdir/sources
&gt; 
&gt; --------
&gt; 
&gt; In one of the layers is the templateconf I use:
&gt; meta-u-boot-wic-bsp/template-imx6q-phytec-mira-rdk-nand-virt
&gt; 
&gt; bblayer.conf.sample, local.conf.sample, conf-notes.txt
&gt; 
&gt; --------
&gt; 
&gt; In another layer is the siteconf I use:
&gt; 
&gt; meta-resy/template-common/site.conf.sample
&gt; 
&gt; --------
&gt; 
&gt; to see the problem you can bitbake:
&gt; 
&gt;     core-image-minimal
&gt;     core-image-minimal-virt-docker-ce
&gt; 
&gt; --------
&gt; 
&gt; In case I forgot something please let me know.

That looks like it should be enough. I&apos;ll try that build locally, and if not, I may take you up on the ssh access offer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87427</commentid>
    <comment_count>7</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-06-04 20:24:43 +0000</bug_when>
    <thetext>I&apos;ve cloned the layers and will have a look on Friday.

Since we are talking about a kernel configuration issue, I&apos;ll streamline the build and just look at virtual/kernel.

And so I&apos;m clear, it is the lack of virtio configuration fragments being applied to the kernel that is the core of the issue. Correct ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87432</commentid>
    <comment_count>8</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2020-06-05 01:58:44 +0000</bug_when>
    <thetext>In this case, if you revert my commit f87eb93151e22cb80bcf56389bb439789f9191f2 the problem is, that cfg/virtio.scc is not being found and the build breaks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87434</commentid>
    <comment_count>9</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-06-05 05:50:13 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; In this case, if you revert my commit
&gt; f87eb93151e22cb80bcf56389bb439789f9191f2 the problem is, that cfg/virtio.scc
&gt; is not being found and the build breaks.

Aha. Yes, that&apos;s what I thought and was surprised when my build worked overnight. I&apos;ll do the revert and start looking.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87435</commentid>
    <comment_count>10</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-06-05 13:45:21 +0000</bug_when>
    <thetext>After having poked at the build, the issue is clear. The KERNEL_FEATURES variable isn&apos;t just a plain .scc file, it contains a subdir, since it has to target some meta-data to construct a not too broad a search (otherwise, you&apos;ll start picking up filesystem order configurations, and that&apos;s bad).

So yes, it targets the layout of the kernel-cache meta data, since that&apos;s what we ensure through validation.

There are two ways to fix it in your bbappend.

a) clone the kernel-cache as part of the SRC_URI and the meta-data will be found a the right place, and all is well.

SRCREV_meta = &quot;aafb8f095e97013d6e55b09ed150369cbe0c6476&quot;
            file://multi-v7-ml-user-patches.scc \
            &quot;
SRC_URI_append += &quot; \
                file://${PATCHPATH}/patches;type=kmeta;destsuffix=patches \
                git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=kernel-meta \
                &quot;
b) if you don&apos;t want the extra meta-data around, then you do need to follow that subdirectory structure, with the way it is currently expressed.

/home/bruce/poky-virt-issue/meta-multi-v7-ml-bsp/recipes-kernel/linux/config/multi-v7-ml-base
build2 [/home/bruc...v7-ml-base]&gt; find cfg
cfg
cfg/virtio.cfg
cfg/virtio.scc

Both of those fix the configuration issue here.

We can also fix the problem in meta-virt, I can always create a secondary variable that is a weak assignment and use that variable in the KERNEL_FEATURES_append. That offers a way for you to easily override it in your layer.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88062</commentid>
    <comment_count>11</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-08-28 20:10:49 +0000</bug_when>
    <thetext>The ability to have dangling kernel features was added to oe-core.

That addresses the core issue in this bug .. that as long as you know what you are doing, you can making missing kernel feature non-fatal.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>