Skip to contentSkip to conversation

kernel: classes: Extract savedefconfig to a class

PATCH New Alex Kiernan 1 participant 3 messages Oct 11, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 kernel: classes: Extract savedefconfig to a class

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

---
 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
meta/classes-recipe/cml1-savedefconfig.bbclass new file +12 -0
new file mode 100644
index 000000000000..c340aac11204
@@ -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
meta/classes-recipe/kernel.bbclass +1 -8
index e4e69e076375..eae7b2f78a9e 100644
@@ -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}"
Signature · 1 line
2.35.1
#1 lore raw

PATCH v2 2/3 u-boot: Remove duplicate inherit of cml1

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")
---
 meta/recipes-bsp/u-boot/u-boot.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-bsp/u-boot/u-boot.inc +1 -1
index f022aed732ce..b2f33e382664 100644
@@ -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"
 
Signature · 1 line
2.35.1
#2 lore raw

PATCH v2 3/3 u-boot: Add savedefconfig task

In reply to Alex Kiernan

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

---
 meta/recipes-bsp/u-boot/u-boot.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-bsp/u-boot/u-boot.inc +1 -1
index b2f33e382664..046e842289fa 100644
@@ -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"
 
Signature · 1 line
2.35.1