diff mbox series

[6/7] setlocalversion: print ${KERNELRELEASE} if set

Message ID 20230122141428.115372-6-masahiroy@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/7] kbuild: do not put .scmversion into the source tarball | expand

Commit Message

Masahiro Yamada Jan. 22, 2023, 2:14 p.m. UTC
When KERNELRELEASE is overridden, include/config/kernel.release still
stores the string would be returned by the script if KERNELRELEASE had
not been overridden. This is not strange.

include/config/kernel.release should store KERNELRELEASE that was used
for building the kernel.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/setlocalversion | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Masahiro Yamada Jan. 27, 2023, 4:19 p.m. UTC | #1
On Sun, Jan 22, 2023 at 11:14 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> When KERNELRELEASE is overridden, include/config/kernel.release still
> stores the string would be returned by the script if KERNELRELEASE had
> not been overridden. This is not strange.
>
> include/config/kernel.release should store KERNELRELEASE that was used
> for building the kernel.
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>




I will drop this patch because a regression was reported.


https://lore.kernel.org/linux-kbuild/CAK7LNATc_aPxiYXabzYbGXOMUW0Rcf0KQi6GBPvoy71uPuqKPg@mail.gmail.com/T/#m514a0303841590f48f0446b70f56986b9f1402cc









> ---
>
>  scripts/setlocalversion | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/scripts/setlocalversion b/scripts/setlocalversion
> index 7c7cbefa5aa4..eff8cc831571 100755
> --- a/scripts/setlocalversion
> +++ b/scripts/setlocalversion
> @@ -103,6 +103,11 @@ collect_files()
>         echo "$res"
>  }
>
> +if [ -n "${KERNELRELEASE}" ]; then
> +       echo "${KERNELRELEASE}"
> +       exit 0
> +fi
> +
>  if ! test -e include/config/auto.conf; then
>         echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2
>         exit 1
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/scripts/setlocalversion b/scripts/setlocalversion
index 7c7cbefa5aa4..eff8cc831571 100755
--- a/scripts/setlocalversion
+++ b/scripts/setlocalversion
@@ -103,6 +103,11 @@  collect_files()
 	echo "$res"
 }
 
+if [ -n "${KERNELRELEASE}" ]; then
+	echo "${KERNELRELEASE}"
+	exit 0
+fi
+
 if ! test -e include/config/auto.conf; then
 	echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2
 	exit 1