Now that we have a configured Raspberry Pi kernel source tree (on the host system) and the enhanced Makefile (see the Attempt 2 – pointing the Makefile to the correct kernel source tree for the target section), it should work. Let's retry:
- We (again) attempt to build (cross-compile) the kernel. Issue the make command, passing along the ARCH and CROSS_COMPILE environment variables as usual:
$ ls -l
total 12
-rw-rw-r-- 1 llkd llkd 1456 Mar 18 17:48 helloworld_lkm.c
-rw-rw-r-- 1 llkd llkd 6470 Jul 6 17:30 Makefile
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
--- Building : KDIR=~/rpi_work/kernel_rpi/linux ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- EXTRA_CFLAGS=-DDEBUG ---
make -C ~/rpi_work/kernel_rpi/linux M=/home/llkd/booksrc/ch5/cross modules
make[1]: Entering directory '/home/llkd/rpi_work/kernel_rpi/linux'
WARNING: Symbol version dump ./Module.symvers
is missing; modules will have...