All of lore.kernel.org
 help / color / mirror / Atom feed
* [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class
@ 2022-10-12  7:18 Alex Kiernan
  2022-10-12  7:18 ` [OE-Core][PATCH v2 2/3] u-boot: Remove duplicate inherit of cml1 Alex Kiernan
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Alex Kiernan @ 2022-10-12  7:18 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alex Kiernan

Move savedefconfig task to a class so we can reuse it in other recipes
which support it.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
 meta/classes-recipe/cml1-savedefconfig.bbclass | 12 ++++++++++++
 meta/classes-recipe/kernel.bbclass             |  9 +--------
 2 files changed, 13 insertions(+), 8 deletions(-)
 create mode 100644 meta/classes-recipe/cml1-savedefconfig.bbclass

diff --git a/meta/classes-recipe/cml1-savedefconfig.bbclass b/meta/classes-recipe/cml1-savedefconfig.bbclass
new file mode 100644
index 000000000000..c340aac11204
--- /dev/null
+++ b/meta/classes-recipe/cml1-savedefconfig.bbclass
@@ -0,0 +1,12 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+do_savedefconfig() {
+	bbplain "Saving defconfig to:\n${B}/defconfig"
+	oe_runmake -C ${B} savedefconfig
+}
+do_savedefconfig[nostamp] = "1"
+addtask savedefconfig after do_configure
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index e4e69e076375..eae7b2f78a9e 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -634,14 +634,7 @@ kernel_do_configure() {
 	${KERNEL_CONFIG_COMMAND}
 }
 
-do_savedefconfig() {
-	bbplain "Saving defconfig to:\n${B}/defconfig"
-	oe_runmake -C ${B} savedefconfig
-}
-do_savedefconfig[nostamp] = "1"
-addtask savedefconfig after do_configure
-
-inherit cml1
+inherit cml1 cml1-savedefconfig
 
 # Need LD, HOSTLDFLAGS and more for config operations
 KCONFIG_CONFIG_COMMAND:append = " ${EXTRA_OEMAKE}"
-- 
2.35.1



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

* [OE-Core][PATCH v2 2/3] u-boot: Remove duplicate inherit of cml1
  2022-10-12  7:18 [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class Alex Kiernan
@ 2022-10-12  7:18 ` Alex Kiernan
  2022-10-12  7:18 ` [OE-Core][PATCH v2 3/3] u-boot: Add savedefconfig task Alex Kiernan
  2022-10-12 16:35 ` [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class Ross Burton
  2 siblings, 0 replies; 9+ messages in thread
From: Alex Kiernan @ 2022-10-12  7:18 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alex Kiernan

Splitting u-boot-configure.inc out of the base left duplicate
cml1.bbclass in the base include.

Fixes: fc9a17ad386c ("u-boot: Split do_configure logic into separate file")
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
 meta/recipes-bsp/u-boot/u-boot.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index f022aed732ce..b2f33e382664 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -5,7 +5,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 DEPENDS += "${@bb.utils.contains('UBOOT_ENV_SUFFIX', 'scr', 'u-boot-mkimage-native', '', d)}"
 
-inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 python3native kernel-arch
+inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kernel-arch
 
 DEPENDS += "swig-native"
 
-- 
2.35.1



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

* [OE-Core][PATCH v2 3/3] u-boot: Add savedefconfig task
  2022-10-12  7:18 [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class Alex Kiernan
  2022-10-12  7:18 ` [OE-Core][PATCH v2 2/3] u-boot: Remove duplicate inherit of cml1 Alex Kiernan
@ 2022-10-12  7:18 ` Alex Kiernan
  2022-10-12 16:35 ` [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class Ross Burton
  2 siblings, 0 replies; 9+ messages in thread
From: Alex Kiernan @ 2022-10-12  7:18 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alex Kiernan

Add savedefconfig task which U-Boot supports (unfortunately not all
consumers of cml1 support this).

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
---
 meta/recipes-bsp/u-boot/u-boot.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index b2f33e382664..046e842289fa 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -5,7 +5,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 
 DEPENDS += "${@bb.utils.contains('UBOOT_ENV_SUFFIX', 'scr', 'u-boot-mkimage-native', '', d)}"
 
-inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kernel-arch
+inherit uboot-config uboot-extlinux-config uboot-sign deploy python3native kernel-arch cml1-savedefconfig
 
 DEPENDS += "swig-native"
 
-- 
2.35.1



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

* Re: [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class
  2022-10-12  7:18 [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class Alex Kiernan
  2022-10-12  7:18 ` [OE-Core][PATCH v2 2/3] u-boot: Remove duplicate inherit of cml1 Alex Kiernan
  2022-10-12  7:18 ` [OE-Core][PATCH v2 3/3] u-boot: Add savedefconfig task Alex Kiernan
@ 2022-10-12 16:35 ` Ross Burton
  2022-10-12 17:49   ` Khem Raj
  2022-10-12 19:43   ` Alex Kiernan
  2 siblings, 2 replies; 9+ messages in thread
From: Ross Burton @ 2022-10-12 16:35 UTC (permalink / raw)
  To: alex.kiernan; +Cc: openembedded-core

On 12 Oct 2022, at 08:18, Alex Kiernan via lists.openembedded.org <alex.kiernan=gmail.com@lists.openembedded.org> wrote:
> 
> Move savedefconfig task to a class so we can reuse it in other recipes
> which support it.

There are three users of cml1 in oe-core: kernel, uboot, and busybox.  Does busybox support savedefconfig?

I’m thinking to avoid tiny classes we can just add this to cml1.bbclass and make it print a decent error message if it doesn’t work.

Ross

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

* Re: [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class
  2022-10-12 16:35 ` [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class Ross Burton
@ 2022-10-12 17:49   ` Khem Raj
  2022-10-12 19:43   ` Alex Kiernan
  1 sibling, 0 replies; 9+ messages in thread
From: Khem Raj @ 2022-10-12 17:49 UTC (permalink / raw)
  To: Ross Burton; +Cc: alex.kiernan, openembedded-core

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

On Wed, Oct 12, 2022 at 9:36 AM Ross Burton <ross.burton@arm.com> wrote:

> On 12 Oct 2022, at 08:18, Alex Kiernan via lists.openembedded.org
> <alex.kiernan=gmail.com@lists.openembedded.org> wrote:
> >
> > Move savedefconfig task to a class so we can reuse it in other recipes
> > which support it.
>
> There are three users of cml1 in oe-core: kernel, uboot, and busybox.
> Does busybox support savedefconfig?
>
> I’m thinking to avoid tiny classes we can just add this to cml1.bbclass
> and make it print a decent error message if it doesn’t work.
>

I agree I think it should be there for all kconfig users and they can strub
it in recipe if needed

>
> Ross
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#171669):
> https://lists.openembedded.org/g/openembedded-core/message/171669
> Mute This Topic: https://lists.openembedded.org/mt/94276340/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

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

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

* Re: [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class
  2022-10-12 16:35 ` [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class Ross Burton
  2022-10-12 17:49   ` Khem Raj
@ 2022-10-12 19:43   ` Alex Kiernan
  2022-10-13  5:31     ` Ulrich Ölmann
  2022-10-31 22:12     ` Ross Burton
  1 sibling, 2 replies; 9+ messages in thread
From: Alex Kiernan @ 2022-10-12 19:43 UTC (permalink / raw)
  To: Ross Burton; +Cc: openembedded-core

On Wed, Oct 12, 2022 at 5:36 PM Ross Burton <Ross.Burton@arm.com> wrote:
>
> On 12 Oct 2022, at 08:18, Alex Kiernan via lists.openembedded.org <alex.kiernan=gmail.com@lists.openembedded.org> wrote:
> >
> > Move savedefconfig task to a class so we can reuse it in other recipes
> > which support it.
>
> There are three users of cml1 in oe-core: kernel, uboot, and busybox.  Does busybox support savedefconfig?
>

It doesn't and fairly obviously goes boom...

ERROR: busybox-1.35.0-r0 do_savedefconfig: oe_runmake failed
ERROR: busybox-1.35.0-r0 do_savedefconfig:
ExecutionError('/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/temp/run.do_savedefconfig.12421',
1, None, None)
ERROR: Logfile of failure stored in:
/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/temp/log.do_savedefconfig.12421
Log data follows:
| DEBUG: Executing shell function do_savedefconfig
| Saving defconfig to:
| /home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0/defconfig
| NOTE: make CC=x86_64-poky-linux-gcc  -m64 -march=core2 -mtune=core2
-msse3 -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2
--sysroot=/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/recipe-sysroot
LD=x86_64-poky-linux-gcc  -m64 -march=core2 -mtune=core2 -msse3
-mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2
--sysroot=/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/recipe-sysroot
V=1 ARCH=x86_64 CROSS_COMPILE=x86_64-poky-linux- SKIP_STRIP=y
HOSTCC=gcc  HOSTCPP=gcc  -E -C
/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0
savedefconfig
| make: Entering directory
'/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0'
| make -f scripts/Makefile.build obj=scripts/basic
| /home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0/scripts/gen_build_files.sh
/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0
/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0
| mkdir -p include
| make -f scripts/Makefile.build obj=scripts/kconfig savedefconfig
| make[1]: *** No rule to make target 'savedefconfig'.  Stop.
| make: *** [Makefile:444: savedefconfig] Error 2
| make: Leaving directory
'/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0'
| ERROR: oe_runmake failed

> I’m thinking to avoid tiny classes we can just add this to cml1.bbclass and make it print a decent error message if it doesn’t work.
>

So where I started, was adding it to u-boot.inc (which isn't a class,
I guess an artefact of history), because tiny classes felt like a poor
choice. I can add it to cml1 instead, at which point I've tried all
three options, maybe that's the best option and if you have a consumer
that doesn't do it, you just get a fail as above.

Are there are other users of cml1 other than these three? My suspicion
is there isn't (though I've only looked at layers I've got checked
out).

-- 
Alex Kiernan


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

* Re: [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class
  2022-10-12 19:43   ` Alex Kiernan
@ 2022-10-13  5:31     ` Ulrich Ölmann
  2022-10-31 22:12     ` Ross Burton
  1 sibling, 0 replies; 9+ messages in thread
From: Ulrich Ölmann @ 2022-10-13  5:31 UTC (permalink / raw)
  To: Alex Kiernan; +Cc: Ross Burton, openembedded-core

On Wed, Oct 12 2022 at 20:43 +0100, "Alex Kiernan" <alex.kiernan@gmail.com> wrote:
> On Wed, Oct 12, 2022 at 5:36 PM Ross Burton <Ross.Burton@arm.com> wrote:
>>
>> On 12 Oct 2022, at 08:18, Alex Kiernan via lists.openembedded.org <alex.kiernan=gmail.com@lists.openembedded.org> wrote:
>> >
>> > Move savedefconfig task to a class so we can reuse it in other recipes
>> > which support it.
>>
>> There are three users of cml1 in oe-core: kernel, uboot, and busybox.  Does busybox support savedefconfig?
>>
>
> It doesn't and fairly obviously goes boom...
>
> ERROR: busybox-1.35.0-r0 do_savedefconfig: oe_runmake failed
> ERROR: busybox-1.35.0-r0 do_savedefconfig:
> ExecutionError('/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/temp/run.do_savedefconfig.12421',
> 1, None, None)
> ERROR: Logfile of failure stored in:
> /home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/temp/log.do_savedefconfig.12421
> Log data follows:
> | DEBUG: Executing shell function do_savedefconfig
> | Saving defconfig to:
> | /home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0/defconfig
> | NOTE: make CC=x86_64-poky-linux-gcc  -m64 -march=core2 -mtune=core2
> -msse3 -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2
> --sysroot=/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/recipe-sysroot
> LD=x86_64-poky-linux-gcc  -m64 -march=core2 -mtune=core2 -msse3
> -mfpmath=sse -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2
> --sysroot=/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/recipe-sysroot
> V=1 ARCH=x86_64 CROSS_COMPILE=x86_64-poky-linux- SKIP_STRIP=y
> HOSTCC=gcc  HOSTCPP=gcc  -E -C
> /home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0
> savedefconfig
> | make: Entering directory
> '/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0'
> | make -f scripts/Makefile.build obj=scripts/basic
> | /home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0/scripts/gen_build_files.sh
> /home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0
> /home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0
> | mkdir -p include
> | make -f scripts/Makefile.build obj=scripts/kconfig savedefconfig
> | make[1]: *** No rule to make target 'savedefconfig'.  Stop.
> | make: *** [Makefile:444: savedefconfig] Error 2
> | make: Leaving directory
> '/home/alexk/poky/build/tmp/work/core2-64-poky-linux/busybox/1.35.0-r0/busybox-1.35.0'
> | ERROR: oe_runmake failed
>
>> I’m thinking to avoid tiny classes we can just add this to
>> cml1.bbclass and make it print a decent error message if it doesn’t
>> work.
>>
>
> So where I started, was adding it to u-boot.inc (which isn't a class,
> I guess an artefact of history), because tiny classes felt like a poor
> choice. I can add it to cml1 instead, at which point I've tried all
> three options, maybe that's the best option and if you have a consumer
> that doesn't do it, you just get a fail as above.
>
> Are there are other users of cml1 other than these three? My suspicion
> is there isn't (though I've only looked at layers I've got checked
> out).

There is the barebox bootloader which supports 'savedefconfig', whose
recipe in meta-ptx uses cml1 via [2] and which would benefit from this
change.

Best regards
Ulrich


[1] https://barebox.org/
[2] https://github.com/pengutronix/meta-ptx/blob/master/recipes-bsp/barebox/barebox.inc#L12
-- 
Pengutronix e.K.                           | Ulrich Ölmann               |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


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

* Re: [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class
  2022-10-12 19:43   ` Alex Kiernan
  2022-10-13  5:31     ` Ulrich Ölmann
@ 2022-10-31 22:12     ` Ross Burton
  2022-11-01 11:32       ` Richard Purdie
  1 sibling, 1 reply; 9+ messages in thread
From: Ross Burton @ 2022-10-31 22:12 UTC (permalink / raw)
  To: alex.kiernan; +Cc: openembedded-core

On 12 Oct 2022, at 20:43, Alex Kiernan via lists.openembedded.org <alex.kiernan=gmail.com@lists.openembedded.org> wrote:
> 
> On Wed, Oct 12, 2022 at 5:36 PM Ross Burton <Ross.Burton@arm.com> wrote:
>> 
>> On 12 Oct 2022, at 08:18, Alex Kiernan via lists.openembedded.org <alex.kiernan=gmail.com@lists.openembedded.org> wrote:
>>> 
>>> Move savedefconfig task to a class so we can reuse it in other recipes
>>> which support it.
>> 
>> There are three users of cml1 in oe-core: kernel, uboot, and busybox.  Does busybox support savedefconfig?
>> 
> 
> It doesn't and fairly obviously goes boom…

If you really keen you could see if savedefconfig is a valid target somehow (search make -p for savedefconfig?), but to be honest given Ulrich’s reply I’m fine with the cml1 class supporting a function that most implementations, if not all, support.

It seems preferable to a class which is just "oe_runmake savedefconfig”, at least.

Ross


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

* Re: [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class
  2022-10-31 22:12     ` Ross Burton
@ 2022-11-01 11:32       ` Richard Purdie
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Purdie @ 2022-11-01 11:32 UTC (permalink / raw)
  To: Ross Burton, alex.kiernan; +Cc: openembedded-core

On Mon, 2022-10-31 at 22:12 +0000, Ross Burton wrote:
> On 12 Oct 2022, at 20:43, Alex Kiernan via lists.openembedded.org <alex.kiernan=gmail.com@lists.openembedded.org> wrote:
> > 
> > On Wed, Oct 12, 2022 at 5:36 PM Ross Burton <Ross.Burton@arm.com> wrote:
> > > 
> > > On 12 Oct 2022, at 08:18, Alex Kiernan via lists.openembedded.org <alex.kiernan=gmail.com@lists.openembedded.org> wrote:
> > > > 
> > > > Move savedefconfig task to a class so we can reuse it in other recipes
> > > > which support it.
> > > 
> > > There are three users of cml1 in oe-core: kernel, uboot, and busybox.  Does busybox support savedefconfig?
> > > 
> > 
> > It doesn't and fairly obviously goes boom…
> 
> If you really keen you could see if savedefconfig is a valid target somehow (search make -p for savedefconfig?), but to be honest given Ulrich’s reply I’m fine with the cml1 class supporting a function that most implementations, if not all, support.
> 
> It seems preferable to a class which is just "oe_runmake savedefconfig”, at least.

The other "trick" that could work here is to put most of the definition
in the class but put the addtask in the recipe/inc file. That way most
is command and shared but only the valid users enable it with what is a
single line.

Cheers,

Richard



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

end of thread, other threads:[~2022-11-01 11:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-12  7:18 [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class Alex Kiernan
2022-10-12  7:18 ` [OE-Core][PATCH v2 2/3] u-boot: Remove duplicate inherit of cml1 Alex Kiernan
2022-10-12  7:18 ` [OE-Core][PATCH v2 3/3] u-boot: Add savedefconfig task Alex Kiernan
2022-10-12 16:35 ` [OE-Core][PATCH v2 1/3] kernel: classes: Extract savedefconfig to a class Ross Burton
2022-10-12 17:49   ` Khem Raj
2022-10-12 19:43   ` Alex Kiernan
2022-10-13  5:31     ` Ulrich Ölmann
2022-10-31 22:12     ` Ross Burton
2022-11-01 11:32       ` Richard Purdie

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.