public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] linux-custom: Set KERNEL_CONFIG_TARGET at build time
@ 2022-02-24 14:43 Uladzimir Bely
  2022-02-24 18:14 ` Henning Schild
  2022-03-03 10:30 ` Anton Mikanovich
  0 siblings, 2 replies; 3+ messages in thread
From: Uladzimir Bely @ 2022-02-24 14:43 UTC (permalink / raw)
  To: isar-users

Expanding KERNEL_CONFIG_TARGET variable at parse time doesn't properly
work while it may need some config file in workdir that is not created
at this moment.

This patch removes the variable from template vars and sets in in
debian/isar/configure at build time

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/recipes-kernel/linux/linux-custom.inc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index ea1abf76..8a5dbf82 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -72,7 +72,6 @@ TEMPLATE_VARS += "                \
     KERNEL_HEADERS_DEBIAN_DEPENDS \
     LINUX_VERSION_EXTENSION       \
     KERNEL_NAME_PROVIDED          \
-    KERNEL_CONFIG_TARGET          \
     KERNEL_CONFIG_FRAGMENTS       \
 "
 
@@ -165,8 +164,6 @@ def get_kernel_config_target(d):
 
     return config_target
 
-KERNEL_CONFIG_TARGET = "${@get_kernel_config_target(d)}"
-
 def get_kernel_config_fragments(d):
     src_frags = " ".join(config_fragments(d))
     out_frags = " ".join(map(lambda frag: 'debian/fragments/' + frag, config_fragments(d)))
@@ -180,6 +177,11 @@ def get_kernel_config_fragments(d):
 KERNEL_CONFIG_FRAGMENTS = "${@get_kernel_config_fragments(d)}"
 
 dpkg_configure_kernel() {
+	grep -q "KERNEL_CONFIG_TARGET=" ${S}/debian/isar/configure ||
+		cat << EOF | sed -i '/^do_configure() {/ r /dev/stdin' ${S}/debian/isar/configure
+    KERNEL_CONFIG_TARGET="${@get_kernel_config_target(d)}"
+EOF
+
 	rm -rf ${S}/${KERNEL_BUILD_DIR} && mkdir -p ${S}/${KERNEL_BUILD_DIR}
 	if [ -n "${KERNEL_DEFCONFIG}" ]; then
 		if [ -e "${WORKDIR}/${KERNEL_DEFCONFIG}" ]; then
-- 
2.20.1


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

end of thread, other threads:[~2022-03-03 10:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24 14:43 [PATCH] linux-custom: Set KERNEL_CONFIG_TARGET at build time Uladzimir Bely
2022-02-24 18:14 ` Henning Schild
2022-03-03 10:30 ` Anton Mikanovich

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