<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 18.11.2019 19:22, Wayne Li wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAM2K0nrK_LycaTR4N87+3j_LyWtKcSq4fLC5Ramq_MpvGsr1Fg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Dear Yocto Developers,</div>
        <div><br>
        </div>
        <div>I'm trying to incorporate KVM into a Yocto kernel me and my
          coworker build for a T4240 RDB (which has a PowerPC CPU).  The
          problem is, no matter what I do the KVM kernel module (I'm
          expecting a kvm.ko or any .ko file along those lines) is not
          present in the image.</div>
        <div><br>
        </div>
        <div>First I tried adding the content of the .config file
          generated when configuring the kernel for KVM support into the
          kernel configuration file.  This resulted in KVM source
          directories appearing in the kernel but no KVM related kernel
          modules are present.  I explain this in more detail in a
          previous email conversation I had with the Yocto community
          (saved in a Github gist for readability):</div>
      </div>
    </blockquote>
    What is your kenel config? Is KVM built-in (y) or built as module
    (m)?<br>
    <blockquote type="cite"
cite="mid:CAM2K0nrK_LycaTR4N87+3j_LyWtKcSq4fLC5Ramq_MpvGsr1Fg@mail.gmail.com">
      <div dir="ltr">
        <div><br>
        </div>
        <div><a
href="https://gist.github.com/WayneZhenLi/d5d7a5e8c30e6d4b7cd4541d0c24cab5"
            target="_blank" moz-do-not-send="true">https://gist.github.com/WayneZhenLi/d5d7a5e8c30e6d4b7cd4541d0c24cab5</a></div>
        <div><br>
        </div>
        <div>Since then I've tried a few things.  First, I added the
          following lines to the local.conf file (found in
          build_t4240rdb-64b/conf folder):</div>
        <div><br>
        </div>
        <div>
          MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kernel-modules"<br>
          MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS += "kvm-image-minimal"
          <br>
        </div>
      </div>
    </blockquote>
    I din't know which image you are building. Those variables are
    tricky, since<br>
    they only applies when basing on the packagegroup-core-boot
    packagegroup.<br>
    Please refer to the documentation.<br>
    <blockquote type="cite"
cite="mid:CAM2K0nrK_LycaTR4N87+3j_LyWtKcSq4fLC5Ramq_MpvGsr1Fg@mail.gmail.com">
      <div dir="ltr">
        <div><br>
        </div>
        <div>But that didn't seem to work as there weren't any new .ko
          files in the final image.  Next I tried adding the following
          lines to the same local.conf file:</div>
        <div><br>
        </div>
        <div>
          CORE_IMAGE_EXTRA_INSTALL += "kernel-modules"<br>
          CORE_IMAGE_EXTRA_INSTALL += "kvm-image-minimal"</div>
        <div><br>
        </div>
      </div>
    </blockquote>
    Why trying to install the image into image? kvm-image-minimal is not
    a package, it is image recipe.<br>
    The build can definitely break in this case.<br>
    <blockquote type="cite"
cite="mid:CAM2K0nrK_LycaTR4N87+3j_LyWtKcSq4fLC5Ramq_MpvGsr1Fg@mail.gmail.com">
      <div dir="ltr">
        <div>This time I get an error saying "ERROR: kvm-image-minimal
          not found in the base feeds (t4240rdb-64b ppc64e6500 powerpc64
          noarch any all)".  Also if just run a "ERROR: bitbake
          kvm-image-minimal" to see what's going on with that particular
          recipe I get an error saying "kernel-module-kvm-intel" not
          found in the base feeds (t4240rdb-64b ppc64e6500 powerpc64
          noarch any all).</div>
        <div><br>
        </div>
        <div>Would I have to write recipes for the packages listed in
          kvm-image-minimal such as kernel-module-kvm-intel or
          kernel-module-kvm?  Note that I'm not even building the image
          for intel; I'm building it for PowerPC.  Anyway, I just feel
          like writing recipes for the KVM kernel modules isn't the
          correct step.  Like maybe I just messed up my with my
          configuration somehow?  What are your thoughts?</div>
      </div>
    </blockquote>
    IMHO: Simply use IMAGE_INSTALL += "kernel-modules" (IMAGE_INSTALL +=
    "kernel-module-kvm" will likely install just the KVM module)<br>
    in your local.conf to install all built kernel modules. If KVM
    module won't be present in the rootfs, it means it was not built.<br>
    <br>
    Please inspect your kernel work dir (packages-split dir) to find out
    which packages were produced by<br>
    the kernel recipe. It will be something like
    build/tmp/work/XX/linux-yocto/XX/packages-split<br>
    <blockquote type="cite"
cite="mid:CAM2K0nrK_LycaTR4N87+3j_LyWtKcSq4fLC5Ramq_MpvGsr1Fg@mail.gmail.com">
      <div dir="ltr">
        <div><br>
        </div>
        <div>-Thanks!, Wayne Li<br>
        </div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Maciej Pijanowski
Embedded Systems Engineer
<a class="moz-txt-link-freetext" href="https://3mdeb.com">https://3mdeb.com</a> | @3mdeb_com</pre>
  </body>
</html>