LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 12-18-2023, 11:05 AM   #1
ajit456
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Rep: Reputation: 0
cross-compile kernel module for buildroot system


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
endif
I realise I need to adjust `KDIR` variable according to my situation (buildroot). Where does buildroot provide this?

Thank you in advance!
 
Old 12-18-2023, 11:42 AM   #2
ajit456
LQ Newbie
 
Registered: Apr 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Okay found it (source: https://blog.billvanleeuwen.ca/writi...lack-buildroot). It's in ~/buildroot/output/build/linux-custom
 
  


Reply

Tags
device driver, embedded, kernel, kernel module



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Board: i.MX6Q Uboot:2019-04 kernel:4.1.15 My file system was built with buildroot-2019.02.9 and works fine on the board.I added the init sc ZH_Y Linux - Software 2 02-15-2020 07:33 AM
Cross-compiling kernel modules with Buildroot bremenpl Linux - Kernel 2 12-20-2018 04:55 AM
buildroot-2015.11-rc2 - ARM Cross Compile Segfaulting On Target wt_kurtz Linux - Software 0 12-04-2015 07:50 PM
[SOLVED] cross compiling for arm with buildroot brooko Slackware 3 01-29-2011 11:42 AM
uclibc buildroot failed to compile tcma Linux - Software 0 10-06-2004 12:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 01:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration