summaryrefslogtreecommitdiff
authorYixun Lan <yixun.lan@amlogic.com>2017-05-25 04:27:15 (GMT)
committer Victor Wan <victor.wan@amlogic.com>2017-05-27 09:12:13 (GMT)
commite95ed5b5710829aedfe290181960f4500966c6c2 (patch)
tree8bdeecf9c2124f2fe1382017d374c9e09ae99023
parentf601b2e21a8760457bf57b47e2716ed96a84fc3f (diff)
downloadcommon-e95ed5b5710829aedfe290181960f4500966c6c2.zip
common-e95ed5b5710829aedfe290181960f4500966c6c2.tar.gz
common-e95ed5b5710829aedfe290181960f4500966c6c2.tar.bz2
Makefile: lock kernel version without localversion appended
PD#144946: Makefile: lock kernel version without localversion appended after this change, we will lock kernel version to 4.x.y but we can still get out the exact commit version from dmesg. 1) uname -r : 4.9.27 2) dmesg |grep "Linux version" [ 0.000000@0] Linux version 4.9.27-638106-g5de5d7a .... Change-Id: I35072b399af403d3a1737300a8786cf36063c668 Signed-off-by: Yixun Lan <yixun.lan@amlogic.com>
Diffstat
-rw-r--r--Makefile7
-rw-r--r--init/version.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 09f757c..8259f43 100644
--- a/Makefile
+++ b/Makefile
@@ -411,7 +411,8 @@ KBUILD_CFLAGS_MODULE := -DMODULE
KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds
# Read KERNELRELEASE from include/config/kernel.release (if it exists)
-KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
+KERNELRELEASE = $(shell head -1 include/config/kernel.release 2> /dev/null)
+KERNELRELEASE_FULL = $(shell tail -1 include/config/kernel.release 2> /dev/null)
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION
@@ -992,7 +993,7 @@ $(vmlinux-dirs): prepare scripts
$(Q)$(MAKE) $(build)=$@
define filechk_kernel.release
- echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
+ echo "$(KERNELVERSION)\n$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))"
endef
# Store (new) KERNELRELEASE string in include/config/kernel.release
@@ -1092,7 +1093,7 @@ define filechk_utsrelease.h
echo '"$(KERNELRELEASE)" exceeds $(uts_len) characters' >&2; \
exit 1; \
fi; \
- (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\";)
+ (echo \#define UTS_RELEASE \"$(KERNELRELEASE)\"; echo \#define UTS_RELEASE_FULL \"$(KERNELRELEASE_FULL)\";)
endef
define filechk_version.h
diff --git a/init/version.c b/init/version.c
index fe41a63..41c4be3 100644
--- a/init/version.c
+++ b/init/version.c
@@ -44,7 +44,7 @@ EXPORT_SYMBOL_GPL(init_uts_ns);
/* FIXED STRINGS! Don't touch! */
const char linux_banner[] =
- "Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
+ "Linux version " UTS_RELEASE_FULL " (" LINUX_COMPILE_BY "@"
LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
const char linux_proc_banner[] =