All of lore.kernel.org
 help / color / mirror / Atom feed
* Proper Use of KERNEL_MODULE_AUTOLOAD variable
@ 2019-02-03  2:59 Ken Sloat
  2019-02-03  3:02 ` Bruce Ashfield
  0 siblings, 1 reply; 11+ messages in thread
From: Ken Sloat @ 2019-02-03  2:59 UTC (permalink / raw)
  To: yocto; +Cc: Nate Drude

Hello,

I have an out of tree kernel module which I want autoloaded at startup
on my system. Looking at the Yocto project manual, I see that one way
I can do this is to add the module name to the KERNEL_MODULE_AUTOLOAD
variable within my custom module recipe.

What I have found is that the module-split class is indeed generating
the "/etc/modules-load.d/mymodule.conf" file, however this file is not
actually being installed. To be more precise it is appearing in the
"package" directory (i.e.
tmp/work/**/mymodule/package/etc/modules-load.d/mymodule.conf) but not
within the "image" directory (nor in my final rootfs).

Is there something I'm missing in the usage of KERNEL_MODULE_AUTOLOAD?
Is the intention for this variable I add extra steps to manually
install this file in my recipe? FYI I'm using Morty.

Thanks,
Ken Sloat


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

* Re: Proper Use of KERNEL_MODULE_AUTOLOAD variable
  2019-02-03  2:59 Proper Use of KERNEL_MODULE_AUTOLOAD variable Ken Sloat
@ 2019-02-03  3:02 ` Bruce Ashfield
  2019-02-03  3:16   ` Ken Sloat
  0 siblings, 1 reply; 11+ messages in thread
From: Bruce Ashfield @ 2019-02-03  3:02 UTC (permalink / raw)
  To: Ken Sloat, yocto; +Cc: Nate Drude

On 2019-02-02 9:59 p.m., Ken Sloat wrote:
> Hello,
> 
> I have an out of tree kernel module which I want autoloaded at startup
> on my system. Looking at the Yocto project manual, I see that one way
> I can do this is to add the module name to the KERNEL_MODULE_AUTOLOAD
> variable within my custom module recipe.
> 
> What I have found is that the module-split class is indeed generating
> the "/etc/modules-load.d/mymodule.conf" file, however this file is not
> actually being installed. To be more precise it is appearing in the
> "package" directory (i.e.
> tmp/work/**/mymodule/package/etc/modules-load.d/mymodule.conf) but not
> within the "image" directory (nor in my final rootfs).
> 
> Is there something I'm missing in the usage of KERNEL_MODULE_AUTOLOAD?
> Is the intention for this variable I add extra steps to manually
> install this file in my recipe? FYI I'm using Morty.

Can you provide your recipe ? It would make suggestions easier. For
example, my first question is: Is the module being installed to your
image via IMAGE_INSTALL, or some other similar variable ?

Bruce

> 
> Thanks,
> Ken Sloat
> 



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

* Re: Proper Use of KERNEL_MODULE_AUTOLOAD variable
  2019-02-03  3:02 ` Bruce Ashfield
@ 2019-02-03  3:16   ` Ken Sloat
  2019-02-03  3:37     ` Bruce Ashfield
                       ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Ken Sloat @ 2019-02-03  3:16 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: yocto, Nate Drude

On Sat, Feb 2, 2019 at 10:03 PM Bruce Ashfield
<bruce.ashfield@windriver.com> wrote:
>
> On 2019-02-02 9:59 p.m., Ken Sloat wrote:
> > Hello,
> >
> > I have an out of tree kernel module which I want autoloaded at startup
> > on my system. Looking at the Yocto project manual, I see that one way
> > I can do this is to add the module name to the KERNEL_MODULE_AUTOLOAD
> > variable within my custom module recipe.
> >
> > What I have found is that the module-split class is indeed generating
> > the "/etc/modules-load.d/mymodule.conf" file, however this file is not
> > actually being installed. To be more precise it is appearing in the
> > "package" directory (i.e.
> > tmp/work/**/mymodule/package/etc/modules-load.d/mymodule.conf) but not
> > within the "image" directory (nor in my final rootfs).
> >
> > Is there something I'm missing in the usage of KERNEL_MODULE_AUTOLOAD?
> > Is the intention for this variable I add extra steps to manually
> > install this file in my recipe? FYI I'm using Morty.
>
> Can you provide your recipe ? It would make suggestions easier. For
> example, my first question is: Is the module being installed to your
> image via IMAGE_INSTALL, or some other similar variable ?
>
> Bruce
>
> >
> > Thanks,
> > Ken Sloat
> >
>

Hi Bruce,

Thanks for your quick reply. Yes the module is being installed via
image_install. Module is installed but generated conf file is not. See
recipe below:

require mymodule.inc

inherit module kernel-module-split

DEPENDS = "virtual/kernel"

EXTRA_OEMAKE_append = " \
    KERNELDIR=${STAGING_KERNEL_DIR} \
    "

MAKE_TARGETS = "module"

MODULE_NAME = "mymodule"

PKG_${PN} = "kernel-module-${MODULE_NAME}"

module_do_install() {
    install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}
    install -m 0644 ${MODULE_NAME}.ko \
    ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}/${MODULE_NAME}.ko
}

FILES_${PN} = " \
    /lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} \
"

KERNEL_MODULE_AUTOLOAD += "${MODULE_NAME}"


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

* Re: Proper Use of KERNEL_MODULE_AUTOLOAD variable
  2019-02-03  3:16   ` Ken Sloat
@ 2019-02-03  3:37     ` Bruce Ashfield
  2019-02-03  5:43     ` Ulf Samuelsson
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Bruce Ashfield @ 2019-02-03  3:37 UTC (permalink / raw)
  To: Ken Sloat; +Cc: yocto, Nate Drude

On 2019-02-02 10:16 p.m., Ken Sloat wrote:
> On Sat, Feb 2, 2019 at 10:03 PM Bruce Ashfield
> <bruce.ashfield@windriver.com> wrote:
>>
>> On 2019-02-02 9:59 p.m., Ken Sloat wrote:
>>> Hello,
>>>
>>> I have an out of tree kernel module which I want autoloaded at startup
>>> on my system. Looking at the Yocto project manual, I see that one way
>>> I can do this is to add the module name to the KERNEL_MODULE_AUTOLOAD
>>> variable within my custom module recipe.
>>>
>>> What I have found is that the module-split class is indeed generating
>>> the "/etc/modules-load.d/mymodule.conf" file, however this file is not
>>> actually being installed. To be more precise it is appearing in the
>>> "package" directory (i.e.
>>> tmp/work/**/mymodule/package/etc/modules-load.d/mymodule.conf) but not
>>> within the "image" directory (nor in my final rootfs).
>>>
>>> Is there something I'm missing in the usage of KERNEL_MODULE_AUTOLOAD?
>>> Is the intention for this variable I add extra steps to manually
>>> install this file in my recipe? FYI I'm using Morty.
>>
>> Can you provide your recipe ? It would make suggestions easier. For
>> example, my first question is: Is the module being installed to your
>> image via IMAGE_INSTALL, or some other similar variable ?
>>
>> Bruce
>>
>>>
>>> Thanks,
>>> Ken Sloat
>>>
>>
> 
> Hi Bruce,
> 
> Thanks for your quick reply. Yes the module is being installed via
> image_install. Module is installed but generated conf file is not. See
> recipe below:

Hmm. If you are really installing kernel-module-<your name> to the
image, at a glance, what you have really should be enough.

Can you confirm that you are seeing your .ko on the image, and that
it just isn't being autoloaded ? Are you running an init system that
respects the autoload configuration ?

> 
> require mymodule.inc
> 
> inherit module kernel-module-split

Note that module already inherits kernel-module-split, so you really
shouldn't need to explicitly add that inherit.

Bruce

> 
> DEPENDS = "virtual/kernel"
> 
> EXTRA_OEMAKE_append = " \
>      KERNELDIR=${STAGING_KERNEL_DIR} \
>      "
> 
> MAKE_TARGETS = "module"
> 
> MODULE_NAME = "mymodule"
> 
> PKG_${PN} = "kernel-module-${MODULE_NAME}"
> 
> module_do_install() {
>      install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}
>      install -m 0644 ${MODULE_NAME}.ko \
>      ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}/${MODULE_NAME}.ko
> }
> 
> FILES_${PN} = " \
>      /lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} \
> "
> 
> KERNEL_MODULE_AUTOLOAD += "${MODULE_NAME}"
> 



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

* Re: Proper Use of KERNEL_MODULE_AUTOLOAD variable
  2019-02-03  3:16   ` Ken Sloat
  2019-02-03  3:37     ` Bruce Ashfield
@ 2019-02-03  5:43     ` Ulf Samuelsson
  2019-02-03 19:09       ` Ken Sloat
  2019-02-04 15:50     ` Robert Berger
  2019-02-06  1:22     ` Khem Raj
  3 siblings, 1 reply; 11+ messages in thread
From: Ulf Samuelsson @ 2019-02-03  5:43 UTC (permalink / raw)
  To: yocto

Den 2019-02-03 kl. 04:16, skrev Ken Sloat:
> On Sat, Feb 2, 2019 at 10:03 PM Bruce Ashfield
> <bruce.ashfield@windriver.com> wrote:
>>
>> On 2019-02-02 9:59 p.m., Ken Sloat wrote:
>>> Hello,
>>>
>>> I have an out of tree kernel module which I want autoloaded at startup
>>> on my system. Looking at the Yocto project manual, I see that one way
>>> I can do this is to add the module name to the KERNEL_MODULE_AUTOLOAD
>>> variable within my custom module recipe.
>>>
>>> What I have found is that the module-split class is indeed generating
>>> the "/etc/modules-load.d/mymodule.conf" file, however this file is not
>>> actually being installed. To be more precise it is appearing in the
>>> "package" directory (i.e.
>>> tmp/work/**/mymodule/package/etc/modules-load.d/mymodule.conf) but not
>>> within the "image" directory (nor in my final rootfs).
>>>
>>> Is there something I'm missing in the usage of KERNEL_MODULE_AUTOLOAD?
>>> Is the intention for this variable I add extra steps to manually
>>> install this file in my recipe? FYI I'm using Morty.
>>
>> Can you provide your recipe ? It would make suggestions easier. For
>> example, my first question is: Is the module being installed to your
>> image via IMAGE_INSTALL, or some other similar variable ?
>>
>> Bruce
>>
>>>
>>> Thanks,
>>> Ken Sloat
>>>
>>
> 
> Hi Bruce,
> 
> Thanks for your quick reply. Yes the module is being installed via
> image_install. Module is installed but generated conf file is not. See
> recipe below:
> 
> require mymodule.inc
> 
> inherit module kernel-module-split
> 
> DEPENDS = "virtual/kernel"
> 
> EXTRA_OEMAKE_append = " \
>      KERNELDIR=${STAGING_KERNEL_DIR} \
>      "
> 
> MAKE_TARGETS = "module"
> 
> MODULE_NAME = "mymodule"
> 
> PKG_${PN} = "kernel-module-${MODULE_NAME}"
> 
> module_do_install() {
>      install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}
>      install -m 0644 ${MODULE_NAME}.ko \
>      ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}/${MODULE_NAME}.ko
> }
> 
> FILES_${PN} = " \
>      /lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} \
> "
> 
> KERNEL_MODULE_AUTOLOAD += "${MODULE_NAME}"
> 

One would think that the file should be added automatically,
but this might be required, - or a workaround...

FILES_${PN} = " \
       /lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} \
       ${sysconfdir}/modules-load.d/${MODULE_NAME}.conf \
"


-- 
Best Regards
Ulf Samuelsson


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

* Re: Proper Use of KERNEL_MODULE_AUTOLOAD variable
  2019-02-03  5:43     ` Ulf Samuelsson
@ 2019-02-03 19:09       ` Ken Sloat
  2019-02-04 11:47         ` Ulf Samuelsson
  0 siblings, 1 reply; 11+ messages in thread
From: Ken Sloat @ 2019-02-03 19:09 UTC (permalink / raw)
  To: Ulf Samuelsson; +Cc: yocto

On Sun, Feb 3, 2019 at 12:51 AM Ulf Samuelsson <yocto@emagii.com> wrote:
>
> Den 2019-02-03 kl. 04:16, skrev Ken Sloat:
> > On Sat, Feb 2, 2019 at 10:03 PM Bruce Ashfield
> > <bruce.ashfield@windriver.com> wrote:
> >>
> >> On 2019-02-02 9:59 p.m., Ken Sloat wrote:
> >>> Hello,
> >>>
> >>> I have an out of tree kernel module which I want autoloaded at startup
> >>> on my system. Looking at the Yocto project manual, I see that one way
> >>> I can do this is to add the module name to the KERNEL_MODULE_AUTOLOAD
> >>> variable within my custom module recipe.
> >>>
> >>> What I have found is that the module-split class is indeed generating
> >>> the "/etc/modules-load.d/mymodule.conf" file, however this file is not
> >>> actually being installed. To be more precise it is appearing in the
> >>> "package" directory (i.e.
> >>> tmp/work/**/mymodule/package/etc/modules-load.d/mymodule.conf) but not
> >>> within the "image" directory (nor in my final rootfs).
> >>>
> >>> Is there something I'm missing in the usage of KERNEL_MODULE_AUTOLOAD?
> >>> Is the intention for this variable I add extra steps to manually
> >>> install this file in my recipe? FYI I'm using Morty.
> >>
> >> Can you provide your recipe ? It would make suggestions easier. For
> >> example, my first question is: Is the module being installed to your
> >> image via IMAGE_INSTALL, or some other similar variable ?
> >>
> >> Bruce
> >>
> >>>
> >>> Thanks,
> >>> Ken Sloat
> >>>
> >>
> >
> > Hi Bruce,
> >
> > Thanks for your quick reply. Yes the module is being installed via
> > image_install. Module is installed but generated conf file is not. See
> > recipe below:
> >
> > require mymodule.inc
> >
> > inherit module kernel-module-split
> >
> > DEPENDS = "virtual/kernel"
> >
> > EXTRA_OEMAKE_append = " \
> >      KERNELDIR=${STAGING_KERNEL_DIR} \
> >      "
> >
> > MAKE_TARGETS = "module"
> >
> > MODULE_NAME = "mymodule"
> >
> > PKG_${PN} = "kernel-module-${MODULE_NAME}"
> >
> > module_do_install() {
> >      install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}
> >      install -m 0644 ${MODULE_NAME}.ko \
> >      ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}/${MODULE_NAME}.ko
> > }
> >
> > FILES_${PN} = " \
> >      /lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} \
> > "
> >
> > KERNEL_MODULE_AUTOLOAD += "${MODULE_NAME}"
> >
>
> One would think that the file should be added automatically,
> but this might be required, - or a workaround...
>
> FILES_${PN} = " \
>        /lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} \
>        ${sysconfdir}/modules-load.d/${MODULE_NAME}.conf \
> "
>
>
> --
> Best Regards
> Ulf Samuelsson
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto

Hi Ulf,

Yes it seems that this indeed allows it to end up in the final image.

Not sure why it doesn't work without as I see the kernel-module-split
class seems to have statements to do this automatically:

        files = d.getVar('FILES_%s' % pkg, True)
        files = "%s /etc/modules-load.d/%s.conf
/etc/modprobe.d/%s.conf" % (files, basename, basename)
        d.setVar('FILES_%s' % pkg, files)

Maybe there's some type of name mismatch or something in my case?

Thanks,
Ken Sloat


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

* Re: Proper Use of KERNEL_MODULE_AUTOLOAD variable
  2019-02-03 19:09       ` Ken Sloat
@ 2019-02-04 11:47         ` Ulf Samuelsson
  0 siblings, 0 replies; 11+ messages in thread
From: Ulf Samuelsson @ 2019-02-04 11:47 UTC (permalink / raw)
  To: Ken Sloat; +Cc: yocto



> 3 feb. 2019 kl. 20:09 skrev Ken Sloat <ken.sloat@ohmlinx.com>:
> 
>> On Sun, Feb 3, 2019 at 12:51 AM Ulf Samuelsson <yocto@emagii.com> wrote:
>> 
>>> Den 2019-02-03 kl. 04:16, skrev Ken Sloat:
>>> On Sat, Feb 2, 2019 at 10:03 PM Bruce Ashfield
>>> <bruce.ashfield@windriver.com> wrote:
>>>> 
>>>>> On 2019-02-02 9:59 p.m., Ken Sloat wrote:
>>>>> Hello,
>>>>> 
>>>>> I have an out of tree kernel module which I want autoloaded at startup
>>>>> on my system. Looking at the Yocto project manual, I see that one way
>>>>> I can do this is to add the module name to the KERNEL_MODULE_AUTOLOAD
>>>>> variable within my custom module recipe.
>>>>> 
>>>>> What I have found is that the module-split class is indeed generating
>>>>> the "/etc/modules-load.d/mymodule.conf" file, however this file is not
>>>>> actually being installed. To be more precise it is appearing in the
>>>>> "package" directory (i.e.
>>>>> tmp/work/**/mymodule/package/etc/modules-load.d/mymodule.conf) but not
>>>>> within the "image" directory (nor in my final rootfs).
>>>>> 
>>>>> Is there something I'm missing in the usage of KERNEL_MODULE_AUTOLOAD?
>>>>> Is the intention for this variable I add extra steps to manually
>>>>> install this file in my recipe? FYI I'm using Morty.
>>>> 
>>>> Can you provide your recipe ? It would make suggestions easier. For
>>>> example, my first question is: Is the module being installed to your
>>>> image via IMAGE_INSTALL, or some other similar variable ?
>>>> 
>>>> Bruce
>>>> 
>>>>> 
>>>>> Thanks,
>>>>> Ken Sloat
>>>>> 
>>>> 
>>> 
>>> Hi Bruce,
>>> 
>>> Thanks for your quick reply. Yes the module is being installed via
>>> image_install. Module is installed but generated conf file is not. See
>>> recipe below:
>>> 
>>> require mymodule.inc
>>> 
>>> inherit module kernel-module-split
>>> 
>>> DEPENDS = "virtual/kernel"
>>> 
>>> EXTRA_OEMAKE_append = " \
>>>     KERNELDIR=${STAGING_KERNEL_DIR} \
>>>     "
>>> 
>>> MAKE_TARGETS = "module"
>>> 
>>> MODULE_NAME = "mymodule"
>>> 
>>> PKG_${PN} = "kernel-module-${MODULE_NAME}"
>>> 
>>> module_do_install() {
>>>     install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}
>>>     install -m 0644 ${MODULE_NAME}.ko \
>>>     ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}/${MODULE_NAME}.ko
>>> }
>>> 
>>> FILES_${PN} = " \
>>>     /lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} \
>>> "
>>> 
>>> KERNEL_MODULE_AUTOLOAD += "${MODULE_NAME}"
>>> 
>> 
>> One would think that the file should be added automatically,
>> but this might be required, - or a workaround...
>> 
>> FILES_${PN} = " \
>>       /lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} \
>>       ${sysconfdir}/modules-load.d/${MODULE_NAME}.conf \
>> "
>> 
>> 
>> --
>> Best Regards
>> Ulf Samuelsson
>> --
>> _______________________________________________
>> yocto mailing list
>> yocto@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
> 
> Hi Ulf,
> 
> Yes it seems that this indeed allows it to end up in the final image.
> 
> Not sure why it doesn't work without as I see the kernel-module-split
> class seems to have statements to do this automatically:
> 
>        files = d.getVar('FILES_%s' % pkg, True)
>        files = "%s /etc/modules-load.d/%s.conf
> /etc/modprobe.d/%s.conf" % (files, basename, basename)
>        d.setVar('FILES_%s' % pkg, files)
> 
> Maybe there's some type of name mismatch or something in my case?
> 
> Thanks,
> Ken Sloat

I would log those statements when building.
Either pkg, or basename has a different value, than what is expected.

Best Regards,
Ulf Samuelsson
+46 722 427 437


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

* Re: Proper Use of KERNEL_MODULE_AUTOLOAD variable
  2019-02-03  3:16   ` Ken Sloat
  2019-02-03  3:37     ` Bruce Ashfield
  2019-02-03  5:43     ` Ulf Samuelsson
@ 2019-02-04 15:50     ` Robert Berger
  2019-02-06  0:09       ` Ken Sloat
  2019-02-06  1:22     ` Khem Raj
  3 siblings, 1 reply; 11+ messages in thread
From: Robert Berger @ 2019-02-04 15:50 UTC (permalink / raw)
  To: Ken Sloat; +Cc: yocto, Nate Drude

Hi Ken,

Is there any particular reason you don't use the sample[1] for an out of 
tree kernel module?

[1] 
http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-skeleton/recipes-kernel/hello-mod

Regards,

Robert


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

* Re: Proper Use of KERNEL_MODULE_AUTOLOAD variable
  2019-02-04 15:50     ` Robert Berger
@ 2019-02-06  0:09       ` Ken Sloat
  0 siblings, 0 replies; 11+ messages in thread
From: Ken Sloat @ 2019-02-06  0:09 UTC (permalink / raw)
  To: Robert Berger; +Cc: yocto, Nate Drude

On Mon, Feb 4, 2019 at 10:50 AM Robert Berger
<yocto.user.mailinglist@gmail.com> wrote:
>
> Hi Ken,
>
> Is there any particular reason you don't use the sample[1] for an out of
> tree kernel module?
>
> [1]
> http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta-skeleton/recipes-kernel/hello-mod
>
> Regards,
>
> Robert

Hi Robert,

We are running an older version of Yocto (Morty) for a customer. I
redacted the recipe name for the example I posted, but the recipe is
basically an identical copy of another recipe from newer versions of
Poky not present in Morty.

I might try to debug this more at some point, but the FILES statement
seems to make it work. Thanks for all the help everyone, I really
appreciate it.


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

* Re: Proper Use of KERNEL_MODULE_AUTOLOAD variable
  2019-02-03  3:16   ` Ken Sloat
                       ` (2 preceding siblings ...)
  2019-02-04 15:50     ` Robert Berger
@ 2019-02-06  1:22     ` Khem Raj
  2019-02-06 14:40       ` Ulf Samuelsson
  3 siblings, 1 reply; 11+ messages in thread
From: Khem Raj @ 2019-02-06  1:22 UTC (permalink / raw)
  To: Ken Sloat; +Cc: yocto, Nate Drude

[-- Attachment #1: Type: text/plain, Size: 2719 bytes --]

On Sat, Feb 2, 2019 at 7:17 PM Ken Sloat <ken.sloat@ohmlinxelectronics.com>
wrote:

> On Sat, Feb 2, 2019 at 10:03 PM Bruce Ashfield
> <bruce.ashfield@windriver.com> wrote:
> >
> > On 2019-02-02 9:59 p.m., Ken Sloat wrote:
> > > Hello,
> > >
> > > I have an out of tree kernel module which I want autoloaded at startup
> > > on my system. Looking at the Yocto project manual, I see that one way
> > > I can do this is to add the module name to the KERNEL_MODULE_AUTOLOAD
> > > variable within my custom module recipe.
> > >
> > > What I have found is that the module-split class is indeed generating
> > > the "/etc/modules-load.d/mymodule.conf" file, however this file is not
> > > actually being installed. To be more precise it is appearing in the
> > > "package" directory (i.e.
> > > tmp/work/**/mymodule/package/etc/modules-load.d/mymodule.conf) but not
> > > within the "image" directory (nor in my final rootfs).
> > >
> > > Is there something I'm missing in the usage of KERNEL_MODULE_AUTOLOAD?
> > > Is the intention for this variable I add extra steps to manually
> > > install this file in my recipe? FYI I'm using Morty.
> >
> > Can you provide your recipe ? It would make suggestions easier. For
> > example, my first question is: Is the module being installed to your
> > image via IMAGE_INSTALL, or some other similar variable ?
> >
> > Bruce
> >
> > >
> > > Thanks,
> > > Ken Sloat
> > >
> >
>
> Hi Bruce,
>
> Thanks for your quick reply. Yes the module is being installed via
> image_install. Module is installed but generated conf file is not. See
> recipe below:
>
> require mymodule.inc
>
> inherit module kernel-module-split
>
> DEPENDS = "virtual/kernel"
>
> EXTRA_OEMAKE_append = " \
>     KERNELDIR=${STAGING_KERNEL_DIR} \
>     "
>
> MAKE_TARGETS = "module"
>
> MODULE_NAME = "mymodule"
>
> PKG_${PN} = "kernel-module-${MODULE_NAME}"
>
> module_do_install() {
>     install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}
>     install -m 0644 ${MODULE_NAME}.ko \
>
> ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}/${MODULE_NAME}.ko
> }
>
> FILES_${PN} = " \
>     /lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} \
> "


Your recipe is overwriting common stuff which otherwise should be provided
by module bbclass
I would suggest that you append to the variables instead of over writing
them above and try to reuse
The primitives from bbclass as much as you can for best results

>
>
> KERNEL_MODULE_AUTOLOAD += "${MODULE_NAME}"
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>

[-- Attachment #2: Type: text/html, Size: 3827 bytes --]

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

* Re: Proper Use of KERNEL_MODULE_AUTOLOAD variable
  2019-02-06  1:22     ` Khem Raj
@ 2019-02-06 14:40       ` Ulf Samuelsson
  0 siblings, 0 replies; 11+ messages in thread
From: Ulf Samuelsson @ 2019-02-06 14:40 UTC (permalink / raw)
  To: Khem Raj; +Cc: yocto, Nate Drude

[-- Attachment #1: Type: text/plain, Size: 3135 bytes --]

Maybe it would be good to have a working example in the tree.

Best Regards,
Ulf Samuelsson

> 6 feb. 2019 kl. 02:22 skrev Khem Raj <raj.khem@gmail.com>:
> 
> 
> 
>> On Sat, Feb 2, 2019 at 7:17 PM Ken Sloat <ken.sloat@ohmlinxelectronics.com> wrote:
>> On Sat, Feb 2, 2019 at 10:03 PM Bruce Ashfield
>> <bruce.ashfield@windriver.com> wrote:
>> >
>> > On 2019-02-02 9:59 p.m., Ken Sloat wrote:
>> > > Hello,
>> > >
>> > > I have an out of tree kernel module which I want autoloaded at startup
>> > > on my system. Looking at the Yocto project manual, I see that one way
>> > > I can do this is to add the module name to the KERNEL_MODULE_AUTOLOAD
>> > > variable within my custom module recipe.
>> > >
>> > > What I have found is that the module-split class is indeed generating
>> > > the "/etc/modules-load.d/mymodule.conf" file, however this file is not
>> > > actually being installed. To be more precise it is appearing in the
>> > > "package" directory (i.e.
>> > > tmp/work/**/mymodule/package/etc/modules-load.d/mymodule.conf) but not
>> > > within the "image" directory (nor in my final rootfs).
>> > >
>> > > Is there something I'm missing in the usage of KERNEL_MODULE_AUTOLOAD?
>> > > Is the intention for this variable I add extra steps to manually
>> > > install this file in my recipe? FYI I'm using Morty.
>> >
>> > Can you provide your recipe ? It would make suggestions easier. For
>> > example, my first question is: Is the module being installed to your
>> > image via IMAGE_INSTALL, or some other similar variable ?
>> >
>> > Bruce
>> >
>> > >
>> > > Thanks,
>> > > Ken Sloat
>> > >
>> >
>> 
>> Hi Bruce,
>> 
>> Thanks for your quick reply. Yes the module is being installed via
>> image_install. Module is installed but generated conf file is not. See
>> recipe below:
>> 
>> require mymodule.inc
>> 
>> inherit module kernel-module-split
>> 
>> DEPENDS = "virtual/kernel"
>> 
>> EXTRA_OEMAKE_append = " \
>>     KERNELDIR=${STAGING_KERNEL_DIR} \
>>     "
>> 
>> MAKE_TARGETS = "module"
>> 
>> MODULE_NAME = "mymodule"
>> 
>> PKG_${PN} = "kernel-module-${MODULE_NAME}"
>> 
>> module_do_install() {
>>     install -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}
>>     install -m 0644 ${MODULE_NAME}.ko \
>>     ${D}/lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME}/${MODULE_NAME}.ko
>> }
>> 
>> FILES_${PN} = " \
>>     /lib/modules/${KERNEL_VERSION}/kernel/${MODULE_NAME} \
>> "
> 
> Your recipe is overwriting common stuff which otherwise should be provided by module bbclass 
> I would suggest that you append to the variables instead of over writing them above and try to reuse
> The primitives from bbclass as much as you can for best results 
>> 
>> 
>> KERNEL_MODULE_AUTOLOAD += "${MODULE_NAME}"
>> -- 
>> _______________________________________________
>> yocto mailing list
>> yocto@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
> -- 
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto

[-- Attachment #2: Type: text/html, Size: 4559 bytes --]

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

end of thread, other threads:[~2019-02-06 14:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-03  2:59 Proper Use of KERNEL_MODULE_AUTOLOAD variable Ken Sloat
2019-02-03  3:02 ` Bruce Ashfield
2019-02-03  3:16   ` Ken Sloat
2019-02-03  3:37     ` Bruce Ashfield
2019-02-03  5:43     ` Ulf Samuelsson
2019-02-03 19:09       ` Ken Sloat
2019-02-04 11:47         ` Ulf Samuelsson
2019-02-04 15:50     ` Robert Berger
2019-02-06  0:09       ` Ken Sloat
2019-02-06  1:22     ` Khem Raj
2019-02-06 14:40       ` Ulf Samuelsson

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.