Merge tag 'gvt-fixes-2017-12-06' of https://github.com/intel/gvt-linux into drm-intel...
[platform/kernel/linux-starfive.git] / scripts / link-vmlinux.sh
index e6818b8..c0d129d 100755 (executable)
@@ -188,10 +188,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
@@ -239,12 +237,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/
@@ -332,6 +330,3 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then
                exit 1
        fi
 fi
-
-# We made a new kernel - delete old version file
-rm -f .old_version