From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6751292434813026304 X-Received: by 2002:a25:8612:: with SMTP id y18mr2796153ybk.245.1573057107138; Wed, 06 Nov 2019 08:18:27 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a81:7910:: with SMTP id u16ls390661ywc.9.gmail; Wed, 06 Nov 2019 08:18:26 -0800 (PST) X-Google-Smtp-Source: APXvYqx1W9udRlsGUuGfGej3XSdvmutU+Zw3fplw9T7CUkGv4sXtris3bYuy4+GgFQ6cS7Et2YJ6 X-Received: by 2002:a81:b208:: with SMTP id q8mr2293678ywh.74.1573057106659; Wed, 06 Nov 2019 08:18:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573057106; cv=none; d=google.com; s=arc-20160816; b=gZBjveH0QA9EIWIxsQskTMNhdf6D1yiriUbGDTZAD3oeohB3pZ0p9pCPGKjj0yLqlj ghojovAlJLC1KrlpNEq33qjkREW6NppBQC6EeAKpm9spfe4hADoFhVHKVsXNRAZE/eTs Y/A883HKIKOK4+ds6RR8L3RfPOWkqMDld/J/iqBDp2p9KGSpGwtJyt38S5YM/vW6rAZB imqM7JJ4Jvi6PWFxULyUuYCMfTYKDIXTqroEvErR6tD3o1IvhM9UeS9oqEF5f2anj45F ZXur8xHZoFDoYLrsloW19b0d5f2TsjNePCVbE5T6ezjyGFviCeyo4plIeXEi2L6UmF+C P3wQ== 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=R7L7uKOximIspOygf2Tl7tQVrb9U3c/OgIUpeN5WxNs=; b=GsqV4p9atchq+KbjtzaVFjnjNaGTNRDquS3kybn0DyOZMBWrs5QJxw9MecrQ0/0KfX WppV4WHLWtbAtztUTAd4kgBA5MzZMaYNUoVHT2l49dVpp8O+YzzbSZh7eS//UD4eovPP 25xV4brZgj/AVUdDTSIO5ZHZ/Up2wBVeEeOPLahIJYjYVjsJmvXwyyDuS3enh1qAjicV v2v3ibzDi6bDD/wADr12ydLrjXR6T0CMDi0b2LSFbchHhlCcvYzb0MctzFL/hi3JROoJ YA0eUYlr+JjpsYj3Ib9FdshxIlWTQcE9XeXqHhJ+Wm5O1RjQUx1p0AjU46NOEk3JMYuz PuRg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com. [68.232.141.98]) by gmr-mx.google.com with ESMTPS id 5si1282273ybl.1.2019.11.06.08.18.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Nov 2019 08:18:26 -0800 (PST) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.141.98 as permitted sender) client-ip=68.232.141.98; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com IronPort-SDR: /cEaSvarcagYTftxKDQDhCXLgEtLWk5u1btt4YElQUiKzsQ6kPrh4xLcCyGN5Rfvn4JfUY1bEa 6yM/J6yPPbgUOjm1718apnMVWNRTWC6t3ZDeycNRNng11Opt2snk+zlBOvBkW8qJn3eAvwk+w/ qLxuD/fiGGNUhKMkoDSukPA/IpSJ7lfBsKTFJQqeT8msX7zpSyfv35EwIsGASN7Q4JwKaj6Amy 63vrfbPpUrKcrYYQnhAJ/pp17TlWydHzrzAGNQT/SMSVyrT75OwPELZYj8zEohW/Ibp9912oPJ ceg= X-IronPort-AV: E=Sophos;i="5.68,275,1569312000"; d="scan'208";a="42864380" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 06 Nov 2019 08:17:36 -0800 IronPort-SDR: 4rlw+Jdt/p/55Pg3Zfum8GxeY1Sy88l+YgIwKG+oQhMvtM559XWSBZZ6H6B3KBb94zqHKbJ523 48Xeu5DPO944Ny8q5DO8iUGn1plkV6916EHhkSbxOP1jI6ILj+sw3kbsZBbRuEs+ARzUUbTSrm r6iJ+iH9yc35R2G/zXZFJWmmvfYtrSL7PYGZtpTYxhXDNkuK9YnkrNhUDES3IdR1n2ghVrrUzT fMgHFiFxgS7JiwTXnvp3OUYPU3DDa0/eQAgeNixBRqyOl1c7W6x/cI40S/f0wpxvDgq8muztbo 1bA= Subject: Re: [PATCH 04/10] recipes-kernel/linux: make KERNEL_DEFCONFIG support in-tree defconfigs To: Jan Kiszka , "[ext] Henning Schild" CC: References: <1571907744-1121-1-git-send-email-Cedric_Hombourger@mentor.com> <1571907744-1121-5-git-send-email-Cedric_Hombourger@mentor.com> <20191024200246.291f526c@md1za8fc.ad001.siemens.net> <030b523c-6e87-34e0-c4dc-2d27a719cbed@siemens.com> From: Cedric Hombourger Message-ID: <2c6cbb85-1bd9-e86f-1c5d-1de9978a86b6@mentor.com> Date: Wed, 6 Nov 2019 17:17:12 +0100 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: <030b523c-6e87-34e0-c4dc-2d27a719cbed@siemens.com> 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-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) X-TUID: O8Z6IbXG9wJ7 On 11/6/2019 5:03 PM, Jan Kiszka wrote: > On 24.10.19 20:02, [ext] Henning Schild wrote: >> Not sure i like that. We are mixing "make target" and .config-filename >> into one variable. I would rather invent another one. >> > Would be in line with Yocto/OE at least. > >> KERNEL_CONFIG_FILE ?= "foo" >> KERNEL_CONFIG_TARGET ?= "olddefconfig" > Downside: you have to fiddle with both variables when switching from > defconfig to provide config + olddefconfig. > > I think the unified semantic is not that bad. A user still has control > over file vs. built-in config by not providing that file in the first place. and I now understand what Henning was suggesting in the first place the linux-custom patch series I sent yesterday only has KERNEL_DEFCONFIG as user-visible API. I would agree with Jan that we probably want to keep it simple for the end-user. I would vote for keeping KERNEL_DEFCONFIG as the only API but I am happy to discuss what we do with respect to in-tree / out-of-tree defconfigs. This patch will have Isar automagically determine where to get the defconfig from. We could alternatively require the defconfig to be always be part of the tree but that may make some people unhappy since they may be relying on the current behavior. Requiring people to copy the in-tree defconfig to their layer so that Isar can find it does not sound great either. Hence the current proposal - some sort of middle-ground - well I hope ! Cedric > Jan > >> Henning >> >> >> Am Thu, 24 Oct 2019 11:02:18 +0200 >> schrieb Cedric Hombourger : >> >>> The recipe expected the specified KERNEL_DEFCONFIG to be provided as a >>> SRC_URI while the kernel already provides many useful defconfigs. The >>> recipe will now check if the specified configuration can be found in >>> WORKDIR. If it is found, it will then be used via "make olddefconfig" >>> as before. It will otherwise assume that it is an in-tree defconfig >>> and attempt a "make foobar_defconfig" (where foobar_defconfig is the >>> user-provided KERNEL_DEFCONFIG setting). >>> >>> Signed-off-by: Cedric Hombourger >>> --- >>> meta/recipes-kernel/linux/files/build-kernel.sh | 6 +----- >>> meta/recipes-kernel/linux/linux-custom.inc | 11 +++++++++-- >>> 2 files changed, 10 insertions(+), 7 deletions(-) >>> >>> diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh >>> b/meta/recipes-kernel/linux/files/build-kernel.sh index >>> dcb46f7..cb310f7 100644 --- >>> a/meta/recipes-kernel/linux/files/build-kernel.sh +++ >>> b/meta/recipes-kernel/linux/files/build-kernel.sh @@ -36,11 +36,7 @@ >>> REPACK_DIR="$1/../repack" >>> REPACK_LINUX_IMAGE_DIR="${REPACK_DIR}/linux-image" >>> REPACK_LINUX_HEADERS_DIR="${REPACK_DIR}/linux-headers" >>> -if [ -e .config ]; then >>> - make olddefconfig >>> -else >>> - make defconfig >>> -fi >>> +make ${KERNEL_DEFCONFIG} >>> >>> 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 5a34dd1..c53cd90 >>> 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc >>> +++ b/meta/recipes-kernel/linux/linux-custom.inc >>> @@ -61,8 +61,14 @@ addtask devshell after do_install_builddeps >>> >>> dpkg_runbuild() { >>> chmod +x ${WORKDIR}/build-kernel.sh >>> - if [ -n "${KERNEL_DEFCONFIG}" ]; then >>> - cp ${WORKDIR}/${KERNEL_DEFCONFIG} ${S}/.config >>> + defconfig="${KERNEL_DEFCONFIG}" >>> + if [ -n "${defconfig}" ]; then >>> + if [ -e "${WORKDIR}/${defconfig}" ]; then >>> + cp ${WORKDIR}/${defconfig} ${S}/.config >>> + defconfig="olddefconfig" >>> + fi >>> + else >>> + defconfig="defconfig" >>> fi >>> >>> E="${@ bb.utils.export_proxies(d)}" >>> @@ -72,6 +78,7 @@ dpkg_runbuild() { >>> >>> export KBUILD_DEPENDS="${KBUILD_DEPENDS}" >>> export KERNEL_DEBIAN_DEPENDS="${KERNEL_DEBIAN_DEPENDS}" >>> + export KERNEL_DEFCONFIG="${defconfig}" >>> export KERNEL_FILE="${KERNEL_FILE}" >>> export >>> KERNEL_HEADERS_DEBIAN_DEPENDS="${KERNEL_HEADERS_DEBIAN_DEPENDS}"