Adding package that builds Kernel Module (*.ko) to Buildroot environment

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding package that builds Kernel Module (*.ko) to Buildroot environment

Aleksandar Zivkovic-2
On request from Michael S. Zick question resend without attachment

Hi all,

I would like to add additional package to Buildroot that will build
Linux kernel driver.
For that I need:
- dependency: build of this package mustn't be started before kernel
source is available
- kernel source directory: currently, the best I know is:
$(BASE_DIR)/build/linux-$(BR2_LINUX_KERNEL_VERSION)

I started with package approach but bumped to stated dependency problem.
Next what I tried is to edit linux/linux.mk to include my driver source
download, extract. build and install but not so familiar with Buildroot
scripting...


Did somebody already done something similar? What is best approach?
Examples are welcomed...

Regards,

Aleksandar Zivkovic
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: Adding package that builds Kernel Module (*.ko) to Buildroot environment

Thomas Petazzoni-2
Hello,

Le Thu, 04 Aug 2011 08:30:21 +0200,
Aleksandar Zivkovic <[hidden email]> a écrit :

> I would like to add additional package to Buildroot that will build
> Linux kernel driver.
> For that I need:
> - dependency: build of this package mustn't be started before kernel
> source is available
> - kernel source directory: currently, the best I know is:
> $(BASE_DIR)/build/linux-$(BR2_LINUX_KERNEL_VERSION)
>
> I started with package approach but bumped to stated dependency
> problem. Next what I tried is to edit linux/linux.mk to include my
> driver source download, extract. build and install but not so
> familiar with Buildroot scripting...
>
> Did somebody already done something similar? What is best approach?
> Examples are welcomed...
Attached, you will find :

 * mykmod-1.0.tar.bz2, the source code of an hello world like kernel
   module ;

 * kmod-example.patch, which adds support for compiling this kernel
   module into the Buildroot package infrastructure

Do not hesitate to get back to the mailing list if you have any issues
getting this to work or need additional details.

Best regards,

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot

mykmod-1.0.tar.bz2 (510 bytes) Download Attachment
kmod-example.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Adding package that builds Kernel Module (*.ko) to Buildroot environment

Thomas De Schampheleire-3
On Thu, Aug 4, 2011 at 9:45 AM, Thomas Petazzoni
<[hidden email]> wrote:

> Hello,
>
> Le Thu, 04 Aug 2011 08:30:21 +0200,
> Aleksandar Zivkovic <[hidden email]> a écrit :
>
>> I would like to add additional package to Buildroot that will build
>> Linux kernel driver.
>> For that I need:
>> - dependency: build of this package mustn't be started before kernel
>> source is available
>> - kernel source directory: currently, the best I know is:
>> $(BASE_DIR)/build/linux-$(BR2_LINUX_KERNEL_VERSION)
>>
>> I started with package approach but bumped to stated dependency
>> problem. Next what I tried is to edit linux/linux.mk to include my
>> driver source download, extract. build and install but not so
>> familiar with Buildroot scripting...
>>
>> Did somebody already done something similar? What is best approach?
>> Examples are welcomed...
>
> Attached, you will find :
>
>  * mykmod-1.0.tar.bz2, the source code of an hello world like kernel
>   module ;
>
>  * kmod-example.patch, which adds support for compiling this kernel
>   module into the Buildroot package infrastructure

Given the fact that we had similar questions before, I think it is
worth adding this example (mainly the package .mk file) to the
buildroot documentation, don't you think?
Moreover, the linux-fusion package could apparently be simplified by
using LINUX_MAKE_FLAGS as in your example.

Best regards,
Thomas
_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot
Reply | Threaded
Open this post in threaded view
|

Re: Adding package that builds Kernel Module (*.ko) to Buildroot environment

Aleksandar Zivkovic-2
In reply to this post by Thomas Petazzoni-2
Thanks to Thomas and Thomas!

now I see that I was very close to solution. Only thing I missed was:
_DEPENDENCIES = linux

I also replaced my ugly: "$(BASE_DIR)/build/linux-$(BR2_LINUX_KERNEL_VERSION)" with nice:
$(LINUX_DIR)

I also vote for adding kernel modules build environment to Buildroot (as template or in any other form...)

Regards,
Aleksandar




On 04/08/2011 09:45, Thomas Petazzoni wrote:
Hello,

Le Thu, 04 Aug 2011 08:30:21 +0200,
Aleksandar Zivkovic [hidden email] a écrit :

I would like to add additional package to Buildroot that will build 
Linux kernel driver.
For that I need:
- dependency: build of this package mustn't be started before kernel 
source is available
- kernel source directory: currently, the best I know is: 
$(BASE_DIR)/build/linux-$(BR2_LINUX_KERNEL_VERSION)

I started with package approach but bumped to stated dependency
problem. Next what I tried is to edit linux/linux.mk to include my
driver source download, extract. build and install but not so
familiar with Buildroot scripting...

Did somebody already done something similar? What is best approach? 
Examples are welcomed...
Attached, you will find :

 * mykmod-1.0.tar.bz2, the source code of an hello world like kernel
   module ;

 * kmod-example.patch, which adds support for compiling this kernel
   module into the Buildroot package infrastructure

Do not hesitate to get back to the mailing list if you have any issues
getting this to work or need additional details.

Best regards,

Thomas
_______________________________________________ buildroot mailing list [hidden email] http://lists.busybox.net/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[hidden email]
http://lists.busybox.net/mailman/listinfo/buildroot