Jeff Mahoney c51605
From: Jeff Mahoney <jeffm@suse.com>
Jeff Mahoney c51605
Subject: kernel: add release status to kernel build
Jeff Mahoney c51605
Patch-mainline: Never, SUSE specific
Jeff Mahoney cf5ff1
References: FATE#325281
Jeff Mahoney c51605
Jeff Mahoney c51605
We build many kernels from the same sources but not all packages are
Jeff Mahoney c51605
destined to be officially released kernel.  This adds a new config
Jeff Mahoney c51605
option to mark a kernel as released.  It defaults to no.  If it
Jeff Mahoney c51605
is an unreleased kernel it will show " (unreleased)" after the version
Jeff Mahoney c51605
string in Oopses and also show "No, Unreleased kernel" whenever
Jeff Mahoney c51605
supported status is printed.
Jeff Mahoney c51605
Jeff Mahoney c51605
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Jeff Mahoney c51605
---
Michal Kubecek 4e61ec
 init/Kconfig.suse |  6 ++++++
Michal Kubecek 4e61ec
 kernel/ksysfs.c   |  4 ++++
Michal Kubecek 4e61ec
 lib/dump_stack.c  | 10 ++++++++--
Jeff Mahoney c51605
 3 files changed, 18 insertions(+), 2 deletions(-)
Jeff Mahoney c51605
Jeff Mahoney c51605
--- a/init/Kconfig.suse
Jeff Mahoney c51605
+++ b/init/Kconfig.suse
Jeff Mahoney c51605
@@ -87,4 +87,10 @@ config SUSE_KERNEL_SUPPORTED
Jeff Mahoney c51605
 	  If you aren't building a kernel for an enterprise distribution,
Jeff Mahoney c51605
 	  say n.
Jeff Mahoney c51605
 
Ales Novak 4daffd
+config SUSE_KERNEL_RELEASED
Jeff Mahoney c51605
+	bool "Release kernel"
Jeff Mahoney c51605
+	default n
Jeff Mahoney c51605
+	help
Jeff Mahoney c51605
+	  This kernel is built for release through official channels.
Jeff Mahoney c51605
+
Jeff Mahoney c51605
 endmenu
Jeff Mahoney c51605
--- a/kernel/ksysfs.c
Jeff Mahoney c51605
+++ b/kernel/ksysfs.c
Michal Kubecek 34fe32
@@ -211,6 +211,7 @@ EXPORT_SYMBOL_GPL(kernel_kobj);
Jeff Mahoney c51605
 #ifdef CONFIG_SUSE_KERNEL_SUPPORTED
Jeff Mahoney c51605
 const char *supported_printable(int taint)
Jeff Mahoney c51605
 {
Ales Novak 4daffd
+#ifdef CONFIG_SUSE_KERNEL_RELEASED
Jeff Mahoney c51605
 	int mask = (1 << TAINT_PROPRIETARY_MODULE) | (1 << TAINT_NO_SUPPORT);
Jeff Mahoney c51605
 	if ((taint & mask) == mask)
Jeff Mahoney c51605
 		return "No, Proprietary and Unsupported modules are loaded";
Michal Kubecek 34fe32
@@ -222,6 +223,9 @@ const char *supported_printable(int taint)
Jeff Mahoney c51605
 		return "Yes, External";
Jeff Mahoney c51605
 	else
Jeff Mahoney c51605
 		return "Yes";
Jeff Mahoney c51605
+#else
Jeff Mahoney c51605
+		return "No, Unreleased kernel";
Jeff Mahoney c51605
+#endif
Jeff Mahoney c51605
 }
Jeff Mahoney c51605
 
Jeff Mahoney c51605
 static ssize_t supported_show(struct kobject *kobj,
Michal Kubecek 4e61ec
--- a/lib/dump_stack.c
Michal Kubecek 4e61ec
+++ b/lib/dump_stack.c
Michal Kubecek 34fe32
@@ -55,13 +55,19 @@ void __init dump_stack_set_arch_desc(const char *fmt, ...)
Jeff Mahoney c51605
  */
Jeff Mahoney c51605
 void dump_stack_print_info(const char *log_lvl)
Jeff Mahoney c51605
 {
Michal Kubecek 34fe32
-	printk("%sCPU: %d PID: %d Comm: %.20s %s%s %s %.*s %s" BUILD_ID_FMT "\n",
Michal Kubecek 34fe32
+	printk("%sCPU: %d PID: %d Comm: %.20s %s%s %s %.*s %s%s" BUILD_ID_FMT "\n",
Jeff Mahoney c51605
 	       log_lvl, raw_smp_processor_id(), current->pid, current->comm,
Michal Kubecek 4e61ec
 	       kexec_crash_loaded() ? "Kdump: loaded " : "",
Michal Kubecek 4e61ec
 	       print_tainted(),
Michal Kubecek 4e61ec
 	       init_utsname()->release,
Jeff Mahoney c51605
 	       (int)strcspn(init_utsname()->version, " "),
Michal Kubecek 34fe32
-	       init_utsname()->version, SUSE_PRODUCT_SHORTNAME, BUILD_ID_VAL);
Jeff Mahoney c51605
+	       init_utsname()->version, SUSE_PRODUCT_SHORTNAME,
Ales Novak 4daffd
+#ifndef CONFIG_SUSE_KERNEL_RELEASED
Michal Kubecek 34fe32
+	       " (unreleased)",
Jeff Mahoney c51605
+#else
Michal Kubecek 34fe32
+	       "",
Jeff Mahoney c51605
+#endif
Michal Kubecek 34fe32
+	       BUILD_ID_VAL);
Jeff Mahoney c51605
 
Jeff Mahoney c51605
 	if (dump_stack_arch_desc_str[0] != '\0')
Jeff Mahoney c51605
 		printk("%sHardware name: %s\n",