public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: Cedric Hombourger <cedric_hombourger@mentor.com>
Cc: <isar-users@googlegroups.com>
Subject: Re: [PATCH 08/10] linux-custom: add support for kernel config fragments
Date: Thu, 24 Oct 2019 20:29:42 +0200	[thread overview]
Message-ID: <20191024202942.28a2eb4d@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <18939701-bb6f-5790-608c-8b2fd498c666@mentor.com>

Am Thu, 24 Oct 2019 20:25:15 +0200
schrieb Cedric Hombourger <cedric_hombourger@mentor.com>:

> Hi Henning,
> 
> On 10/24/2019 8:21 PM, Henning Schild wrote:
> > Is that taken from or inspired by OE? I have seen patterns like that
> > for isar:  
> It is inspired. they use their scc tool but eventually use the kernel 
> merge_config tool
> > do_prepare_build_prepend() {
> >      cat ${WORKDIR}/preempt-rt.cfg >> ${WORKDIR}/${KERNEL_DEFCONFIG}
> > }  
> I have used this kludge myself :) but the kernel provides a tool to 
> facilitate merging of config fragments so let's use it so that we do
> not come up with different mechanisms
> > In a recipe that extends a generic kernel recipe with some config
> > switches.
> >
> > I am personally not a big fan of magic, and it seems the extension
> > ".cfg" makes magic happen. We will need an apply=no like for
> > patches.  
> OE does not but I see no harm in taking inspiration from OE and
> tweaking it to our liking

I think it would be clean to have a way to disable the magic. Even if
SRC_URI entries ending on .cfg in a kernel recipe are not likely to be
required for something else.

Henning

> >
> > Henning
> >
> >
> > Am Thu, 24 Oct 2019 11:02:22 +0200
> > schrieb Cedric Hombourger <Cedric_Hombourger@mentor.com>:
> >  
> >> Check for .cfg files listed in SRC_URI and merge them with the
> >> main defconfig using the kernel merge_config script.
> >>
> >> Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com>
> >> ---
> >>   .../linux/files/build-kernel.sh               |  5 ++++-
> >>   meta/recipes-kernel/linux/linux-custom.inc    | 20
> >> +++++++++++++++++++ 2 files changed, 24 insertions(+), 1
> >> deletion(-)
> >>
> >> diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh
> >> b/meta/recipes-kernel/linux/files/build-kernel.sh index
> >> cb310f7..9faa6bb 100644 ---
> >> a/meta/recipes-kernel/linux/files/build-kernel.sh +++
> >> b/meta/recipes-kernel/linux/files/build-kernel.sh @@ -36,7 +36,10
> >> @@ REPACK_DIR="$1/../repack"
> >> REPACK_LINUX_IMAGE_DIR="${REPACK_DIR}/linux-image"
> >> REPACK_LINUX_HEADERS_DIR="${REPACK_DIR}/linux-headers"
> >> -make ${KERNEL_DEFCONFIG}
> >> +make ${KERNEL_DEFCONFIG} || exit ${?}
> >> +if [ -n "${KERNEL_FRAGMENTS}" ]; then
> >> +    scripts/kconfig/merge_config.sh -m .config ${KERNEL_FRAGMENTS}
> >> +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 c53cd90..b06529f
> >> 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc
> >> +++ b/meta/recipes-kernel/linux/linux-custom.inc
> >> @@ -18,6 +18,16 @@ python() {
> >>                            'linux-headers-' + kernel_name)
> >>   }
> >>   
> >> +def config_fragments(d):
> >> +    fragments = []
> >> +    sources = d.getVar("SRC_URI").split()
> >> +    for s in sources:
> >> +        _, _, local, _, _, parm = bb.fetch.decodeurl(s)
> >> +        base, ext = os.path.splitext(os.path.basename(local))
> >> +        if ext and ext in (".cfg"):
> >> +            fragments.append(local)
> >> +    return fragments
> >> +
> >>   inherit dpkg-base
> >>   
> >>   SRC_URI += "file://build-kernel.sh"
> >> @@ -71,6 +81,16 @@ dpkg_runbuild() {
> >>   		defconfig="defconfig"
> >>   	fi
> >>   
> >> +	# copy config fragments over to the kernel tree
> >> +	src_frags="${@ " ".join(config_fragments(d)) }"
> >> +	out_frags="${@ " ".join(map(lambda frag:
> >> 'debian/fragments/'
> >> + frag, config_fragments(d))) }"
> >> +	rm -rf ${S}/debian/fragments
> >> +	if [ -n "${src_frags}" ]; then
> >> +		mkdir -p ${S}/debian/fragments
> >> +		(cd ${WORKDIR} && cp ${src_frags}
> >> ${S}/debian/fragments/)
> >> +	fi
> >> +	export KERNEL_FRAGMENTS="${out_frags}"
> >> +
> >>   	E="${@ bb.utils.export_proxies(d)}"
> >>   
> >>   	export PV=${PV}  


  reply	other threads:[~2019-10-24 18:29 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-24  9:02 [PATCH 00/10] add ci40 machine support + new Isar features Cedric Hombourger
2019-10-24  9:02 ` [PATCH 01/10] ci_build.sh: delay "set -x" for a clean --help output Cedric Hombourger
2019-10-24  9:02 ` [PATCH 02/10] linux-custom: honor KERNEL_FILE setting Cedric Hombourger
2019-10-24 17:57   ` Henning Schild
2019-10-24  9:02 ` [PATCH 03/10] bitbake.conf: set name of the qemu-static binary to use for mipsel Cedric Hombourger
2019-10-24  9:02 ` [PATCH 04/10] recipes-kernel/linux: make KERNEL_DEFCONFIG support in-tree defconfigs Cedric Hombourger
2019-10-24 18:02   ` Henning Schild
2019-11-06 16:03     ` Jan Kiszka
2019-11-06 16:17       ` Cedric Hombourger
2019-10-24  9:02 ` [PATCH 05/10] linux-mainline: fix stripping of .0 from the kernel version Cedric Hombourger
2019-11-06 16:04   ` Jan Kiszka
2019-10-24  9:02 ` [PATCH 06/10] linux-mainline: update from 4.19.0 to 4.19.80 Cedric Hombourger
2019-10-24  9:02 ` [PATCH 07/10] image: add CUSTOM_IMAGE_EXTENSIONS for user layers/machines to use Cedric Hombourger
2019-10-24 18:09   ` Henning Schild
2019-11-06 16:08     ` Jan Kiszka
2019-11-06 16:11       ` Cedric Hombourger
2019-11-06 16:16         ` Jan Kiszka
2019-11-06 16:19           ` Cedric Hombourger
2019-11-06 16:32             ` Jan Kiszka
2019-10-24  9:02 ` [PATCH 08/10] linux-custom: add support for kernel config fragments Cedric Hombourger
2019-10-24 18:21   ` Henning Schild
2019-10-24 18:25     ` Cedric Hombourger
2019-10-24 18:29       ` Henning Schild [this message]
2019-10-25  9:45     ` Cedric Hombourger
2019-10-24  9:02 ` [PATCH 09/10] linux-mainline: disable support for HFS to demonstrate use of " Cedric Hombourger
2019-10-24  9:02 ` [PATCH 10/10] meta-isar: add creator-ci40-marduk machine (mipsel + mainline kernel) Cedric Hombourger
2019-10-24 18:13   ` Henning Schild
2019-10-24 18:26     ` Henning Schild
2019-11-06 16:11     ` Jan Kiszka
2019-10-24 18:15 ` [PATCH 00/10] add ci40 machine support + new Isar features Henning Schild
2019-10-24 18:17   ` Cedric Hombourger
2019-10-25 17:39 ` [PATCH v2 0/7] custom kernel recipes enhancements (was Ci40 support) Cedric Hombourger
2019-10-25 17:39   ` [PATCH v2 1/7] linux-custom: honor KERNEL_FILE setting Cedric Hombourger
2019-10-25 17:39   ` [PATCH v2 2/7] bitbake.conf: set name of the qemu-static binary to use for mipsel Cedric Hombourger
2019-10-25 17:39   ` [PATCH v2 3/7] recipes-kernel/linux: make KERNEL_DEFCONFIG support in-tree defconfigs Cedric Hombourger
2019-10-25 17:39   ` [PATCH v2 4/7] linux-mainline: fix stripping of .0 from the kernel version Cedric Hombourger
2019-10-25 17:39   ` [PATCH v2 5/7] linux-mainline: update from 4.19.0 to 4.19.80 Cedric Hombourger
2019-10-25 17:39   ` [PATCH v2 6/7] linux-custom: add support for kernel config fragments Cedric Hombourger
2019-10-25 17:39   ` [PATCH v2 7/7] linux-mainline: disable support for HFS to demonstrate use of " Cedric Hombourger
2019-11-05 20:25     ` chombourger

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=20191024202942.28a2eb4d@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=cedric_hombourger@mentor.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