Article 6H7TG cross-compile kernel module for buildroot system

cross-compile kernel module for buildroot system

by
ajit456
from LinuxQuestions.org on (#6H7TG)
Hi
I'm trying to follow the linux kernel development from bootlin.. But I'm using a different board (specifically the Orange PI Zero 3) and using buildroot for my system image.

I can crosscompile C *applications* succesfully using the generated toolchain from buildroot from `~/buildroot/output/host/bin`; by running `aarch64-linux-gcc -o hello hello.c`.

Now I need to cross-compile kernel modules in this course.. They have provided the following `Makefile`:

Code:ifneq ($(KERNELRELEASE),)
obj-m := hello_version.o
else
KDIR := $(HOME)/linux-kernel-labs/src/linux
all:
$(MAKE) -C $(KDIR) M=$$PWD

clean:
$(MAKE) -C $(KDIR) M=$$PWD clean
endifI realise I need to adjust `KDIR` variable according to my situation (buildroot). Where does buildroot provide this?

Thank you in advance!
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments