5 Replies Latest reply on May 11, 2015 7:03 PM by terahertz5k

    Creating Kernel Headers package in Yocto env?

    David_J_Hunt

      Hi all,

      Is there an easy way to generate the kernel headers package in the yocto environment?

      Dave.

        • 1. Re: Creating Kernel Headers package in Yocto env?
          JPMontero_Intel

          Hi David_J_Hunt,

           

          I’m sure on the procedure, let me gather more information on how to do it. If I’m able to find something useful I’ll post it over here.

           

          Regards,
          JPMontero_Intel            

          • 2. Re: Creating Kernel Headers package in Yocto env?
            David_J_Hunt

            OK, I've managed to do it now (almost)

             

            I'm using the devshell feature from bitbake, which throws me into a command line within the yocto environment. I can then run make menuconfig, etc. The key to this is that I can also make with the 'deb-pkg' target, which generates a linux-image package and a linux-headers package, as well as a linux-libc-dev package.

             

            Now, before you all run off and try to replicate this, this functionality is broken in the SDK provided. There are several missing perl modules, and the control files for the debian packages are generated with the incorrect architecure (hosts rather than i386), so I had to manually copy in the missing perl modules, and manipulate the control file with a couple of sed commands to get the packages to generate properly. At least I now have a (hacked) environment that will generate the linux-headers package for me.

            So the steps are:

            bitbake linux-yocto -c devshell

            make -j 20 ARCH=i386 KBUILD_DEBARCH=i386 KDEB_PKGVERSION=1.1 deb-pkg

            (Copy in any missing perl modules and keep repeating the make until there are no more, there's about 3...)

            Get to the dpkg-genconfig error, and add in a sed script to change amd64 to i386 before dpkg-gencontrol executes. This is in the scripts/packages/builddeb script.

            Run the make again for the final time, and you should end up with 3 .deb packages in ..

            linux-headers-3.10.17-yocto-standard-r2_1.1_i386.deb

            linux-image-3.10.17-yocto-standard-r2_1.1_i386.deb

            linux-libc-dev_1.1_i386.deb

             

            Now to test these packages and see if they do what they're supposed to...

             

            Is there any chance this could be raised as an issue in the Intel issue database?  The SDK needs a few extra perl modules, and the ARCH needs to be used correctly when cross compiling in the yocto environment for the deb-pkg target.

             

            Rgds,

            Dave @ Emutex

            • 3. Re: Creating Kernel Headers package in Yocto env?
              JPMontero_Intel

              Hi David_J_Hunt,

               

              Sure, I’ll pass your feedback along. By the way thanks for sharing the method you used. 

               

              Regards,
              JPMontero_Intel

              • 4. Re: Creating Kernel Headers package in Yocto env?
                David_J_Hunt

                By the way, works much better in a precise32 environment (VM), in that the binaries that get built in the scripts dir are 32-bit and will work on the Edison, and there's no mismatch in architecture during package building. Also the missing perl modules didn't cause a problem in the 32-bit os.

                I was then able to build a sample kernel module out-of-kernel after installing linux-headers package on my Edison.

                Rgds,

                Dave.

                • 5. Re: Creating Kernel Headers package in Yocto env?
                  terahertz5k

                  Hi Dave,

                   

                  Would you mind posting these headers you generated? Or perhaps put it in your repo? I am using Ubilinux and find it weird that there isn't a linux-headers package available, even though it says so on your site.

                   

                  Thanks,

                  Kevin