From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 638361581FB for ; Fri, 30 Aug 2024 12:28:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BF965E29EE; Fri, 30 Aug 2024 12:28:05 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7FEF4E29E9 for ; Fri, 30 Aug 2024 12:28:05 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH] kernel-build.eclass: Fix handling savedconfig w/o default configs Date: Fri, 30 Aug 2024 14:28:00 +0200 Message-ID: <20240830122800.289148-1-mgorny@gentoo.org> X-Mailer: git-send-email 2.46.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: c640a951-278c-487c-8cec-08a5ee7e1260 X-Archives-Hash: 9dc3e3f6a837c8390a122898f85d09fb Fix the new savedconfig logic not to require preexisting `.config` if savedconfig will be used. This is needed to handle architectures where we do not supply default configs, and savedconfig is the only option. Fixes: e290c3c78b7a ("...: Apply savedconfig on top of merged configs") Closes: https://bugs.gentoo.org/938725 Signed-off-by: Michał Górny --- eclass/kernel-build.eclass | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass index be02920162f4..6471cbb3e254 100644 --- a/eclass/kernel-build.eclass +++ b/eclass/kernel-build.eclass @@ -243,7 +243,13 @@ kernel-build_src_configure() { MAKEARGS+=( KBZIP2="lbzip2" ) fi - [[ -f .config ]] || die "Ebuild error: please copy default config into .config" + if [[ ! -f .config ]]; then + if use savedconfig; then + > .config || die + else + die "Ebuild error: please copy default config into .config" + fi + fi if [[ -z "${KV_LOCALVERSION}" ]]; then KV_LOCALVERSION=$(sed -n -e 's#^CONFIG_LOCALVERSION="\(.*\)"$#\1#p' \ -- 2.46.0