public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2] linux-custom: fall back to using "make defconfig" when no config given
@ 2018-10-17 18:48 Jan Kiszka
  2018-10-26 12:57 ` Maxim Yu. Osipov
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2018-10-17 18:48 UTC (permalink / raw)
  To: isar-users; +Cc: Henning Schild

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

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

end of thread, other threads:[~2018-10-26 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-17 18:48 [PATCH v2] linux-custom: fall back to using "make defconfig" when no config given Jan Kiszka
2018-10-26 12:57 ` Maxim Yu. Osipov

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