From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6755821036247187456 X-Received: by 2002:a05:6402:20c:: with SMTP id t12mr8473670edv.109.1573196975899; Thu, 07 Nov 2019 23:09:35 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:55b:: with SMTP id k27ls1421472eja.5.gmail; Thu, 07 Nov 2019 23:09:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzUtsGwCdSDZmKLaD0E81/2qp8IHqN3wQrAzlRYESmqYUsPCjrbjy5gmhaoJdzJCtB1IlTA X-Received: by 2002:a17:906:5648:: with SMTP id v8mr1662015ejr.186.1573196975463; Thu, 07 Nov 2019 23:09:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573196975; cv=none; d=google.com; s=arc-20160816; b=pfrAfNhoD8O5/RI/wQLs5DSldf55dlowWtUBl+3k0UtXaRdCmBvs99hA+p2Q8WJt/s 5dqMKO042F0XXzQ2DYKXJKw1XRhrOWWD17GBmXAMSbY91SoGzvTeJDMmi47Jh7ABX8jF B1mW+ow+67eYX729bDAgMTIhJgR6rnVnb9mLrrOqZH1w1UGnFD0FMKrmq8ijV80NpzAH qpwkO6AKY1qOS6TXsOjRviv7FBlP5j1TBWzHUyjcjaxa4mCHbrHByCj4D4KsYbe5GVUB h42GgdyCPQhVD2ZpHAuREJ1vTzSvjyHDFaJC2NFmk1qu6F8EFJ5Ea19gEV//uYXGjEOX JlCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:ironport-sdr:ironport-sdr; bh=Z9oFfniSYH14XKpWTYoZATbImXqytESyyjxYvnbRHjs=; b=DOk/odKw+3J+A45O9yb/u1Gxuq9mpQdz7Dm39ayIWgGDPJAhAuc/C24PU5+6U7cpw8 Ga0BJNUrC+b+ijxbQbZ1jXiXB7v7kQXX/hHyq/7yWeDvkun9vUEVsOIPmbsVWGPOFhab bsZFl8v2zNkFsSgyzSfYC9WSW6cFr2jLutY6TAaqYOGmmBMX3ccLQHI1FMt2jQWZpNZx iOaIsYDfuMNzdTPIRl4vnxChdxI78iGQkxx/0F6iMw870HZKXk8lHQx+gKpzlw15a8oD RR9Gwx5vSbK31vFKNQjJEGP76Ffx3CaXYIjowq+mfyFMO3BbKZG0ZD0CQIxZSb8bP54C fOSw== 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 z18si384276edd.5.2019.11.07.23.09.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Nov 2019 23:09:35 -0800 (PST) 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: 4jKXi8C+3wwJJ9bUdaYzHUQrK6pxx/opHy6p516H7dqRozThIE7TrtH7V93CK83M8hGnWzsSy7 /eN4l30I/YZKKqc4hBTFY0/AlA08yeInXOuw/0V0KrauamMZqqwIqvpj8VLm4oFX4e0MzjFaIS /8Xf7wy/25ywymDTTrnCDRiKUmAMKPUy2fRnhBdVE6pzdDbUbFpU1XHRiH2NTi+VA21up8g5Eu GPsqGiele4OCxobxcna8ufE/BEW+dNroTXO7fy4YF+64BkB7FtfyB423jBuFTm32nIRGZE/zR9 cEc= X-IronPort-AV: E=Sophos;i="5.68,280,1569312000"; d="scan'208";a="42990024" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 07 Nov 2019 23:09:33 -0800 IronPort-SDR: ugHbEtA0xCKnT9x8eh1kh/Zebx3Qq1P2cVCi81sQFqmaQ5Iks1hH7S3Ok1vnUH5LInIs84plu+ Xq2vmONpan7Wri/V1iZkqq/xVZSq4Fd3oyZh/bTPG2B5DMQW2wJ1FrRqbzDeL6Pk3y5iWuaKng aLKICB3qVGO7aLb8/obmCceeafA1ljG3OQGbN1MQpJUUs9cGv/h02k9LFF9aO2MTg3ZF2rpYCY Jj6wvUlUOMCjv9MDq/z9cBK1n8/0IrxZW5sGIiYQmU/0cUchO96NJYe7K8i8LsWN7tWA9lN8qa EJU= From: Cedric Hombourger To: CC: Cedric Hombourger Subject: [PATCH L-C v3 4/7] linux-custom: add support for kernel config fragments Date: Fri, 8 Nov 2019 08:07:16 +0100 Message-ID: <1573196839-1143-5-git-send-email-Cedric_Hombourger@mentor.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1573196839-1143-1-git-send-email-Cedric_Hombourger@mentor.com> References: <1573118604-909-1-git-send-email-Cedric_Hombourger@mentor.com> <1573196839-1143-1-git-send-email-Cedric_Hombourger@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Cedric_Hombourger@mentor.com X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-TUID: U2DgLurlFwjU Check for .cfg files listed in SRC_URI and merge them with the main defconfig using the kernel merge_config script. The optional "apply" parameter may be used for the specified fragment to be ignore (set to "no"). Signed-off-by: Cedric Hombourger --- .../linux/files/build-kernel.sh | 3 +++ meta/recipes-kernel/linux/linux-custom.inc | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh b/meta/recipes-kernel/linux/files/build-kernel.sh index 386e58b..f56e96c 100644 --- a/meta/recipes-kernel/linux/files/build-kernel.sh +++ b/meta/recipes-kernel/linux/files/build-kernel.sh @@ -37,6 +37,9 @@ REPACK_LINUX_IMAGE_DIR="${REPACK_DIR}/linux-image" REPACK_LINUX_HEADERS_DIR="${REPACK_DIR}/linux-headers" make ${KERNEL_CONFIG_TARGET} || 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 0c185d8..ca91f64 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -18,6 +18,19 @@ 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) + apply = parm.get("apply") + if apply == "no": + continue + 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 +84,16 @@ dpkg_runbuild() { KERNEL_CONFIG_TARGET="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} -- 2.20.1