From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6751292434813026304 X-Received: by 2002:a25:b18a:: with SMTP id h10mr2416561ybj.137.1571996732083; Fri, 25 Oct 2019 02:45:32 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a0d:ea09:: with SMTP id t9ls727718ywe.3.gmail; Fri, 25 Oct 2019 02:45:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFRxlYd32VfKAggXbzrFm+BFj/m04VZFc0OU0z4Rz/5GXZyCatt7jfC0DFgtvAcHJ2u1rA X-Received: by 2002:a0d:ea05:: with SMTP id t5mr1469549ywe.289.1571996731442; Fri, 25 Oct 2019 02:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571996731; cv=none; d=google.com; s=arc-20160816; b=mjAZXMkDBhfpt9XjFyAox148tb/ENUGtTt9tuoWmtInYOQp1Qwt7zGOWyxOuAXTmOT RyyFY6puhpT6RsR8OFNE4D3pJ53VFGgCIagPptV0vbCJq+pc7sROG8RYiwDUNdHfx0GA NKVZQYyG8yhLNMpfUEnHAzz1W2MIlms6D380bWBDvQio+jUamdLa8bKZEqGDmcksjoSq npBpVHmA21LdCBWKkw5pNmeLxEkKOJ+RECfrh5xclGEDgit8wIo0o5a5VseKfCGPHa2C VLqb/ngx/kIwPjHWEHV9xX1No3wx9kkIbqs3N3OFxQYPG0OGXf8uVsVegnd9N1o1Y2LO fN4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:content-transfer-encoding:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject :ironport-sdr:ironport-sdr; bh=4sEDNkQl9pvy8TRgq2RLcihzU/EOtQO8DawKfjGOvSE=; b=OTyKHV8S2XxH+8rhLPGSKZx0SR81QT3+MwD0v0hpcD41HC0+42NwVHs+Vw0lW+SJzh WPHFIPcXSHVbEZLAzxZgmwYzFbZ5yGHg+YfUW1y3wEkchr4svKgR2q85mTxt2DlJB4km Us64ZBVCw3LLosnxUQnH7AoCtO9fuBbgZNiQK3juvkJTgbGm+XKKnEh259xqlDKQl+Am AOKsUyqx42lGOLz7idZckbGgH9KKIDImgFyVFxjk0RBgpeESChJYCBstV4SKlyIA/b9G wuXnarjmIy/QKNU7rkMNEZQ8zYycmvsL05Bpw9nN7/CDPJynBr6cm8AgiGKxWiMyid3L ILyg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com. [68.232.137.180]) by gmr-mx.google.com with ESMTPS id l3si133976ybj.5.2019.10.25.02.45.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Oct 2019 02:45:31 -0700 (PDT) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.137.180 as permitted sender) client-ip=68.232.137.180; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com IronPort-SDR: dIOeAivRnX16f94nl0EPwDnwX3LaE0o2NiVSFwwF79mRcr/B//1E832BY7/8RkEzsmecX5jfd0 BeDGp83orChLY+3Yi2iyA9bViHget986Uw90blWbEP9su2hoYNRSfqx0klLt20X02widRCwB+z yWWbs7ih+ZeV4O0yHPWBCTcSGrabj7+sxFJGYTbcI4xUCjwIA1Hr8/q+uJ27fV1GreWXq6a5H+ 1XKlp+1BR6i4OFefDfseckDCDcRHuFyGpOdH2KnaudOcHoOr/tURTK/S599VWvTCVraAOkepRI +u0= X-IronPort-AV: E=Sophos;i="5.68,228,1569312000"; d="scan'208";a="42586029" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 25 Oct 2019 01:45:29 -0800 IronPort-SDR: sHzpV+PLauSn0h4B9uL10P5LCQzhAfK30yeQxpmKkGL83iL8Se6MYeuAXADKsg4YlHwqLs58L4 ZTlMmcluOMggEw6XkWWlSd/GvJI2Dq1fOjAmqRT1B+HoFt6VPSHvqME4wajNDzCkuM2gvu0Y4O KiVdwHN1qRbamo5DD1CyWKy9gYzWzh3sk5ys3aaefNBxQqSThoKf/ABz3hENdTNG6bjgrbqq/J 9tDJ08MrRhUzUsUNQw4lH5ly/C1dvrP1dQKS1dvlTBWY64NeuWTz4g0w4NFJXvxQ14qfn/sJcA pQE= Subject: Re: [PATCH 08/10] linux-custom: add support for kernel config fragments To: Henning Schild CC: References: <1571907744-1121-1-git-send-email-Cedric_Hombourger@mentor.com> <1571907744-1121-9-git-send-email-Cedric_Hombourger@mentor.com> <20191024202102.6b7566ea@md1za8fc.ad001.siemens.net> From: Cedric Hombourger Message-ID: <95ecb719-af3f-1a61-f8e3-a645eb900d0c@mentor.com> Date: Fri, 25 Oct 2019 11:45:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191024202102.6b7566ea@md1za8fc.ad001.siemens.net> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Return-Path: cedric_hombourger@mentor.com X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-09.mgc.mentorg.com (139.181.222.9) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-TUID: ivBYpAFWX5rw 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: > > do_prepare_build_prepend() { > cat ${WORKDIR}/preempt-rt.cfg >> ${WORKDIR}/${KERNEL_DEFCONFIG} > } > > 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. Change implemented and tested locally. Moving on to the other findings > Henning > > > Am Thu, 24 Oct 2019 11:02:22 +0200 > schrieb Cedric Hombourger : > >> 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 >> --- >> .../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}