Blob Blame History Raw
From: Jeff Mahoney <jeffm@suse.com>
Subject: kernel: add release status to kernel build
Patch-mainline: Never, SUSE specific
References: FATE#325281

We build many kernels from the same sources but not all packages are
destined to be officially released kernel.  This adds a new config
option to mark a kernel as released.  It defaults to no.  If it
is an unreleased kernel it will show " (unreleased)" after the version
string in Oopses and also show "No, Unreleased kernel" whenever
supported status is printed.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 init/Kconfig.suse |  6 ++++++
 kernel/ksysfs.c   |  4 ++++
 lib/dump_stack.c  | 10 ++++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)

--- a/init/Kconfig.suse
+++ b/init/Kconfig.suse
@@ -87,4 +87,10 @@ config SUSE_KERNEL_SUPPORTED
 	  If you aren't building a kernel for an enterprise distribution,
 	  say n.
 
+config SUSE_KERNEL_RELEASED
+	bool "Release kernel"
+	default n
+	help
+	  This kernel is built for release through official channels.
+
 endmenu
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -211,6 +211,7 @@ EXPORT_SYMBOL_GPL(kernel_kobj);
 #ifdef CONFIG_SUSE_KERNEL_SUPPORTED
 const char *supported_printable(int taint)
 {
+#ifdef CONFIG_SUSE_KERNEL_RELEASED
 	int mask = (1 << TAINT_PROPRIETARY_MODULE) | (1 << TAINT_NO_SUPPORT);
 	if ((taint & mask) == mask)
 		return "No, Proprietary and Unsupported modules are loaded";
@@ -222,6 +223,9 @@ const char *supported_printable(int taint)
 		return "Yes, External";
 	else
 		return "Yes";
+#else
+		return "No, Unreleased kernel";
+#endif
 }
 
 static ssize_t supported_show(struct kobject *kobj,
--- a/lib/dump_stack.c
+++ b/lib/dump_stack.c
@@ -55,13 +55,19 @@ void __init dump_stack_set_arch_desc(const char *fmt, ...)
  */
 void dump_stack_print_info(const char *log_lvl)
 {
-	printk("%sCPU: %d PID: %d Comm: %.20s %s%s %s %.*s %s" BUILD_ID_FMT "\n",
+	printk("%sCPU: %d PID: %d Comm: %.20s %s%s %s %.*s %s%s" BUILD_ID_FMT "\n",
 	       log_lvl, raw_smp_processor_id(), current->pid, current->comm,
 	       kexec_crash_loaded() ? "Kdump: loaded " : "",
 	       print_tainted(),
 	       init_utsname()->release,
 	       (int)strcspn(init_utsname()->version, " "),
-	       init_utsname()->version, SUSE_PRODUCT_SHORTNAME, BUILD_ID_VAL);
+	       init_utsname()->version, SUSE_PRODUCT_SHORTNAME,
+#ifndef CONFIG_SUSE_KERNEL_RELEASED
+	       " (unreleased)",
+#else
+	       "",
+#endif
+	       BUILD_ID_VAL);
 
 	if (dump_stack_arch_desc_str[0] != '\0')
 		printk("%sHardware name: %s\n",