diff mbox series

kernel-yocto: Do not use allnoconfig for in-tree configs

Message ID 20250616183028.87531-1-alexander.sowarka@linaro.org
State New
Headers show
Series kernel-yocto: Do not use allnoconfig for in-tree configs | expand

Commit Message

Alexander Sowarka June 16, 2025, 6:30 p.m. UTC
The documentation clearly states that in-tree configs, configured with
KBUILD_DEFCONFIG will set all missing config flags to their default
value and specifying KCONFIG_MODE is not required.
Fix the check for in-tree configs.

Signed-off-by: Alexander Sowarka <alexander.sowarka@linaro.org>
---
 meta/classes-recipe/kernel-yocto.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bruce Ashfield June 16, 2025, 11:42 p.m. UTC | #1
On Mon, Jun 16, 2025 at 2:30 PM Alexander Sowarka via lists.openembedded.org
<alexander.sowarka=linaro.org@lists.openembedded.org> wrote:

> The documentation clearly states that in-tree configs, configured with
> KBUILD_DEFCONFIG will set all missing config flags to their default
> value and specifying KCONFIG_MODE is not required.
> Fix the check for in-tree configs.
>

The documentation is wrong then. It was written to match the code, not
vice versa.

This behaviour should stay at the default, since there's a way to override
it,
and it has been that way for quite some time.

Cheers,

Bruce



>
> Signed-off-by: Alexander Sowarka <alexander.sowarka@linaro.org>
> ---
>  meta/classes-recipe/kernel-yocto.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes-recipe/kernel-yocto.bbclass
> b/meta/classes-recipe/kernel-yocto.bbclass
> index 9a86616dad..44d09a9b42 100644
> --- a/meta/classes-recipe/kernel-yocto.bbclass
> +++ b/meta/classes-recipe/kernel-yocto.bbclass
> @@ -460,7 +460,7 @@ do_kernel_configme() {
>                         config_flags=""
>                         ;;
>                 *)
> -                       if [ -f ${WORKDIR}/defconfig ]; then
> +                       if [ -z ${KBUILD_DEFCONFIG} ] && [ -f
> ${WORKDIR}/defconfig ]; then
>                                 config_flags="-n"
>                         fi
>                         ;;
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#218845):
> https://lists.openembedded.org/g/openembedded-core/message/218845
> Mute This Topic: https://lists.openembedded.org/mt/113676136/1050810
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Bruce Ashfield June 16, 2025, 11:45 p.m. UTC | #2
On Mon, Jun 16, 2025 at 7:42 PM Bruce Ashfield via lists.openembedded.org
<bruce.ashfield=gmail.com@lists.openembedded.org> wrote:

>
>
> On Mon, Jun 16, 2025 at 2:30 PM Alexander Sowarka via
> lists.openembedded.org <alexander.sowarka=
> linaro.org@lists.openembedded.org> wrote:
>
>> The documentation clearly states that in-tree configs, configured with
>> KBUILD_DEFCONFIG will set all missing config flags to their default
>> value and specifying KCONFIG_MODE is not required.
>> Fix the check for in-tree configs.
>>
>
> The documentation is wrong then. It was written to match the code, not
> vice versa.
>

Actually, what I'd rather suggest is amending the log to not mention the
documentation.

It is never a reason to change the kernel code (which is what I was
stating), since the code came first.

We could change this, as the behaviour would still be the same for an
out of tree defconfig (which is the real -n case).

So with an amended commit log, I withdraw my objection.

Bruce


> This behaviour should stay at the default, since there's a way to override
> it,
> and it has been that way for quite some time.
>
> Cheers,
>
> Bruce
>
>
>
>>
>> Signed-off-by: Alexander Sowarka <alexander.sowarka@linaro.org>
>> ---
>>  meta/classes-recipe/kernel-yocto.bbclass | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/classes-recipe/kernel-yocto.bbclass
>> b/meta/classes-recipe/kernel-yocto.bbclass
>> index 9a86616dad..44d09a9b42 100644
>> --- a/meta/classes-recipe/kernel-yocto.bbclass
>> +++ b/meta/classes-recipe/kernel-yocto.bbclass
>> @@ -460,7 +460,7 @@ do_kernel_configme() {
>>                         config_flags=""
>>                         ;;
>>                 *)
>> -                       if [ -f ${WORKDIR}/defconfig ]; then
>> +                       if [ -z ${KBUILD_DEFCONFIG} ] && [ -f
>> ${WORKDIR}/defconfig ]; then
>>                                 config_flags="-n"
>>                         fi
>>                         ;;
>>
>>
>>
>>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await thee
> at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#218847):
> https://lists.openembedded.org/g/openembedded-core/message/218847
> Mute This Topic: https://lists.openembedded.org/mt/113676136/1050810
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> bruce.ashfield@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Alexander Sowarka June 17, 2025, 12:39 a.m. UTC | #3
I just saw that the documentation was already changed recently with commit
https://git.yoctoproject.org/poky/commit/?id=d87b9163a1c2954bedecc01fb08f7af5ab1ae63d
Though I would argue that alldefconfig would actually be a sane default for
in-tree configs. I would suggest that I update the
commit message and re-add the paragraph in the documentation. If this
feature is not desired I suggest adding a sentence
to the in-tree defconfig section in common.rst that actually setting
KCONFIG_MODE is required. I had a hard time figuring out why my kernel was
completely broken
without this setting.

Kind regards,
Alexander Sowarka


On Mon, 16 Jun 2025 at 20:45, Bruce Ashfield <bruce.ashfield@gmail.com>
wrote:

>
>
> On Mon, Jun 16, 2025 at 7:42 PM Bruce Ashfield via lists.openembedded.org
> <bruce.ashfield=gmail.com@lists.openembedded.org> wrote:
>
>>
>>
>> On Mon, Jun 16, 2025 at 2:30 PM Alexander Sowarka via
>> lists.openembedded.org <alexander.sowarka=
>> linaro.org@lists.openembedded.org> wrote:
>>
>>> The documentation clearly states that in-tree configs, configured with
>>> KBUILD_DEFCONFIG will set all missing config flags to their default
>>> value and specifying KCONFIG_MODE is not required.
>>> Fix the check for in-tree configs.
>>>
>>
>> The documentation is wrong then. It was written to match the code, not
>> vice versa.
>>
>
> Actually, what I'd rather suggest is amending the log to not mention the
> documentation.
>
> It is never a reason to change the kernel code (which is what I was
> stating), since the code came first.
>
> We could change this, as the behaviour would still be the same for an
> out of tree defconfig (which is the real -n case).
>
> So with an amended commit log, I withdraw my objection.
>
> Bruce
>
>
>> This behaviour should stay at the default, since there's a way to
>> override it,
>> and it has been that way for quite some time.
>>
>> Cheers,
>>
>> Bruce
>>
>>
>>
>>>
>>> Signed-off-by: Alexander Sowarka <alexander.sowarka@linaro.org>
>>> ---
>>>  meta/classes-recipe/kernel-yocto.bbclass | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/meta/classes-recipe/kernel-yocto.bbclass
>>> b/meta/classes-recipe/kernel-yocto.bbclass
>>> index 9a86616dad..44d09a9b42 100644
>>> --- a/meta/classes-recipe/kernel-yocto.bbclass
>>> +++ b/meta/classes-recipe/kernel-yocto.bbclass
>>> @@ -460,7 +460,7 @@ do_kernel_configme() {
>>>                         config_flags=""
>>>                         ;;
>>>                 *)
>>> -                       if [ -f ${WORKDIR}/defconfig ]; then
>>> +                       if [ -z ${KBUILD_DEFCONFIG} ] && [ -f
>>> ${WORKDIR}/defconfig ]; then
>>>                                 config_flags="-n"
>>>                         fi
>>>                         ;;
>>>
>>>
>>>
>>>
>>
>> --
>> - Thou shalt not follow the NULL pointer, for chaos and madness await
>> thee at its end
>> - "Use the force Harry" - Gandalf, Star Trek II
>>
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#218847):
>> https://lists.openembedded.org/g/openembedded-core/message/218847
>> Mute This Topic: https://lists.openembedded.org/mt/113676136/1050810
>> Group Owner: openembedded-core+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
>> bruce.ashfield@gmail.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>>
>
> --
> - Thou shalt not follow the NULL pointer, for chaos and madness await thee
> at its end
> - "Use the force Harry" - Gandalf, Star Trek II
>
>
Bruce Ashfield June 17, 2025, 12:45 a.m. UTC | #4
On Mon, Jun 16, 2025 at 8:39 PM Alexander Sowarka <
alexander.sowarka@linaro.org> wrote:

> I just saw that the documentation was already changed recently with commit
> https://git.yoctoproject.org/poky/commit/?id=d87b9163a1c2954bedecc01fb08f7af5ab1ae63d
> Though I would argue that alldefconfig would actually be a sane default
> for in-tree configs. I would suggest that I update the
>

It is a sane default now, definitely. It wasn't when I started the
configuration framework.

The Kconfig's didn't have enough selected, and often the defconfigs were
complete .config's,
so we started with everything off,  that way we only got what was
explicitly specified.

That's the history and baseline for why I rescinded my concerns! :)

Bruce



> commit message and re-add the paragraph in the documentation. If this
> feature is not desired I suggest adding a sentence
> to the in-tree defconfig section in common.rst that actually setting
> KCONFIG_MODE is required. I had a hard time figuring out why my kernel was
> completely broken
> without this setting.
>
> Kind regards,
> Alexander Sowarka
>
>
> On Mon, 16 Jun 2025 at 20:45, Bruce Ashfield <bruce.ashfield@gmail.com>
> wrote:
>
>>
>>
>> On Mon, Jun 16, 2025 at 7:42 PM Bruce Ashfield via lists.openembedded.org
>> <bruce.ashfield=gmail.com@lists.openembedded.org> wrote:
>>
>>>
>>>
>>> On Mon, Jun 16, 2025 at 2:30 PM Alexander Sowarka via
>>> lists.openembedded.org <alexander.sowarka=
>>> linaro.org@lists.openembedded.org> wrote:
>>>
>>>> The documentation clearly states that in-tree configs, configured with
>>>> KBUILD_DEFCONFIG will set all missing config flags to their default
>>>> value and specifying KCONFIG_MODE is not required.
>>>> Fix the check for in-tree configs.
>>>>
>>>
>>> The documentation is wrong then. It was written to match the code, not
>>> vice versa.
>>>
>>
>> Actually, what I'd rather suggest is amending the log to not mention the
>> documentation.
>>
>> It is never a reason to change the kernel code (which is what I was
>> stating), since the code came first.
>>
>> We could change this, as the behaviour would still be the same for an
>> out of tree defconfig (which is the real -n case).
>>
>> So with an amended commit log, I withdraw my objection.
>>
>> Bruce
>>
>>
>>> This behaviour should stay at the default, since there's a way to
>>> override it,
>>> and it has been that way for quite some time.
>>>
>>> Cheers,
>>>
>>> Bruce
>>>
>>>
>>>
>>>>
>>>> Signed-off-by: Alexander Sowarka <alexander.sowarka@linaro.org>
>>>> ---
>>>>  meta/classes-recipe/kernel-yocto.bbclass | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/meta/classes-recipe/kernel-yocto.bbclass
>>>> b/meta/classes-recipe/kernel-yocto.bbclass
>>>> index 9a86616dad..44d09a9b42 100644
>>>> --- a/meta/classes-recipe/kernel-yocto.bbclass
>>>> +++ b/meta/classes-recipe/kernel-yocto.bbclass
>>>> @@ -460,7 +460,7 @@ do_kernel_configme() {
>>>>                         config_flags=""
>>>>                         ;;
>>>>                 *)
>>>> -                       if [ -f ${WORKDIR}/defconfig ]; then
>>>> +                       if [ -z ${KBUILD_DEFCONFIG} ] && [ -f
>>>> ${WORKDIR}/defconfig ]; then
>>>>                                 config_flags="-n"
>>>>                         fi
>>>>                         ;;
>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> - Thou shalt not follow the NULL pointer, for chaos and madness await
>>> thee at its end
>>> - "Use the force Harry" - Gandalf, Star Trek II
>>>
>>>
>>> -=-=-=-=-=-=-=-=-=-=-=-
>>> Links: You receive all messages sent to this group.
>>> View/Reply Online (#218847):
>>> https://lists.openembedded.org/g/openembedded-core/message/218847
>>> Mute This Topic: https://lists.openembedded.org/mt/113676136/1050810
>>> Group Owner: openembedded-core+owner@lists.openembedded.org
>>> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
>>> bruce.ashfield@gmail.com]
>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>
>>>
>>
>> --
>> - Thou shalt not follow the NULL pointer, for chaos and madness await
>> thee at its end
>> - "Use the force Harry" - Gandalf, Star Trek II
>>
>>
diff mbox series

Patch

diff --git a/meta/classes-recipe/kernel-yocto.bbclass b/meta/classes-recipe/kernel-yocto.bbclass
index 9a86616dad..44d09a9b42 100644
--- a/meta/classes-recipe/kernel-yocto.bbclass
+++ b/meta/classes-recipe/kernel-yocto.bbclass
@@ -460,7 +460,7 @@  do_kernel_configme() {
 			config_flags=""
 			;;
 		*)
-			if [ -f ${WORKDIR}/defconfig ]; then
+			if [ -z ${KBUILD_DEFCONFIG} ] && [ -f ${WORKDIR}/defconfig ]; then
 				config_flags="-n"
 			fi
 			;;