linux/scripts/build-version
Masahiro Yamada ae4c4cee81 kbuild: move init/build-version to scripts/
At first, I thought this script would be needed only in init/Makefile.

However, commit 5db8face97 ("kbuild: Restore .version auto-increment
behaviour for Debian packages") and commit 1789fc9125 ("kbuild:
rpm-pkg: invoke the kernel build from rpmbuild for binrpm-pkg")
revealed that it was actually needed for scripts/package/mk* as well.

After all, scripts/ is a better place for it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
2024-07-16 01:08:37 +09:00

11 lines
177 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
prev_ver=$(cat .version 2>/dev/null) &&
ver=$(expr ${prev_ver} + 1 2>/dev/null) ||
ver=1
echo ${ver} > .version
echo ${ver}