How to modify a driver in buildroot?

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

alassg
Posts: 7
Joined: Thu Jan 07, 2021 10:22 pm

How to modify a driver in buildroot?

Sun Feb 28, 2021 3:27 pm

Hello,

i'd like to modify a few line of the following driver : https://github.com/linux4sam/linux-at91 ... _printer.c .
That driver corresponds to the gadget printer driver. After i modify the file, do any one know how i can compile it and replace the actual driver by the modified one using buildroot?

Thank you in advance
sirdan
Posts: 30
Joined: Thu Jun 25, 2009 4:19 pm

Re: How to modify a driver in buildroot?

Mon Mar 01, 2021 1:19 am

Hello,

Make your changes to the driver. In buildroot top level directory type: make linux-rebuild

Regards,
Dan
alassg
Posts: 7
Joined: Thu Jan 07, 2021 10:22 pm

Re: How to modify a driver in buildroot?

Mon Mar 01, 2021 5:11 pm

sirdan wrote:
Mon Mar 01, 2021 1:19 am
Hello,

Make your changes to the driver. In buildroot top level directory type: make linux-rebuild

Regards,
Dan
Thank you but my goal is not to rebuild the kernel, i just want to rebuild the driver and generate the ".ko" file to put it on my target, maybe just running a make in the driver folder would do that, but i'm not really sure about this.
blue_z
Location: USA
Posts: 2150
Joined: Thu Apr 19, 2007 10:15 pm

Re: How to modify a driver in buildroot?

Wed Mar 03, 2021 12:35 am

alassg wrote: ... how i can compile it ... using buildroot?
alassg wrote: ... my goal is not to rebuild the kernel, i just want to rebuild the driver
So mentioning Buildroot is (apparently) irrelevant, and you're providing (incomplete) details in piecemeal manner.

Building a loadable kernel module apart from the kernel source tree is called an "out of tree" build.
However there are dependencies that you may or (more likely) do not have.
The details are described in the Documentation/kbuild/modules.txt file in the kernel source.


Regards
alassg
Posts: 7
Joined: Thu Jan 07, 2021 10:22 pm

Re: How to modify a driver in buildroot?

Wed Mar 03, 2021 1:10 am

blue_z wrote:
Wed Mar 03, 2021 12:35 am
alassg wrote: ... how i can compile it ... using buildroot?
alassg wrote: ... my goal is not to rebuild the kernel, i just want to rebuild the driver
So mentioning Buildroot is (apparently) irrelevant, and you're providing (incomplete) details in piecemeal manner.

Building a loadable kernel module apart from the kernel source tree is called an "out of tree" build.
However there are dependencies that you may or (more likely) do not have.
The details are described in the Documentation/kbuild/modules.txt file in the kernel source.


Regards
Hello,

I finally found out how i could do this and a few days ago, i didn't know yet that was called an "out of tree" build.
I read the modules.txt file and used the information in the following email : http://lists.busybox.net/pipermail/buil ... 70169.html

So, i found out the kernel source in the buildroot folder, modified the driver, and then made my own Makefile and cross-compiled the driver using the toolchain generated by buildroot!

Return to “LINUX”

Who is online

Users browsing this forum: Google [Bot] and 3 guests