public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] kernel-build.eclass: Fix handling savedconfig w/o default configs
@ 2024-08-30 12:28 Michał Górny
  0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2024-08-30 12:28 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-30 12:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-30 12:28 [gentoo-dev] [PATCH] kernel-build.eclass: Fix handling savedconfig w/o default configs Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox