All of lore.kernel.org
 help / color / mirror / Atom feed
* module do_configure depends on kernel .config and headers
@ 2016-04-15 16:02 Vajzovic, Tom
  2016-04-15 17:14 ` Bruce Ashfield
  0 siblings, 1 reply; 4+ messages in thread
From: Vajzovic, Tom @ 2016-04-15 16:02 UTC (permalink / raw)
  To: yocto@yoctoproject.org

Hi,

I am using a meta layer provided by a SOM manufacturer.  They have a recipe which sets:

inherit module

export KLIB_BUILD="${STAGING_KERNEL_DIR}"
export KLIB="${D}"

and then its do_configure script calls make, and the Makefile expects $(KLIB_BUILD)/.config to exist, and the kernel headers to be in the same place.

This sometimes succeeds and sometimes fails, which I presume is to do with the order that the other entries in the run-queue are executed.

I thought that this might be because the dependency on the kernel .config and headers is not correctly recorded in the recipe.

I added a .bbappend file to the recipe in my own layer which contains:

do_configure[depends] += "virtual/kernel:do_shared_workdir"

But this has not resolved the problem.  I have used bitbake-layers to verify that my bbappend is being applied.

So my questions are:

Is $(KLIB_BUILD) the correct place to look for the kernel .config and headers?

What is the correct way to record the dependency in the recipe?

Why isn't this done in module.bbclass?  Wouldn't all modules depend on the kernel headers?

Thanks,
Tom


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

* Re: module do_configure depends on kernel .config and headers
  2016-04-15 16:02 module do_configure depends on kernel .config and headers Vajzovic, Tom
@ 2016-04-15 17:14 ` Bruce Ashfield
  2016-04-18 10:16   ` Vajzovic, Tom
  0 siblings, 1 reply; 4+ messages in thread
From: Bruce Ashfield @ 2016-04-15 17:14 UTC (permalink / raw)
  To: Vajzovic, Tom; +Cc: yocto@yoctoproject.org

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

On Fri, Apr 15, 2016 at 12:02 PM, Vajzovic, Tom <Tom.Vajzovic@irisys.co.uk>
wrote:

> Hi,
>
> I am using a meta layer provided by a SOM manufacturer.  They have a
> recipe which sets:
>
>
What branch are you using ? master ? jethro ? ... something else ? The
answer
changes with the branch you are using since the management of the kernel
source and build artifacts has changed over time.


> inherit module
>
> export KLIB_BUILD="${STAGING_KERNEL_DIR}"
> export KLIB="${D}"
>
> and then its do_configure script calls make, and the Makefile expects
> $(KLIB_BUILD)/.config to exist, and the kernel headers to be in the same
> place.
>
> This sometimes succeeds and sometimes fails, which I presume is to do with
> the order that the other entries in the run-queue are executed.
>
> I thought that this might be because the dependency on the kernel .config
> and headers is not correctly recorded in the recipe.
>
> I added a .bbappend file to the recipe in my own layer which contains:
>
> do_configure[depends] += "virtual/kernel:do_shared_workdir"
>
> But this has not resolved the problem.  I have used bitbake-layers to
> verify that my bbappend is being applied.
>
> So my questions are:
>
> Is $(KLIB_BUILD) the correct place to look for the kernel .config and
> headers?
>


The .config is in: STAGING_KERNEL_BUILDDIR, that also has any generated
files as part
of the build.

The headers are in the shared_workdir, as you had found: STAGING_KERNEL_DIR

.. so there's a split in the files, if you look in the git history of those
files you'll see the
reasons why it is like that (less disk i/o, build time, packaging/sharing
of source, etc).


>
> What is the correct way to record the dependency in the recipe?
>
> Why isn't this done in module.bbclass?  Wouldn't all modules depend on the
> kernel headers?
>

It pretty much does, with this in module-base.bbclass:

# This is instead of DEPENDS = "virtual/kernel"

do_configure[depends] += "virtual/kernel:do_compile_kernelmodules"


.. this isn't a simple place to wade in, I work on this quite a bit and I
still have to

double check things.
Bruce


>
> Thanks,
> Tom
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>



-- 
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"

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

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

* Re: module do_configure depends on kernel .config and headers
  2016-04-15 17:14 ` Bruce Ashfield
@ 2016-04-18 10:16   ` Vajzovic, Tom
  2016-04-19 17:45     ` Bruce Ashfield
  0 siblings, 1 reply; 4+ messages in thread
From: Vajzovic, Tom @ 2016-04-18 10:16 UTC (permalink / raw)
  To: yocto@yoctoproject.org

Hi Bruce,

From: Bruce Ashfield
Sent: 15 April 2016 18:15
> On Fri, Apr 15, 2016 at 12:02 PM, Vajzovic, Tom wrote:
>>
>> I am using a meta layer provided by a SOM manufacturer.
>> They have a recipe which sets:
>
> What branch are you using ?

Fido.
 
>> inherit module
>>
>> export KLIB_BUILD="${STAGING_KERNEL_DIR}"
>> export KLIB="${D}"
>> 
>> and then its do_configure script calls make, and the Makefile
>> expects $(KLIB_BUILD)/.config to exist, and the kernel headers to be
>> in the same place.
>>
>> This sometimes succeeds and sometimes fails, which I presume is to
>> do with the order that the other entries in the run-queue are
>> executed.
>> 
>> I thought that this might be because the dependency on the kernel
>> .config and headers is not correctly recorded in the recipe.
>> 
>> I added a .bbappend file to the recipe in my own layer which
>> contains:
>>
>> do_configure[depends] += "virtual/kernel:do_shared_workdir"
>>
>> But this has not resolved the problem.  I have used
>> bitbake-layers to verify that my bbappend is being applied.
>>
>> So my questions are:
>>
>> Is $(KLIB_BUILD) the correct place to look for the kernel
>> .config and headers?
>
> The .config is in: STAGING_KERNEL_BUILDDIR, that also has any
> generated files as part of the build.
>
> The headers are in the shared_workdir, as you had found:
> STAGING_KERNEL_DIR

I have a copy of .config in both STAGING_KERNEL_DIR and 
STAGING_KERNEL_BUILDDIR.  They differ only on that the latter has
CONFIG_LOCALVERSION added.  Is this normal?  Can I depend on the
copy in STAGING_KERNEL_DIR? I think that is what the configure
script is currently using.  How else might it differ?

>> What is the correct way to record the dependency in the recipe?
>>
>> Why isn't this done in module.bbclass?  Wouldn't all modules depend
>> on the kernel headers?
>
> It pretty much does, with this in module-base.bbclass:
> do_configure[depends] += "virtual/kernel:do_compile_kernelmodules"

In my Fido modules-base.bbclass I have exactly:

do_configure[depends] += "virtual/kernel:do_shared_workdir"

So this means that my bbappend is a no-op (I only looked as far as
modules.bbclass; I missed modules-base).

Thanks,
Tom

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

* Re: module do_configure depends on kernel .config and headers
  2016-04-18 10:16   ` Vajzovic, Tom
@ 2016-04-19 17:45     ` Bruce Ashfield
  0 siblings, 0 replies; 4+ messages in thread
From: Bruce Ashfield @ 2016-04-19 17:45 UTC (permalink / raw)
  To: Vajzovic, Tom, yocto@yoctoproject.org

On 2016-04-18 6:16 AM, Vajzovic, Tom wrote:
> Hi Bruce,
>
> From: Bruce Ashfield
> Sent: 15 April 2016 18:15
>> On Fri, Apr 15, 2016 at 12:02 PM, Vajzovic, Tom wrote:
>>>
>>> I am using a meta layer provided by a SOM manufacturer.
>>> They have a recipe which sets:
>>
>> What branch are you using ?
>
> Fido.
>
>>> inherit module
>>>
>>> export KLIB_BUILD="${STAGING_KERNEL_DIR}"
>>> export KLIB="${D}"
>>>
>>> and then its do_configure script calls make, and the Makefile
>>> expects $(KLIB_BUILD)/.config to exist, and the kernel headers to be
>>> in the same place.
>>>
>>> This sometimes succeeds and sometimes fails, which I presume is to
>>> do with the order that the other entries in the run-queue are
>>> executed.
>>>
>>> I thought that this might be because the dependency on the kernel
>>> .config and headers is not correctly recorded in the recipe.
>>>
>>> I added a .bbappend file to the recipe in my own layer which
>>> contains:
>>>
>>> do_configure[depends] += "virtual/kernel:do_shared_workdir"
>>>
>>> But this has not resolved the problem.  I have used
>>> bitbake-layers to verify that my bbappend is being applied.
>>>
>>> So my questions are:
>>>
>>> Is $(KLIB_BUILD) the correct place to look for the kernel
>>> .config and headers?
>>
>> The .config is in: STAGING_KERNEL_BUILDDIR, that also has any
>> generated files as part of the build.
>>
>> The headers are in the shared_workdir, as you had found:
>> STAGING_KERNEL_DIR
>
> I have a copy of .config in both STAGING_KERNEL_DIR and
> STAGING_KERNEL_BUILDDIR.  They differ only on that the latter has
> CONFIG_LOCALVERSION added.  Is this normal?  Can I depend on the
> copy in STAGING_KERNEL_DIR? I think that is what the configure
> script is currently using.  How else might it differ?

They shouldn't really differ at all, but there's been issues with
the timing on when the shared directory is populated, so there
may be a lurking race on fido.

I'd count on the one in the kernel_builddir, but I imagine that
either will work in a pinch.

>
>>> What is the correct way to record the dependency in the recipe?
>>>
>>> Why isn't this done in module.bbclass?  Wouldn't all modules depend
>>> on the kernel headers?
>>
>> It pretty much does, with this in module-base.bbclass:
>> do_configure[depends] += "virtual/kernel:do_compile_kernelmodules"
>
> In my Fido modules-base.bbclass I have exactly:
>
> do_configure[depends] += "virtual/kernel:do_shared_workdir"
>
> So this means that my bbappend is a no-op (I only looked as far as
> modules.bbclass; I missed modules-base).

Hmm. So we are no further ahead.

Bruce

>
> Thanks,
> Tom
>



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

end of thread, other threads:[~2016-04-19 17:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-15 16:02 module do_configure depends on kernel .config and headers Vajzovic, Tom
2016-04-15 17:14 ` Bruce Ashfield
2016-04-18 10:16   ` Vajzovic, Tom
2016-04-19 17:45     ` Bruce Ashfield

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.