linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] kbuild: link-vmlinux.sh: simplify .version increment
@ 2017-09-22  5:31 Masahiro Yamada
  2017-09-22  5:31 ` [PATCH 2/2] kbuild: mkcompile_h: do not create .version Masahiro Yamada
  2017-10-05 20:19 ` [PATCH 1/2] kbuild: link-vmlinux.sh: simplify .version increment Masahiro Yamada
  0 siblings, 2 replies; 4+ messages in thread
From: Masahiro Yamada @ 2017-09-22  5:31 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Sam Ravnborg, Masahiro Yamada, Michal Marek, Nicholas Piggin,
	linux-kernel

Since commit 1f2bfbd00e46 ("kbuild: link of vmlinux moved to a
script"), it is easy to increment .version without using a temporary
file .old_version.

I do not see anybody who creates .tmp_version any more.  Probably
it is a left-over of commit 4e25d8bb9550fb ("[PATCH] kbuild: adjust
.version updating").  Just remove it.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Makefile                |  2 +-
 scripts/link-vmlinux.sh | 15 +++++----------
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/Makefile b/Makefile
index 64cbc66..9e2781d 100644
--- a/Makefile
+++ b/Makefile
@@ -1278,7 +1278,7 @@ CLEAN_DIRS  += $(MODVERDIR)
 # Directories & files removed with 'make mrproper'
 MRPROPER_DIRS  += include/config usr/include include/generated          \
 		  arch/*/include/generated .tmp_objdiff
-MRPROPER_FILES += .config .config.old .version .old_version \
+MRPROPER_FILES += .config .config.old .version \
 		  Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \
 		  signing_key.pem signing_key.priv signing_key.x509	\
 		  x509.genkey extra_certificates signing_key.x509.keyid	\
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index e7b7eee..0cdb25b 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -187,10 +187,8 @@ sortextable()
 # Delete output files in case of error
 cleanup()
 {
-	rm -f .old_version
 	rm -f .tmp_System.map
 	rm -f .tmp_kallsyms*
-	rm -f .tmp_version
 	rm -f .tmp_vmlinux*
 	rm -f built-in.o
 	rm -f System.map
@@ -238,12 +236,12 @@ esac
 
 # Update version
 info GEN .version
-if [ ! -r .version ]; then
-	rm -f .version;
-	echo 1 >.version;
+if [ -r .version ]; then
+	VERSION=$(expr 0$(cat .version) + 1)
+	echo $VERSION > .version
 else
-	mv .version .old_version;
-	expr 0$(cat .old_version) + 1 >.version;
+	rm -f .version
+	echo 1 > .version
 fi;
 
 # final build of init/
@@ -331,6 +329,3 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
 		exit 1
 	fi
 fi
-
-# We made a new kernel - delete old version file
-rm -f .old_version
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] kbuild: mkcompile_h: do not create .version
  2017-09-22  5:31 [PATCH 1/2] kbuild: link-vmlinux.sh: simplify .version increment Masahiro Yamada
@ 2017-09-22  5:31 ` Masahiro Yamada
  2017-10-05 20:23   ` Masahiro Yamada
  2017-10-05 20:19 ` [PATCH 1/2] kbuild: link-vmlinux.sh: simplify .version increment Masahiro Yamada
  1 sibling, 1 reply; 4+ messages in thread
From: Masahiro Yamada @ 2017-09-22  5:31 UTC (permalink / raw)
  To: linux-kbuild; +Cc: Sam Ravnborg, Masahiro Yamada, Michal Marek, linux-kernel

This script need not to create .version; it will be created by
scripts/link-vmlinux.sh later.  Clean-up the code slightly.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/mkcompile_h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h
index fd8fdb9..f1ee4eb 100755
--- a/scripts/mkcompile_h
+++ b/scripts/mkcompile_h
@@ -27,12 +27,7 @@ LC_ALL=C
 export LC_ALL
 
 if [ -z "$KBUILD_BUILD_VERSION" ]; then
-	if [ -r .version ]; then
-		VERSION=`cat .version`
-	else
-		VERSION=0
-		echo 0 > .version
-	fi
+	VERSION=$(cat .version 2>/dev/null || echo 1)
 else
 	VERSION=$KBUILD_BUILD_VERSION
 fi
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] kbuild: link-vmlinux.sh: simplify .version increment
  2017-09-22  5:31 [PATCH 1/2] kbuild: link-vmlinux.sh: simplify .version increment Masahiro Yamada
  2017-09-22  5:31 ` [PATCH 2/2] kbuild: mkcompile_h: do not create .version Masahiro Yamada
@ 2017-10-05 20:19 ` Masahiro Yamada
  1 sibling, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2017-10-05 20:19 UTC (permalink / raw)
  To: Linux Kbuild mailing list
  Cc: Sam Ravnborg, Masahiro Yamada, Michal Marek, Nicholas Piggin,
	Linux Kernel Mailing List

2017-09-22 14:31 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> Since commit 1f2bfbd00e46 ("kbuild: link of vmlinux moved to a
> script"), it is easy to increment .version without using a temporary
> file .old_version.
>
> I do not see anybody who creates .tmp_version any more.  Probably
> it is a left-over of commit 4e25d8bb9550fb ("[PATCH] kbuild: adjust
> .version updating").  Just remove it.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>


Applied to linux-kbuild/kbuild.



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] kbuild: mkcompile_h: do not create .version
  2017-09-22  5:31 ` [PATCH 2/2] kbuild: mkcompile_h: do not create .version Masahiro Yamada
@ 2017-10-05 20:23   ` Masahiro Yamada
  0 siblings, 0 replies; 4+ messages in thread
From: Masahiro Yamada @ 2017-10-05 20:23 UTC (permalink / raw)
  To: Linux Kbuild mailing list
  Cc: Sam Ravnborg, Masahiro Yamada, Michal Marek, Linux Kernel Mailing List

2017-09-22 14:31 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> This script need not to create .version; it will be created by
> scripts/link-vmlinux.sh later.  Clean-up the code slightly.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


Applied to linux-kbuild/kbuild.



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-05 20:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22  5:31 [PATCH 1/2] kbuild: link-vmlinux.sh: simplify .version increment Masahiro Yamada
2017-09-22  5:31 ` [PATCH 2/2] kbuild: mkcompile_h: do not create .version Masahiro Yamada
2017-10-05 20:23   ` Masahiro Yamada
2017-10-05 20:19 ` [PATCH 1/2] kbuild: link-vmlinux.sh: simplify .version increment Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).