public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH] kernel-build.eclass: Fix handling savedconfig w/o default configs
Date: Fri, 30 Aug 2024 14:28:00 +0200	[thread overview]
Message-ID: <20240830122800.289148-1-mgorny@gentoo.org> (raw)

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 <mgorny@gentoo.org>
---
 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



                 reply	other threads:[~2024-08-30 12:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240830122800.289148-1-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /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