13 Replies Latest reply on Jun 25, 2016 2:28 PM by myopenid

    GUIDE: compiling drivers for Poky 3.10.17-poky-edison+ directly on EDISON (in 10 steps :))


      Here the correct procedure to compile drivers to be used with 3.10.17-poky-edison+ (same procedure can be used for different/future versions of Poky).

      1. Download Poky Headers: linux-headers-3.10.17-poky-edison_3.10.17-poky-edison-1_i386.deb

      2. Copy it on Edison where you prefer (following procedure assume you are using your home: /home/root aka ~/)

      3. Extract the DEB file with ar command:

      ar x linux-headers-3.10.17-poky-edison_3.10.17-poky-edison-1_i386.deb

      4. deflate data.tar.gz with tar command:

      tar x -f data.tar.gz

      5. 2 new directory are created: ~/usr and ~/lib.

      6. You need to solve the '+' issue (the kernel is "3.10.17-poky-edison+" while the Poky Header is "3.10.17-poky-edison")

      edit the header file: ~/usr/src/linux-headers-3.10.17-poky-edison/include/generated/utsrelease.h

      change the line #define UTS_RELEASE "3.10.17-poky-Edison" with #define UTS_RELEASE "3.10.17-poky-Edison+"

      7. now you need to link you kernel directory with the "build" directory where the make command can find the Poky headers (make look for '/lib/modules/3.10.17-poky-Edison+/build')

      cd /lib/modules/3.10.17-poky-edison+

      ln -s /home/root/usr/src/linux-headers-3.10.17-poky-edison build (<-- this create the link '/lib/modules/3.10.17-poky-Edison+/build' that point to the Linux-headres directory)

      8. Compile your driver: simply copy the driver files into a folder in Edison, cd to the folder and run make

      9. The compiler should output a <filename>.ko that is the compiled driver with the magic signature '3.10.17-poky-edison+' so you will be able to load it!

      10. load the driver: insmod <filename>.ko


      If you don't plan to compile other drivers you can remove the ~/usr and ~/lib

      Have fun!


      ps: next GUIDE on how to make our just built driver load at every boot (insmod load it but need to be executed after every reboot)