Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Adding package that builds Kernel Module (*.ko) to Buildroot environment
@ 2011-08-03 15:17 Aleksandar Zivkovic
  2011-08-03 16:15 ` Michael S. Zick
  2011-08-04  7:28 ` Thomas De Schampheleire
  0 siblings, 2 replies; 9+ messages in thread
From: Aleksandar Zivkovic @ 2011-08-03 15:17 UTC (permalink / raw)
  To: buildroot

An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110803/734bc49f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 1577 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110803/734bc49f/attachment-0001.jpg>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Adding package that builds Kernel Module (*.ko) to Buildroot environment
  2011-08-03 15:17 Aleksandar Zivkovic
@ 2011-08-03 16:15 ` Michael S. Zick
  2011-08-04  7:28 ` Thomas De Schampheleire
  1 sibling, 0 replies; 9+ messages in thread
From: Michael S. Zick @ 2011-08-03 16:15 UTC (permalink / raw)
  To: buildroot

On Wed August 3 2011, Aleksandar Zivkovic wrote:
>

Could you please re-send as plain text without the image attachments?

Mike
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Adding package that builds Kernel Module (*.ko) to Buildroot environment
@ 2011-08-04  6:30 Aleksandar Zivkovic
  2011-08-04  7:45 ` Thomas Petazzoni
  0 siblings, 1 reply; 9+ messages in thread
From: Aleksandar Zivkovic @ 2011-08-04  6:30 UTC (permalink / raw)
  To: buildroot

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Adding package that builds Kernel Module (*.ko) to Buildroot environment
  2011-08-03 15:17 Aleksandar Zivkovic
  2011-08-03 16:15 ` Michael S. Zick
@ 2011-08-04  7:28 ` Thomas De Schampheleire
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas De Schampheleire @ 2011-08-04  7:28 UTC (permalink / raw)
  To: buildroot

Hi Aleksandar,

On Wed, Aug 3, 2011 at 5:17 PM, Aleksandar Zivkovic
<Aleksandar.Zivkovic@rt-rk.com> wrote:
>
> 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...

The following mail shows the approach I am using.
http://lists.busybox.net/pipermail/buildroot/2011-July/044690.html

In my case, the kernel sources come from a Mercurial repository, but
these settings are easily changeable as the Makefile uses the generic
package infrastructure.

Best regards,
Thomas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Adding package that builds Kernel Module (*.ko) to Buildroot environment
  2011-08-04  6:30 [Buildroot] Adding package that builds Kernel Module (*.ko) to Buildroot environment Aleksandar Zivkovic
@ 2011-08-04  7:45 ` Thomas Petazzoni
  2011-08-04  8:40   ` Thomas De Schampheleire
  2011-08-04 10:05   ` Aleksandar Zivkovic
  0 siblings, 2 replies; 9+ messages in thread
From: Thomas Petazzoni @ 2011-08-04  7:45 UTC (permalink / raw)
  To: buildroot

Hello,

Le Thu, 04 Aug 2011 08:30:21 +0200,
Aleksandar Zivkovic <Aleksandar.Zivkovic@rt-rk.com> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mykmod-1.0.tar.bz2
Type: application/x-bzip
Size: 370 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110804/3a02ba98/attachment.bz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kmod-example.patch
Type: text/x-patch
Size: 1372 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110804/3a02ba98/attachment.bin>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Adding package that builds Kernel Module (*.ko) to Buildroot environment
  2011-08-04  7:45 ` Thomas Petazzoni
@ 2011-08-04  8:40   ` Thomas De Schampheleire
  2011-08-04 10:05   ` Aleksandar Zivkovic
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas De Schampheleire @ 2011-08-04  8:40 UTC (permalink / raw)
  To: buildroot

On Thu, Aug 4, 2011 at 9:45 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> Le Thu, 04 Aug 2011 08:30:21 +0200,
> Aleksandar Zivkovic <Aleksandar.Zivkovic@rt-rk.com> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Adding package that builds Kernel Module (*.ko) to Buildroot environment
  2011-08-04  7:45 ` Thomas Petazzoni
  2011-08-04  8:40   ` Thomas De Schampheleire
@ 2011-08-04 10:05   ` Aleksandar Zivkovic
  1 sibling, 0 replies; 9+ messages in thread
From: Aleksandar Zivkovic @ 2011-08-04 10:05 UTC (permalink / raw)
  To: buildroot

An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110804/6106d44d/attachment-0001.html>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Adding package that builds Kernel Module (*.ko) to Buildroot environment
@ 2015-07-09 23:05 Ron Schmitt
  2015-07-10 23:07 ` Arnout Vandecappelle
  0 siblings, 1 reply; 9+ messages in thread
From: Ron Schmitt @ 2015-07-09 23:05 UTC (permalink / raw)
  To: buildroot

Hello,
I am embarking on my first embedded driver development project.
Could someone possibly give the explicit commands for how to do this, i..e.
how to add a package that builds Kernel Module (*.ko) to Buildroot
environmentLet's assume the following:
- I have installed buildroot at

/path/buildroot

- I have executed "make menuconfig" and set up my build.
- I have not yet run the build, i.e. I have not executed "make"
- I have copied your "*hello world" kernel module *c file to

/path/buildroot/mykmod.c

- I have copied your patch file to

/path/buildroot/kmod-example.patch


Thank you very much for your time and assistance.
Ron
[Buildroot] Adding package that builds Kernel Module (*.ko) to Buildroot
environment*Thomas Petazzoni* thomas.petazzoni at free-electrons.com
<buildroot%40busybox.net?Subject=Re%3A%20%5BBuildroot%5D%20Adding%20package%20that%20builds%20Kernel%20Module%20%28%2A.ko%29%20to%0A%20Buildroot%20environment&In-Reply-To=%3C20110804094557.4464b69b%40skate%3E>
*Thu Aug 4 07:45:57 UTC 2011*


   - Previous message: [Buildroot] Adding package that builds Kernel Module
   (*.ko) to Buildroot environment
   <http://lists.busybox.net/pipermail/buildroot/2011-August/044805.html>
   - Next message: [Buildroot] Adding package that builds Kernel Module
   (*.ko) to Buildroot environment
   <http://lists.busybox.net/pipermail/buildroot/2011-August/044808.html>
   - *Messages sorted by:* [ date ]
   <http://lists.busybox.net/pipermail/buildroot/2011-August/date.html#44807>
    [ thread ]
   <http://lists.busybox.net/pipermail/buildroot/2011-August/thread.html#44807>
    [ subject ]
   <http://lists.busybox.net/pipermail/buildroot/2011-August/subject.html#44807>
    [ author ]
   <http://lists.busybox.net/pipermail/buildroot/2011-August/author.html#44807>

------------------------------

Hello,

Le Thu, 04 Aug 2011 08:30:21 +0200,
Aleksandar Zivkovic <Aleksandar.Zivkovic@rt-rk.com
<http://lists.busybox.net/mailman/listinfo/buildroot>> 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
<http://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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mykmod-1.0.tar.bz2
Type: application/x-bzip
Size: 370 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110804/3a02ba98/attachment.bz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kmod-example.patch
Type: text/x-patch
Size: 1372 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20110804/3a02ba98/attachment.bin>

------------------------------


   - Previous message: [Buildroot] Adding package that builds Kernel Module
   (*.ko) to Buildroot environment
   <http://lists.busybox.net/pipermail/buildroot/2011-August/044805.html>
   - Next message: [Buildroot] Adding package that builds Kernel Module
   (*.ko) to Buildroot environment
   <http://lists.busybox.net/pipermail/buildroot/2011-August/044808.html>
   - *Messages sorted by:* [ date ]
   <http://lists.busybox.net/pipermail/buildroot/2011-August/date.html#44807>
    [ thread ]
   <http://lists.busybox.net/pipermail/buildroot/2011-August/thread.html#44807>
    [ subject ]
   <http://lists.busybox.net/pipermail/buildroot/2011-August/subject.html#44807>
    [ author ]
   <http://lists.busybox.net/pipermail/buildroot/2011-August/author.html#44807>

------------------------------
More information about the buildroot mailing list
<http://lists.busybox.net/mailman/listinfo/buildroot>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150709/8d7ea288/attachment-0001.html>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Buildroot] Adding package that builds Kernel Module (*.ko) to Buildroot environment
  2015-07-09 23:05 Ron Schmitt
@ 2015-07-10 23:07 ` Arnout Vandecappelle
  0 siblings, 0 replies; 9+ messages in thread
From: Arnout Vandecappelle @ 2015-07-10 23:07 UTC (permalink / raw)
  To: buildroot

 Hi Ron,

 Please use text-only messages on this list, it looks much cleaner.

On 07/10/15 01:05, Ron Schmitt wrote:
> 
>   Hello,
> 
> I am embarking on my first embedded driver development project.
> 
> 
>   Could someone possibly give the explicit commands for how to do this, i..e.
>   how to add a package that builds Kernel Module (*.ko) to Buildroot environment
> 
> 
>   Let's assume the following:
> 
> - I have installed buildroot at   
> 
>     /path/buildroot
> 
> - I have executed "make menuconfig" and set up my build.  
> - I have not yet run the build, i.e. I have not executed "make"
> - I have copied your "/hello world" kernel module /c file to   
> 
>     /path/buildroot/mykmod.c
> 
> - I have copied your patch file to   
> 
>     /path/buildroot/kmod-example.patch

 This example is much too old to still be applicable with current buildroot,
though the changes are not that dramatic.

 With current buildroot, you should create a new directory outside of buildroot,
which contains a Config.in and external.mk file and a directory mykmod that
contains the files Config.in and mykmod.mk. See [1]

 For your convencience, I've created that structure in [2]. You can just clone
it and start from there.


 The next step is to go to the buildroot directory and run:

BR2_EXTERNAL=<path_to_buildroot-mykmod> make menuconfig

You will now see an additional menu entry at the bottom: User-provided options.
In this menu, select the mykmod package. Now run 'make' and it will be built.

 Please consult the buildroot manual to understand what is going on here [3].
For your real kernel module, you'll also want to replace the _SOURCE and _SITE
variables with a reference to your VCS.


 Note that very soon now, a new infrastructure will be merged to simplify the
building of external linux kernel modules. With that infrastructure, mykmod.mk
will become:

###############################################################################
#
# mykmod
#
###############################################################################

MYKMOD_VERSION = 1.0
MYKMOD_SOURCE = mykmod-$(MYKMOD_VERSION).tar.bz2
MYKMOD_SITE = file://$(BR2_EXTERNAL)

$(eval $(kernel-module))
$(eval $(generic-package))



Regards,
Arnout

[1] http://nightly.buildroot.org/manual.html#outside-br-custom
[2] http://gitlab.com/arnout/buildroot-mykmod.git
[3] http://nightly.buildroot.org/manual.html#adding-packages


> 
> 
> Thank you very much for your time and assistance.
> 
> 
>   Ron
[snip]



-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-07-10 23:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-04  6:30 [Buildroot] Adding package that builds Kernel Module (*.ko) to Buildroot environment Aleksandar Zivkovic
2011-08-04  7:45 ` Thomas Petazzoni
2011-08-04  8:40   ` Thomas De Schampheleire
2011-08-04 10:05   ` Aleksandar Zivkovic
  -- strict thread matches above, loose matches on Subject: below --
2015-07-09 23:05 Ron Schmitt
2015-07-10 23:07 ` Arnout Vandecappelle
2011-08-03 15:17 Aleksandar Zivkovic
2011-08-03 16:15 ` Michael S. Zick
2011-08-04  7:28 ` Thomas De Schampheleire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox