<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">If the issue were <i>just</i> that your FILES_* variables were set incorrectly, you’d at least end up with the .ko file somewhere in your ${WORKDIR}/image (${D}) directory. You’d almost certainly find another one in the build or source
 directory as well (depending on how your .bb/bbclass files define the location of the compilation).<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">The fact that you don’t have one anywhere seems to indicate that your do_compile step isn’t actually generating the .ko that you expect it to, so you’ll need to rewind your recipe creation to working on that step and debug there.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Assuming you’re using poky as a base, what version are you on so I can go read the .bbclass you’re using?<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">-Sean<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><b>From:</b> Wayne Li &lt;waynli329@gmail.com&gt; <br>
<b>Sent:</b> Tuesday, December 10, 2019 12:23 PM<br>
<b>To:</b> McKay, Sean &lt;sean.mckay@hpe.com&gt;<br>
<b>Cc:</b> bitbake-devel &lt;bitbake-devel@lists.openembedded.org&gt;; Yocto Project Discussion &lt;yocto@yoctoproject.org&gt;<br>
<b>Subject:</b> Re: [yocto] Question about shipping files to package.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">I did a find for any files with a kvm and a .ko in its name throughout my entire workspace and nothing came up.&nbsp; But anyway, thanks for the explanation.&nbsp; Could packaging the files wrong (i.e. setting the FILES variable wrong) cause the
 kvm.ko file to never show up at all?&nbsp; I guess that couldn't be the case though because the .ko files are created first before it gets packaged up so if they were created in the first place a search through my entire workspace would turn them up.&nbsp; Is that correct?<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, Dec 5, 2019 at 11:14 PM McKay, Sean &lt;<a href="mailto:sean.mckay@hpe.com">sean.mckay@hpe.com</a>&gt; wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I’m not an expert on compiling kernel modules, but I can at least answer some of your questions to get started. I’m also not an actual expert, but just another user, so it’s entirely
 possible that someone more knowledgeable will come along and tell us that I’m wrong.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">With that said, first, I have to ask the simple stuff: when you say that no .ko is being created, where are you looking? If you’re not sure where you should be looking, I’d recommend
 by doing a find inside of your ${WORKDIR} to see whether or not you’ve got any .ko files. They won’t quite be out in plain sight.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">In general (though again, I can’t speak for the module class), compilations take place in a build directory inside of the recipe’s workdir (${B} in bitbake parlance). The install
 process then copies the created files to a staging directory (${D} in bitbake parlance) that’s usually ${WORKDIR}/image.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Packaging is the process of taking those output files from ${D} and packaging them into one of a few well defined packaging formats. If you’re using the defaults, this would be
 RPM. A single recipe can (and often does) produce multiple packages. When bitbake moves onto the packaging step (I’m simplifying a bit), it creates directories for each package that’s going to be generated inside of ${WORKDIR}/packages-split. It then looks
 at the FILES variable for the particular package it’s working on and copies any files that match the patterns in that variable into that package’s directory in packages-split. When it’s done copying files, each of those directories are turned into the appropriate
 package (probably .rpm) file.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">So, for a somewhat more concrete example, when you said ‘FILES_${PN} &#43;= &quot;/lib/modules/4.1.8-rt8&#43;gbd51baf&quot;’, you told bitbake that anything that matched /lib/modules/4.1.8-rt8&#43;gbd51baf
 should get put in the ${PN} (main) package.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">In the context of the error message you were previously receiving, “installed” is the do_install step, which is referring to that staging process (analogous to running ‘make install’
 on something you just downloaded from the internet). Something is ‘shipped’ if it is packaged into one of the final rpm files.
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Cheers!<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">-Sean McKay<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b>From:</b>
<a href="mailto:yocto@lists.yoctoproject.org" target="_blank">yocto@lists.yoctoproject.org</a> &lt;<a href="mailto:yocto@lists.yoctoproject.org" target="_blank">yocto@lists.yoctoproject.org</a>&gt;
<b>On Behalf Of </b>Wayne Li<br>
<b>Sent:</b> Thursday, December 5, 2019 2:26 PM<br>
<b>To:</b> bitbake-devel &lt;<a href="mailto:bitbake-devel@lists.openembedded.org" target="_blank">bitbake-devel@lists.openembedded.org</a>&gt;; Yocto Project Discussion &lt;<a href="mailto:yocto@yoctoproject.org" target="_blank">yocto@yoctoproject.org</a>&gt;<br>
<b>Subject:</b> [yocto] Question about shipping files to package.<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Dear Yocto Developers,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">So I created a bitbake recipe to integrate kvm into my image as an out-of-tree kernel module.&nbsp; Here's my recipe right now:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
</div>
<div style="margin-left:30.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">LICENSE = &quot;GPLv2&quot;<br>
LIC_FILES_CHKSUM = &quot;<a href="file://COPYING;md5=c616d0e7924e9e78ee192d99a3b26fbd">file://COPYING;md5=c616d0e7924e9e78ee192d99a3b26fbd</a>&quot;<br>
<br>
inherit module<br>
<br>
SRC_URI = &quot;<a href="file:///homead/QorIQ-SDK-V2.0-20160527-yocto/sources/meta-virtualization/recipes-kernel/kvm-kmodule/kvm-kmod-3.10.21.tar.bz2">file:///homead/QorIQ-SDK-V2.0-20160527-yocto/sources/meta-virtualization/recipes-kernel/kvm-kmodule/kvm-kmod-3.10.21.tar.bz2</a>&quot;<br>
<br>
S = &quot;${WORKDIR}/kvm-kmod-3.10.21&quot;<br>
<br>
do_configure() {<br>
&nbsp; &nbsp; ./configure --arch=ppc64 --kerneldir=/homead/QorIQ-SDK-V2.0-20160527-yocto/build_t4240rdb-64b/tmp/work/t4240rdb_64b-fsl-linux/kernel-devsrc/1.0-r0/image/usr/src/kernel<br>
}<br>
<br>
FILES_${PN} &#43;= &quot;/lib/modules/4.1.8-rt8&#43;gbd51baf&quot;<o:p></o:p></p>
</div>
<div style="margin-left:30.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Bitbaking this recipe completes with no problems but no kernel module is created (compiling the source code should create a kernel module file kvm.ko).&nbsp; I was wondering if the problem
 might be because of what I set FILES_${PN} to be.&nbsp; Before I set the FILES variable I was getting an error saying something along the lines of, &quot;Files/directories were installed but not shipped.&quot;&nbsp; Then I more or less just guessed a directory and set my FILES
 variable to it and then the recipe finished bitbaking with no errors.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">But now that the kvm.ko file isn't even being created, I am wondering if it might be because I set the FILES variable wrong?&nbsp; What does the word &quot;ship&quot; mean?&nbsp; And along those lines
 what exactly is a &quot;package&quot; in the setting of Yocto project?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">&nbsp;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">-Thanks!, Wayne Li<o:p></o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>