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

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


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

* Re: [PATCH] linux-custom: fall back to using "make defconfig" when no config given
  2018-10-04 14:25 [PATCH] linux-custom: fall back to using "make defconfig" when no config given Henning Schild
@ 2018-10-08 10:55 ` Jan Kiszka
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kiszka @ 2018-10-08 10:55 UTC (permalink / raw)
  To: [ext] Henning Schild, isar-users

On 04.10.18 16:25, [ext] Henning Schild wrote:
> 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

if [ -n ${KERNEL_DEFCONFIG} ]; ...

> +		sudo cp ${WORKDIR}/${KERNEL_DEFCONFIG} ${S}/.config
> +	fi
>   
>   	E="${@ bb.utils.export_proxies(d)}"
>   
> 

Looks good otherwise.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

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

end of thread, other threads:[~2018-10-08 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 14:25 [PATCH] linux-custom: fall back to using "make defconfig" when no config given Henning Schild
2018-10-08 10:55 ` Jan Kiszka

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