I am trying to compile a simple helloworld module on my Raspberry Pi B+ under the 3.18.7+ Kenel. I did it after THIS tutorial. When I try to build my module I have this error :
make[1]: *** /lib/modules/3.18.7+/build: No such file or directory. Stop
When I go to my /lib/modules/3.18.7+/build directory I have the following files :
modules.alias
modules.builtin
modules.dep
modules.devname
modules.softdep
modules.symbols.bin
kernel
modules.alias.bin
modules.builtin.bin
modules.dep.bin
modules.order
modules.symbols
As you can see, there is no build directory. I made some researches on the internet so I find that I have to made a link to the kernel source tree used to build the modules, by using this command
ln -s /path/to/kernel/source /lib/modules/3.18.7+/build
So I did so by typing the following command :
ln -s /usr/src/linux-kbuild-3.18 /lib/modules/3.18.7+/build
Even if I did that, I still got the same error that the one in the beginning. In the directory /usr/src/linux-kbuild-3.18 I have only a scripts directory containing those files :
basic gcc-goto.sh kallsyms Makefile.clean makelst namespace.pl ver_linux
checkincludes.pl gcc-version.sh Kbuild.include Makefile.extrawarn mksysmap patch-kernel
checkstack.pl gcc-x86_32-has-stack-protector.sh kconfig Makefile.host mkuboot.sh pnmtologo
checkversion.pl gcc-x86_64-has-stack-protector.sh kernel-doc Makefile.lib mkversion recordmcount
conmakehash gen_initramfs_list.sh Lindent Makefile.modinst mod recordmcount.pl
depmod.sh genksyms Makefile.build Makefile.modpost module-common.lds setlocalversion
If there is any solution it will be great, thanks