Skip to content

Commit

Permalink
kbuild: link-vmlinux.sh: simplify .version increment
Browse files Browse the repository at this point in the history
Since commit 1f2bfbd ("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 the .tmp_version.  Probably it is a
left-over of commit 4e25d8b ("[PATCH] kbuild: adjust .version
updating").  Just remove it.

Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
masahir0y committed Oct 9, 2017
1 parent f231e43 commit 278ae60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
15 changes: 5 additions & 10 deletions scripts/link-vmlinux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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

0 comments on commit 278ae60

Please sign in to comment.