Openembedded Core Discussions
 help / color / mirror / Atom feed
* Re: [OE-core] Issues with kernel.bbclass default "S" value
       [not found] <17607A9B07F730BC.26337@lists.openembedded.org>
@ 2023-05-23  7:40 ` Luca Ceresoli
  0 siblings, 0 replies; only message in thread
From: Luca Ceresoli @ 2023-05-23  7:40 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: luca.ceresoli, openembedded-core

Hello Bruce,

On Fri, 19 May 2023 09:24:21 +0200
"Luca Ceresoli via lists.openembedded.org"
<luca.ceresoli=bootlin.com@lists.openembedded.org> wrote:

> Hello,
> 
> I have been facing some troubles while writing a very simple recipe
> inheriting kernel.bbclass to build a mainline kernel.
> 
> The error message is:
> 
>   ... do_populate_lic: QA Issue: ... LIC_FILES_CHKSUM points to an invalid file: .../work-shared/.../kernel-source/COPYING [license-checksum]
> 
> After my investigation, this turned out to happen when not setting S in
> the recipe, which results in an empty work-shared/.../kernel-source
> directory.
> 
> If S in not set in the recipe, kernel.bbclass sets it to
> ${STAGING_KERNEL_DIR} (${TMPDIR}/work-shared/${MACHINE}/kernel-source).
> This means that in do_symlink_kernsrc(), the 'if s != kernsrc' never
> triggers. By reading the code under that if, it appears to assume that
> STAGING_KERNEL_DIR somehow contains the kernel sources already, however
> I haven't found any code that is supposed to unpack it there. Also, in
> all my tests with S not set in the recipe I had the kernel expanded
> inside the WORKDIR, never in STAGING_KERNEL_DIR.
> 
> I have considered two use cases:
> 
>  * When fetching from git, setting S is mandatory, thus one shouldn't
>    expect things to work without setting it. However the error message
>    is totally misleading
> 
>  * When fetching a tarball and without setting S, the same misleading
>    error message appears. However not setting S is totally normal for
>    regular recipes fetching a tarball, thus it's hard to blame the
>    recipe developer for not setting S. It would be even more nice to
>    produce an explanatory error message such as "Please set S when
>    using kernel.bbclass".
> 
> However I am most likely missing other relevant use cases.
> 
> I started writing a patch to add such an error message, but I soon
> realized that writing the most appropriate 'if' to trigger the message
> would require me to understand something:
> 
>  * In which use cases does it make sense to have S ==
>    STAGING_KERNEL_DIR?
> 
>  * How is the kernel expected to be unpacked in STAGING_KERNEL_DIR when
>    S == STAGING_KERNEL_DIR?
> 
> Another, related question: are non-core layers expected to set
> STAGING_KERNEL_DIR? My understanding is that it is set in
> kernel.bbclass (and a few other oe-core classes) for others to read,
> never to be modified elsewhere. The ref manual is vague about this, I'd
> be glad to clarify it.

Do you have an opinion about these question?

Best regards,
Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-23  7:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <17607A9B07F730BC.26337@lists.openembedded.org>
2023-05-23  7:40 ` [OE-core] Issues with kernel.bbclass default "S" value Luca Ceresoli

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