title: Yocto SDK missing kernel header files
body: <p>I have a kernel module that I have successfully compiled against my toolchain and installed in the image. The driver loads just fine and functions as expected. The user program that uses the driver is a cmake project in CLion 2020.1. I set up the cmake project to point to the OEToolchainConfig.cmake so all the</p>
  <pre><code>#include&lt;foo.h&gt; 
  </code></pre>
  <p>are resolved. All except a number of kernel headers; for example: &lt;linux/devices.h&gt;</p>
  <p><em><strong>Edit</strong></em></p>
  <p>To be clear, there <em>are</em> linux header files that are resolved. for example:</p>
  <pre><code>#include &lt;linux/kernel.h&gt;
  #include &lt;linux/module.h&gt;
  </code></pre>
  <p>I only seem to be missing a subset of kernel header files...</p>
  <p><em><strong>end Edit</strong></em></p>
  <p>After navigating to the sysroot toolchain /usr/includes/linux directory I verified the missing/unresolved kernel headers are in fact not present.</p>
  <p>So, there are 2 questions here: 1) How did I successfully compile the driver against the toolchain if the required kernel headers are missing &amp; 2) how do I include the missing kernel headers in the SDK?</p>
  <p>I suspect the answer to the first question is that bitbake grabbed the host's kernel header files in which case question 1 becomes how do I prevent that from happening; just a guess though. For question 2 (my main question), after probing the google machine, I found references to add:</p>
  <pre><code>IMAGE_INSTALL += &quot;\
                  kernel-devsrc \
                  linux-libc-headers-dev \
                  python&quot;
  </code></pre>
  <p>to my core-image-myimage_1.0.bb file but this does not seem to add the headers I require.</p>
  <p><strong>Update</strong>
  It would appear the header files i require are  in fact installed into the tool chain but they are installed under source: /usr/src/kernel/include/linux</p>
  <p>while this allows me a workaround for setting up include paths in CLion, is there some reason I cannot get these to install into the regular:/usr/include/linux directroy?</p>