public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Uladzimir Bely <ubely@ilbers.de>
To: isar-users@googlegroups.com
Subject: [PATCH v2 9/9] linux-custom: Move cfg fragments applying to debian/rules
Date: Tue, 25 Jan 2022 13:32:19 +0100	[thread overview]
Message-ID: <20220125123219.32395-10-ubely@ilbers.de> (raw)
In-Reply-To: <20220125123219.32395-1-ubely@ilbers.de>

Prepare linux fragments applying in Debian way.

This allows to avoid pre-build chroot call used for merging
kernel config file and custom config fragments.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 .../linux/files/debian/isar/configure.tmpl    | 19 +++++++++++++++++++
 .../linux/files/debian/rules.tmpl             |  3 +++
 meta/recipes-kernel/linux/linux-custom.inc    | 12 +++---------
 3 files changed, 25 insertions(+), 9 deletions(-)
 create mode 100644 meta/recipes-kernel/linux/files/debian/isar/configure.tmpl

diff --git a/meta/recipes-kernel/linux/files/debian/isar/configure.tmpl b/meta/recipes-kernel/linux/files/debian/isar/configure.tmpl
new file mode 100644
index 00000000..83871baa
--- /dev/null
+++ b/meta/recipes-kernel/linux/files/debian/isar/configure.tmpl
@@ -0,0 +1,19 @@
+#!/bin/bash
+# Copyright (c) Mentor Graphics, a Siemens business, 2019
+# SPDX-License-Identifier: MIT
+
+# Load common stuff
+. ${S}/debian/isar/common || exit ${?}
+
+do_configure() {
+
+    # Process kernel config target and fragments
+    ${MAKE} O=${KERNEL_BUILD_DIR} ${KERNEL_CONFIG_TARGET} || exit ${?}
+    ./scripts/kconfig/merge_config.sh -O ${KERNEL_BUILD_DIR}/ \
+    ${KERNEL_BUILD_DIR}/.config ${KERNEL_CONFIG_FRAGMENTS}
+
+    # Stop tracing
+    set +x
+}
+
+main configure ${*}
diff --git a/meta/recipes-kernel/linux/files/debian/rules.tmpl b/meta/recipes-kernel/linux/files/debian/rules.tmpl
index 05a26fe2..a1166287 100755
--- a/meta/recipes-kernel/linux/files/debian/rules.tmpl
+++ b/meta/recipes-kernel/linux/files/debian/rules.tmpl
@@ -22,6 +22,9 @@ isar_env=$(strip \
 override_dh_auto_clean:
 	$(isar_env) && bash $(deb_top_dir)/isar/clean
 
+override_dh_auto_configure:
+	$(isar_env) && bash $(deb_top_dir)/isar/configure
+
 override_dh_auto_build:
 	$(isar_env) && bash $(deb_top_dir)/isar/build
 
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 72706f23..eaaa2eef 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -52,6 +52,7 @@ TEMPLATE_FILES += "                  \
     debian/isar/build.tmpl           \
     debian/isar/clean.tmpl           \
     debian/isar/common.tmpl          \
+    debian/isar/configure.tmpl       \
     debian/isar/install.tmpl         \
     debian/isar/version.cfg.tmpl     \
     debian/linux-image.postinst.tmpl \
@@ -164,15 +165,8 @@ dpkg_configure_kernel() {
 		(cd ${WORKDIR} && cp ${src_frags} ${S}/debian/fragments/)
 	fi
 
-	sudo -E chroot --userspec=$(id -u):$(id -g) ${BUILDCHROOT_DIR} sh -c " \
-		export ARCH=${KERNEL_ARCH} &&                                  \
-		cd ${PP}/${PPS} &&                                             \
-		make O=${KERNEL_BUILD_DIR} ${config_target} &&                 \
-		./scripts/kconfig/merge_config.sh                              \
-			-O ${KERNEL_BUILD_DIR}/                                \
-			${KERNEL_BUILD_DIR}/.config                            \
-			${out_frags}                                           \
-        "
+	dpkg_build_export KERNEL_CONFIG_TARGET ${config_target}
+	dpkg_build_export KERNEL_CONFIG_FRAGMENTS ${out_frags}
 }
 
 dpkg_runbuild_prepend() {
-- 
2.20.1


  parent reply	other threads:[~2022-01-25 12:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25 12:32 [PATCH v2 0/9] Avoid using shell environment during the build Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 1/9] template: Copy template attributes on transform Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 2/9] linux-module: Do not use shell environment Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 3/9] u-boot: " Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 4/9] trusted-firmware: " Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 5/9] optee-os: " Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 6/9] kselftest: " Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 7/9] linux-mainline: Move cfg fragment test to debian/rules Uladzimir Bely
2022-01-25 12:32 ` [PATCH v2 8/9] dpkg: Use a specific export function in pre-build tasks Uladzimir Bely
2022-01-25 12:32 ` Uladzimir Bely [this message]
2022-01-25 13:29 ` [PATCH v2 0/9] Avoid using shell environment during the build Jan Kiszka
2022-01-25 13:51   ` Uladzimir Bely
2022-01-25 13:55     ` Jan Kiszka

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=20220125123219.32395-10-ubely@ilbers.de \
    --to=ubely@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /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