summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Hong <rurumihong@google.com>2019-07-19 16:37:33 +0800
committerAlistair Delva <adelva@google.com>2020-10-29 10:37:34 -0700
commitfccfaf8600b2ff64e7176cb83b8cc6a03bc925f2 (patch)
treed7279d5acc5ac255e2114e0ac57e342f6970b7f0
parent608df7b5d6267a4bb674dea62cacc4028f876784 (diff)
ANDROID: Makefile: append BUILD_NUMBER to version string when defined
In current implementation the Linux version string that is attached to the kernel linux image as well as the all kernel modules includes the sha1 of the main git project for the kernel. This Commit adds the BUILD_NUMBER env variable with an 'ab' prefix to the Linux version string. This maps to both the Linux Image and all kernel modules version strings. Bug: 159842160 Bug: 137521202 Test: Build the kernel and test the version string Change-Id: I4795955f36f477b257ca86495726e24d6b196d05 Signed-off-by: Alex Hong <rurumihong@google.com> (cherry picked from commit e60f995403c9799dd0dc14d62d77d6698a8a7126) [willmcvicker: fix uts_len check to include -ab$(BUILD_NUMBER)] Signed-off-by: Will McVicker <willmcvicker@google.com>
-rw-r--r--Makefile15
1 files changed, 10 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 3be2342f9a9b..c002a3407163 100644
--- a/Makefile
+++ b/Makefile
@@ -1070,12 +1070,17 @@ prepare: prepare0
# needs to be updated, so this check is forced on all builds
uts_len := 64
+ifneq (,$(BUILD_NUMBER))
+ UTS_RELEASE=$(KERNELRELEASE)-ab$(BUILD_NUMBER)
+else
+ UTS_RELEASE=$(KERNELRELEASE)
+endif
define filechk_utsrelease.h
- if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
- echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
- exit 1; \
- fi; \
- (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";)
+ if [ `echo -n "$(UTS_RELEASE)" | wc -c ` -gt $(uts_len) ]; then \
+ echo '"$(UTS_RELEASE)" exceeds $(uts_len) characters' >&2; \
+ exit 1; \
+ fi; \
+ (echo \#define UTS_RELEASE \"$(UTS_RELEASE)\";)
endef
define filechk_version.h