Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Luca Ceresoli <luca.ceresoli@bootlin.com>
To: Bruce Ashfield <bruce.ashfield@gmail.com>
Cc: luca.ceresoli@bootlin.com, openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] Issues with kernel.bbclass default "S" value
Date: Tue, 23 May 2023 09:40:49 +0200	[thread overview]
Message-ID: <20230523094049.77874439@booty> (raw)
In-Reply-To: <17607A9B07F730BC.26337@lists.openembedded.org>

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


           reply	other threads:[~2023-05-23  7:40 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <17607A9B07F730BC.26337@lists.openembedded.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230523094049.77874439@booty \
    --to=luca.ceresoli@bootlin.com \
    --cc=bruce.ashfield@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox