The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: HONG Yifan <elsk@google.com>
To: Masahiro Yamada <masahiroy@kernel.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: HONG Yifan <elsk@google.com>,
	kernel-team@android.com, linux-kernel@vger.kernel.org
Subject: [PATCH v1] setlocalversion: use ${objtree}/include/config/auto.conf
Date: Wed, 12 Mar 2025 02:11:45 +0000	[thread overview]
Message-ID: <20250312021154.102262-2-elsk@google.com> (raw)

setlocalversion reads include/config/auto.conf, which is located below
$(objtree) with commit 214c0eea43b2 ("kbuild: add $(objtree)/ prefix to
some in-kernel build artifacts").

Hence, the setlocalversion script needs to use
$(objtree)/include/config/auto.conf as well.

Note that $(objtree) is not necessarily `.` when O (aka KBUILD_OUTPUT)
is set, because of commit 13b25489b6f8 ("kbuild: change working
directory to external module directory with M=").

Signed-off-by: HONG Yifan <elsk@google.com>
---
Implementation note: Should I test -z ${objtree} before using it? Otherwise it
looks at /include/config/auto.conf which is wrong.
Or should I fall back to `.` if objtree is not found in the environment
variables?
I could also `exit 1` if $objtree is not set. Please let me know what you think.

 scripts/setlocalversion | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 28169d7e143b..88f54eb5a7c2 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -186,7 +186,7 @@ if ${no_local}; then
 	exit 0
 fi

-if ! test -e include/config/auto.conf; then
+if ! test -e ${objtree}/include/config/auto.conf; then
 	echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2
 	exit 1
 fi
--
2.49.0.rc0.332.g42c0ae87b1-goog


             reply	other threads:[~2025-03-12  2:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-12  2:11 HONG Yifan [this message]
2025-03-12  7:30 ` [PATCH v1] setlocalversion: use ${objtree}/include/config/auto.conf Masahiro Yamada
2025-03-12 19:13   ` Hong, Yifan
2025-03-12 23:02     ` Hong, Yifan
2025-03-15  7:28     ` Masahiro Yamada
2025-03-18  0:59       ` [PATCH v2] " HONG Yifan
2025-03-22 15:14         ` Masahiro Yamada
2025-03-24 23:11           ` Hong, Yifan

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=20250312021154.102262-2-elsk@google.com \
    --to=elsk@google.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=masahiroy@kernel.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