From e8300c07183a0e0c4471bcafdafc6e86bef0f562 Mon Sep 17 00:00:00 2001 From: Xing Xu Date: Wed, 27 May 2015 16:28:39 +0800 Subject: [PATCH] gxbb: change kernel version check 1 add kernel_release_full to print 2 enlarge Kernel log buffer to 1<<19 3 print full version info in dump stack or panic Change-Id: I3c840e6f72bc4b9e8dc202a76ccba96dccb9436e --- Makefile | 10 ++++++---- arch/arm64/configs/meson64_defconfig | 1 + init/version.c | 2 +- kernel/printk/printk.c | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 389b2be31c00..7a9efc7795c4 100644 --- a/Makefile +++ b/Makefile @@ -393,7 +393,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 @@ -852,8 +853,9 @@ endef # Store (new) KERNELRELEASE string in include/config/kernel.release include/config/kernel.release: include/config/auto.conf FORCE - $(call filechk,kernel.release) - + $(Q)rm -f $@ + $(Q)echo "$(KERNELVERSION)" > $@ + $(Q)echo "$(KERNELVERSION)$$($(CONFIG_SHELL) $(srctree)/scripts/setlocalversion $(srctree))" >> $@ # Things we need to do before we recursively start building the kernel # or the modules are listed in "prepare". @@ -904,7 +906,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/arch/arm64/configs/meson64_defconfig b/arch/arm64/configs/meson64_defconfig index 82bb802c1888..30b2f76f9fff 100644 --- a/arch/arm64/configs/meson64_defconfig +++ b/arch/arm64/configs/meson64_defconfig @@ -5,6 +5,7 @@ CONFIG_HIGH_RES_TIMERS=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y +CONFIG_LOG_BUF_SHIFT=19 CONFIG_CGROUPS=y CONFIG_BLK_DEV_INITRD=y CONFIG_RD_BZIP2=y diff --git a/init/version.c b/init/version.c index 1a4718e500fe..8e492c8c35a6 100644 --- a/init/version.c +++ b/init/version.c @@ -41,7 +41,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[] = diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 8a1143cedbbe..bf38240a4add 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -45,7 +45,7 @@ #include #include #include - +#include #include #define CREATE_TRACE_POINTS @@ -2884,7 +2884,7 @@ void dump_stack_print_info(const char *log_lvl) { printk("%sCPU: %d PID: %d Comm: %.20s %s %s %.*s\n", log_lvl, raw_smp_processor_id(), current->pid, current->comm, - print_tainted(), init_utsname()->release, + print_tainted(), UTS_RELEASE_FULL /*init_utsname()->release*/, (int)strcspn(init_utsname()->version, " "), init_utsname()->version);