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 ++++
 kernel/printk/printk.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
@@ -213,6 +213,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";
@@ -224,6 +225,9 @@ const char *supported_printable(int tain
 		return "Yes, External";
 	else
 		return "Yes";
+#else
+		return "No, Unreleased kernel";
+#endif
 }
 
 static ssize_t supported_show(struct kobject *kobj,
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3274,11 +3274,17 @@ void __init dump_stack_set_arch_desc(con
  */
 void dump_stack_print_info(const char *log_lvl)
 {
-	printk("%sCPU: %d PID: %d Comm: %.20s %s %s %.*s %s\n",
+	printk("%sCPU: %d PID: %d Comm: %.20s %s %s %.*s %s%s\n",
 	       log_lvl, raw_smp_processor_id(), current->pid, current->comm,
 	       print_tainted(), init_utsname()->release,
 	       (int)strcspn(init_utsname()->version, " "),
-	       init_utsname()->version, SUSE_PRODUCT_SHORTNAME);
+	       init_utsname()->version, SUSE_PRODUCT_SHORTNAME,
+#ifndef CONFIG_SUSE_KERNEL_RELEASED
+	       " (unreleased)"
+#else
+	       ""
+#endif
+	);
 
 	if (dump_stack_arch_desc_str[0] != '\0')
 		printk("%sHardware name: %s\n",