public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH v2] linux-custom: fall back to using "make defconfig" when no config given
Date: Wed, 17 Oct 2018 20:48:49 +0200	[thread overview]
Message-ID: <d1829ab2-6d90-09bd-9ba7-e18596d34770@siemens.com> (raw)

From: Henning Schild <henning.schild@siemens.com>

This allows us to write kernel recipes that do not have to bring what
they consider their defconfig. If KERNEL_DEFCONFIG is empty, do not
attempt to copy a file into the tree and call "make defconfig" instead
of "make olddefconfig".

Signed-off-by: Henning Schild <henning.schild@siemens.com>
[Jan: avoid negation in test]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

As I started to use that patch, I'm sending already v2 on behalf of
Henning.

 meta/recipes-kernel/linux/files/build-kernel.sh | 6 +++++-
 meta/recipes-kernel/linux/linux-custom.inc      | 6 ++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh b/meta/recipes-kernel/linux/files/build-kernel.sh
index 3f39d43..32d62bf 100644
--- a/meta/recipes-kernel/linux/files/build-kernel.sh
+++ b/meta/recipes-kernel/linux/files/build-kernel.sh
@@ -34,7 +34,11 @@ REPACK_LINUX_IMAGE_DIR="${REPACK_DIR}/linux-image"
 REPACK_LINUX_HEADERS_DIR="${REPACK_DIR}/linux-headers"
 
 cd $1
-make olddefconfig
+if [ -e .config ]; then
+	make olddefconfig
+else
+	make defconfig
+fi
 
 KV=$( make -s kernelrelease )
 if [ "${KV}" != "${PV}" ]; then
diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 8c89637..e9a68fd 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -10,7 +10,7 @@ FILESPATH =. "${LAYERDIR_core}/recipes-kernel/linux/files:"
 DESCRIPTION ?= "Custom kernel"
 
 KERNEL_NAME_PROVIDED ?= "${@ d.getVar('PN', True).partition('linux-')[2]}"
-KERNEL_DEFCONFIG ?= "defconfig"
+KERNEL_DEFCONFIG ?= ""
 
 python() {
     kernel_name = d.getVar("KERNEL_NAME_PROVIDED", True)
@@ -43,7 +43,9 @@ dpkg_runbuild() {
 	# Install package builder script
 	sudo install -m 755 ${WORKDIR}/build-kernel.sh ${BUILDCHROOT_DIR}
 
-	sudo cp ${WORKDIR}/${KERNEL_DEFCONFIG} ${S}/.config
+	if [ -n "${KERNEL_DEFCONFIG}" ]; then
+		sudo cp ${WORKDIR}/${KERNEL_DEFCONFIG} ${S}/.config
+	fi
 
 	E="${@ bb.utils.export_proxies(d)}"
 
-- 
2.16.4

             reply	other threads:[~2018-10-17 18:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-17 18:48 Jan Kiszka [this message]
2018-10-26 12:57 ` Maxim Yu. Osipov

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=d1829ab2-6d90-09bd-9ba7-e18596d34770@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=henning.schild@siemens.com \
    --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