Kernel module native on Target compilation


i’m trying to compile kernel module direct on target but i faced this error as below

root@colibri-imx6:/# make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
make: *** /lib/modules/4.1.39-2.7.2+gba2f75f/build: No such file or directory.  Stop.

Do i have missed something?

While we do not recommend to do any native compilation and all our BSPs do not include many of the needed environments/tools to do so you may of course still waste your time doing it. A few things to look out for:

  1. Make sure to install a proper native tool chain.
  2. Make sure to get the proper kernel sources.
  3. Make sure you do not run out of space (e.g. use SD cards, USB memory sticks or the like to extend if required).
  4. Make sure you do not run out of time.
  5. Don’t even think about there being any easy way of deploying that one native module mess to several modules now!