<?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>13727</bug_id>
          
          <creation_ts>2020-01-09 00:01:23 +0000</creation_ts>
          <short_desc>unable to run dockerd on MACHINE=intel-corei7-64 yet works on MACHINE=genericx86-64</short_desc>
          <delta_ts>2020-06-30 16:05:20 +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>BSPs</product>
          <component>bsps-meta-intel</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>x86_64</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 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Kevin Saye">ksaye</reporter>
          <assigned_to name="Kevin Saye">ksaye</assigned_to>
          <cc>bruce.ashfield</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>tim.orling</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>85989</commentid>
    <comment_count>0</comment_count>
    <who name="Kevin Saye">ksaye</who>
    <bug_when>2020-01-09 00:01:23 +0000</bug_when>
    <thetext>Yocto version: warrior
build OS: Ubuntu 18.04 lts


This issue is discussed here: https://github.com/Azure/meta-iotedge/issues/26#issuecomment-572270282

Using the meta-intel layer and the machine=intel-corei7-64, there are features missing in the kernel that limit the ability to start docker.

Docker gives the error:

pickfirstBalancer: HandleSubConnStateChange: 0xc0007c6b80, CONNECTING module=grpc
failed to start daemon: Error initializing network controller: Error creating default &quot;bridge&quot; network: Failed to program NAT chain: Failed to inject DOCKER in PREROUTING chain: iptables failed: iptables --wait -t nat -A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER: iptables: No chain/target/match by that name.

Running the docker check-config.sh script (https://github.com/moby/moby/blob/master/contrib/check-config.sh) it shows several kernel features missing, most specifically: CONFIG_VETH and CONFIG_NETFILTER_XT_MATCH_ADDRTYPE.

If I change the machine to genericx86-64, it works fine

Here is my full build script: https://github.com/ksaye/IoTDemonstrations/blob/master/batch/run.sh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86017</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2020-01-10 06:40:53 +0000</bug_when>
    <thetext>This issue is that the kernel recipe is not being bbappended to include ${BPN}_virtualiation.inc

See:
http://git.yoctoproject.org/cgit/cgit.cgi/meta-virtualization/tree/recipes-kernel/linux?h=warrior

Each linux kernel recipe needs a bbappend and a named/symlinked ${BPN}_virtualization.inc, e.g. linux-intel_birtualization.inc and linux-intel_%.bbappend

You can add these to e.g. dynamic-layers/virtualization-layer/recipes-kernel/linux

In other words, meta-virtualization is hard coded to only work with linux-yocto at the moment, so it doesn&apos;t understand linux-intel which is set by intel-corei7-64 machine.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86020</commentid>
    <comment_count>2</comment_count>
    <who name="Kevin Saye">ksaye</who>
    <bug_when>2020-01-10 18:42:14 +0000</bug_when>
    <thetext>Tim,
  Thanks for the investigation.  I did a little testing and the following copy commands do resolve the issue, meaing that your assessment is correct.

cp meta-virtualization/recipes-kernel/linux/linux-yocto_4.19.bbappend meta-virtualization/recipes-kernel/linux/linux-intel_4.19.bbappend 

cp meta-virtualization/recipes-kernel/linux/linux-yocto_virtualization.inc meta-virtualization/recipes-kernel/linux/linux-intel_virtualization.inc

  While this works for me and unblocks me today, what do you recommend for a larger fix?

Kevin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86022</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2020-01-10 21:20:47 +0000</bug_when>
    <thetext>We are coincidentally working on this internally, hence the solution was already known (but not public yet).

I see two possible paths forward:

(1) meta-intel adds the necessary bbappends and incs to dynamic-layers (this is up to Anuj to decide as he is the final word on meta-intel).
{2) meta-virtualization adds the necessary linux-intel files (this is up to Bruce Ashfield as he is the final word on meta-virtualization).

There is probably a third better option than makes the meta-virtualization bbappends more universally applicable. We should start discussion on the meta-virtualization mailing list [1]. There might even be an opportunity to move this to oe-core, but regardless the discussion belongs on the meta-virtualization mailing list.

Backporting to &quot;warrior&quot; might be contentious, so just a heads up that you may need to carry technical debt until you move to 3.1 release (currently &quot;master&quot;). I will assume you have a business need to be on &quot;warrior&quot;, rather than ask you why you can&apos;t move to a newer release.

[1] https://lists.yoctoproject.org/g/meta-virtualization</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86023</commentid>
    <comment_count>4</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-01-10 21:29:09 +0000</bug_when>
    <thetext>Since the linux-intel recipes are good citizens and support fragments, we can make the bappends more generic. If other users of meta-virt have kernel recipes that match, and don&apos;t have fragment support .. they won&apos;t be harmed either (since they&apos;ll just be ignored).

So something like linux-%_&lt;version&gt;.bbappend in meta-virt should meet the need (I *think* the wildcard will work like that in the middle, otherwise, even linux-%.bbappend could be considered).

(In reply to comment #3)
&gt; We are coincidentally working on this internally, hence the solution was
&gt; already known (but not public yet).
&gt; 
&gt; I see two possible paths forward:
&gt; 
&gt; (1) meta-intel adds the necessary bbappends and incs to dynamic-layers (this
&gt; is up to Anuj to decide as he is the final word on meta-intel).
&gt; {2) meta-virtualization adds the necessary linux-intel files (this is up to
&gt; Bruce Ashfield as he is the final word on meta-virtualization).
&gt; 
&gt; There is probably a third better option than makes the meta-virtualization
&gt; bbappends more universally applicable. We should start discussion on the
&gt; meta-virtualization mailing list [1]. There might even be an opportunity to
&gt; move this to oe-core, but regardless the discussion belongs on the
&gt; meta-virtualization mailing list.
&gt; 
&gt; Backporting to &quot;warrior&quot; might be contentious, so just a heads up that you
&gt; may need to carry technical debt until you move to 3.1 release (currently
&gt; &quot;master&quot;). I will assume you have a business need to be on &quot;warrior&quot;, rather
&gt; than ask you why you can&apos;t move to a newer release.
&gt; 
&gt; [1] https://lists.yoctoproject.org/g/meta-virtualization</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86602</commentid>
    <comment_count>5</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-02-26 22:04:53 +0000</bug_when>
    <thetext>I&apos;ve pushed a patch to meta-virtualization that should resolve this.

If anyone is available to quickly test it, that would be helpful. I&apos;d rather not close this until we get confirmation.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86616</commentid>
    <comment_count>6</comment_count>
    <who name="Kevin Saye">ksaye</who>
    <bug_when>2020-02-28 00:01:28 +0000</bug_when>
    <thetext>I am testing the patch now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86617</commentid>
    <comment_count>7</comment_count>
    <who name="Kevin Saye">ksaye</who>
    <bug_when>2020-02-28 00:47:06 +0000</bug_when>
    <thetext>It still seems to fail on me.

My source is here: https://github.com/ksaye/IoTDemonstrations/blob/master/batch/inteltest.sh

If I comment out lines 56 and 57, it still fails.  Am i missing something?

K</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86619</commentid>
    <comment_count>8</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-02-28 04:15:07 +0000</bug_when>
    <thetext>I&apos;ll have a look at linux-intel and run some tests.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86626</commentid>
    <comment_count>9</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-02-28 21:22:16 +0000</bug_when>
    <thetext>I can confirm that linux-intel does now use the fragments from meta-virt:

bitbake -e shows:

SRC_URI=&quot;            git://github.com/intel/linux-intel-lts.git;protocol=https;name=machine;branch=5.4/yocto;            git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-5.4;destsuffix=kernel-meta            file://perf-fix-build-with-binutils.patch           file://xt-checksum.scc             file://ebtables.scc           file://vswitch.scc      file://lxc.scc             file://docker.scc              file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-.patch&quot;

If someone can let me know hot to boot the image in qemu (I&apos;m failing on systemd startup), I can also do a docker runtime test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86628</commentid>
    <comment_count>10</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-02-28 21:34:06 +0000</bug_when>
    <thetext>Cancel that. I hacked the fstab and was able to boot:

root@intel-corei7-64:~# docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
bdbbaa22dec6: Pull complete 
Digest: sha256:6915be4043561d64e0ab0f8f098dc2ac48e077fe23f488ac24b665166898115a
Status: Downloaded newer image for busybox:latest
docker.io/library/busybox:latest
root@intel-corei7-64:~# docker run -it busybox /bin/sh
docker0: port 1(veth1a3a75a) entered blocking state
docker0: port 1(veth1a3a75a) entered disabled state
device veth1a3a75a entered promiscuous mode
eth0: renamed from vethd917b53
IPv6: ADDRCONF(NETDEV_CHANGE): veth1a3a75a: link becomes ready
docker0: port 1(veth1a3a75a) entered blocking state
docker0: port 1(veth1a3a75a) entered forwarding state
IPv6: ADDRCONF(NETDEV_CHANGE): docker0: link becomes ready
/ # docker0: port 1(veth1a3a75a) entered disabled state
vethd917b53: renamed from eth0
docker0: port 1(veth1a3a75a) entered disabled state
device veth1a3a75a left promiscuous mode
docker0: port 1(veth1a3a75a) entered disabled state
root@intel-corei7-64:~# uname -a
Linux intel-corei7-64 5.4.15-intel-pk-standard #1 SMP PREEMPT Thu Feb 6 03:40:33 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
root@intel-corei7-64:~#</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86643</commentid>
    <comment_count>11</comment_count>
    <who name="Kevin Saye">ksaye</who>
    <bug_when>2020-03-02 21:04:28 +0000</bug_when>
    <thetext>Bruce,
  You seem to be on the 5.4.15 kernel where I am on:

Linux intel-corei7-64 4.19.80-intel-pk-standard #1 SMP PREEMPT Fri Feb 28 00:34:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Note my work around copy commands copy to linux-intel_4.19.bbappend 

Kevin</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86644</commentid>
    <comment_count>12</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2020-03-02 21:16:18 +0000</bug_when>
    <thetext>I realize I&apos;m on 5.4, I&apos;m only working on master for these changes. Testing other branches and requesting a backport needs to be done by someone with the relevant test capabilities.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86654</commentid>
    <comment_count>13</comment_count>
    <who name="Chee Yang">chee.yang.lee</who>
    <bug_when>2020-03-04 06:58:58 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; Bruce,
&gt;   You seem to be on the 5.4.15 kernel where I am on:
&gt; 
&gt; Linux intel-corei7-64 4.19.80-intel-pk-standard #1 SMP PREEMPT Fri Feb 28
&gt; 00:34:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
&gt; 
&gt; Note my work around copy commands copy to linux-intel_4.19.bbappend 
&gt; 
&gt; Kevin

meta-intel master just added bbappend for linux-intel 4.19
http://git.yoctoproject.org/cgit/cgit.cgi/meta-intel/commit/?id=108c6938a9b8a71b94d2e8d368c2f39e6ec20530

can you try that?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86658</commentid>
    <comment_count>14</comment_count>
    <who name="Kevin Saye">ksaye</who>
    <bug_when>2020-03-04 17:35:02 +0000</bug_when>
    <thetext>I have tried that and it did not resolve it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86815</commentid>
    <comment_count>15</comment_count>
    <who name="Chee Yang">chee.yang.lee</who>
    <bug_when>2020-03-26 04:47:13 +0000</bug_when>
    <thetext>(In reply to comment #14)
&gt; I have tried that and it did not resolve it.

i build it this way and it works. can you try that ?
https://github.com/cheeyanglee/IoTDemonstrations/commit/d9aef05e9772471e2766236a36753e24c2f6ea6e#diff-f5dc6c0071ef0304136c91697342c0ef</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87542</commentid>
    <comment_count>16</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2020-06-22 18:30:01 +0000</bug_when>
    <thetext>Kevin, it looks like we are waiting for confirmation from you of the fix. Can you please test and leave comments on whether it meets your needs?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87632</commentid>
    <comment_count>17</comment_count>
    <who name="Kevin Saye">ksaye</who>
    <bug_when>2020-06-26 13:01:11 +0000</bug_when>
    <thetext>(In reply to comment #16)
&gt; Kevin, it looks like we are waiting for confirmation from you of the fix.
&gt; Can you please test and leave comments on whether it meets your needs?

Thanks for the reminder, should have this tested by Tuesday 6/30.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87664</commentid>
    <comment_count>18</comment_count>
    <who name="Kevin Saye">ksaye</who>
    <bug_when>2020-06-30 16:05:20 +0000</bug_when>
    <thetext>All,  I just verified that the fix works as planned.  Thanks all for the resolution!

Kevin</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>