public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH] linux-custom: fall back to using "make defconfig" when no config given
Date: Thu,  4 Oct 2018 16:25:41 +0200	[thread overview]
Message-ID: <20181004142541.11757-1-henning.schild@siemens.com> (raw)

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>
---
 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 34c9a62..6ee87d4 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_PRODVIDED ?= "${@ d.getVar('PN', True).partition('linux-')[2]}"
-KERNEL_DEFCONFIG ?= "defconfig"
+KERNEL_DEFCONFIG ?= ""
 
 python() {
     kernel_name = d.getVar("KERNEL_NAME_PRODVIDED", 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 [ ! -z ${KERNEL_DEFCONFIG} ]; then
+		sudo cp ${WORKDIR}/${KERNEL_DEFCONFIG} ${S}/.config
+	fi
 
 	E="${@ bb.utils.export_proxies(d)}"
 
-- 
2.19.0


             reply	other threads:[~2018-10-04 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 14:25 Henning Schild [this message]
2018-10-08 10: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=20181004142541.11757-1-henning.schild@siemens.com \
    --to=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