All of lore.kernel.org
 help / color / mirror / Atom feed
* proper way to create an out-of-tree kernel modules
@ 2020-03-03 14:32 Kent Dorfman
  2020-03-03 14:39 ` [yocto] " Quentin Schulz
  0 siblings, 1 reply; 4+ messages in thread
From: Kent Dorfman @ 2020-03-03 14:32 UTC (permalink / raw)
  To: yocto

What is the proper way to create a recipe to build a kernel module
outside of the normal kernel tree?

The kernel sources need to be expanded and configured for the typical
kernel makefile line

make -C $(KERNEL_SRC) M=$(PWD) V=1 ARCH=$(ARCH) \
CROSS_COMPILE=$(CROSS_COMPILE) modules

to work.

Are there any sample/stubs available that demonstrate building and
deploying a simple kernel module?

TIA

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

* Re: [yocto] proper way to create an out-of-tree kernel modules
  2020-03-03 14:32 proper way to create an out-of-tree kernel modules Kent Dorfman
@ 2020-03-03 14:39 ` Quentin Schulz
  2020-03-03 14:46   ` Kent Dorfman
       [not found]   ` <15F8D296B73C234A.31276@lists.yoctoproject.org>
  0 siblings, 2 replies; 4+ messages in thread
From: Quentin Schulz @ 2020-03-03 14:39 UTC (permalink / raw)
  To: Kent Dorfman; +Cc: yocto

Hi Kent,

On Tue, Mar 03, 2020 at 09:32:55AM -0500, Kent Dorfman wrote:
> What is the proper way to create a recipe to build a kernel module
> outside of the normal kernel tree?
> 
> The kernel sources need to be expanded and configured for the typical
> kernel makefile line
> 
> make -C $(KERNEL_SRC) M=$(PWD) V=1 ARCH=$(ARCH) \
> CROSS_COMPILE=$(CROSS_COMPILE) modules
> 
> to work.
> 
> Are there any sample/stubs available that demonstrate building and
> deploying a simple kernel module?
> 

inherit module should usually be enough in the recipe AFAICT.

There might be some fixes to do in Makefiles but nothing crazy.

c.f. https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#incorporating-out-of-tree-modules
http://git.yoctoproject.org/cgit.cgi/poky/tree/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb

Quentin

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

* Re: [yocto] proper way to create an out-of-tree kernel modules
  2020-03-03 14:39 ` [yocto] " Quentin Schulz
@ 2020-03-03 14:46   ` Kent Dorfman
       [not found]   ` <15F8D296B73C234A.31276@lists.yoctoproject.org>
  1 sibling, 0 replies; 4+ messages in thread
From: Kent Dorfman @ 2020-03-03 14:46 UTC (permalink / raw)
  To: Quentin Schulz; +Cc: yocto

On 3/3/20, Quentin Schulz <quentin.schulz@streamunlimited.com> wrote:
> Hi Kent,
>
> On Tue, Mar 03, 2020 at 09:32:55AM -0500, Kent Dorfman wrote:
>> What is the proper way to create a recipe to build a kernel module
>> outside of the normal kernel tree?
>>
>> The kernel sources need to be expanded and configured for the typical
>> kernel makefile line
>>
>> make -C $(KERNEL_SRC) M=$(PWD) V=1 ARCH=$(ARCH) \
>> CROSS_COMPILE=$(CROSS_COMPILE) modules
>>
>> to work.
>>
>> Are there any sample/stubs available that demonstrate building and
>> deploying a simple kernel module?
>>
>
> inherit module should usually be enough in the recipe AFAICT.
>
> There might be some fixes to do in Makefiles but nothing crazy.
>
> c.f.
> https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#incorporating-out-of-tree-modules
> http://git.yoctoproject.org/cgit.cgi/poky/tree/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb
>
> Quentin
>

THANKS!  Will give this a try once my software raid is done resyncing.

I'm replacing the mainline slip driver with a custom one that tightly
binds the sl link name to the owned tty so that we know which sl
device is assigned to each slip connection.  Slip interface name is
normally assigned dynamically, which poses a problem trying to
identify 16 static tty slip connections.

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

* Re: [yocto] proper way to create an out-of-tree kernel modules
       [not found]   ` <15F8D296B73C234A.31276@lists.yoctoproject.org>
@ 2020-03-03 20:54     ` Kent Dorfman
  0 siblings, 0 replies; 4+ messages in thread
From: Kent Dorfman @ 2020-03-03 20:54 UTC (permalink / raw)
  To: kent.dorfman766; +Cc: Quentin Schulz, yocto

On 3/3/20, Kent Dorfman via Lists.Yoctoproject.Org
<kent.dorfman766=gmail.com@lists.yoctoproject.org> wrote:
> On 3/3/20, Quentin Schulz <quentin.schulz@streamunlimited.com> wrote:
>> Hi Kent,
>>
>> On Tue, Mar 03, 2020 at 09:32:55AM -0500, Kent Dorfman wrote:
>>> What is the proper way to create a recipe to build a kernel module
>>> outside of the normal kernel tree?
>>>
>>> The kernel sources need to be expanded and configured for the typical
>>> kernel makefile line
>>>
>>> make -C $(KERNEL_SRC) M=$(PWD) V=1 ARCH=$(ARCH) \
>>> CROSS_COMPILE=$(CROSS_COMPILE) modules
>>>
>>> to work.
>>>
>>> Are there any sample/stubs available that demonstrate building and
>>> deploying a simple kernel module?
>>>
>>
>> inherit module should usually be enough in the recipe AFAICT.
>>
>> There might be some fixes to do in Makefiles but nothing crazy.
>>
>> c.f.
>> https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#incorporating-out-of-tree-modules
>> http://git.yoctoproject.org/cgit.cgi/poky/tree/meta-skeleton/recipes-kernel/hello-mod/hello-mod_0.1.bb


Worked flawlessly. Thanks!

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

end of thread, other threads:[~2020-03-03 20:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-03 14:32 proper way to create an out-of-tree kernel modules Kent Dorfman
2020-03-03 14:39 ` [yocto] " Quentin Schulz
2020-03-03 14:46   ` Kent Dorfman
     [not found]   ` <15F8D296B73C234A.31276@lists.yoctoproject.org>
2020-03-03 20:54     ` Kent Dorfman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.