Revert "[DNM] [TMP] HACK: Disable log level from being set"
authorNolen Johnson <johnsonnolen@gmail.com>
Mon, 10 Jul 2023 00:44:39 +0000 (20:44 -0400)
committerNolen Johnson <johnsonnolen@gmail.com>
Mon, 10 Jul 2023 00:45:04 +0000 (20:45 -0400)
This reverts commit 698e5846f704891f3e704989a268ed3ab3d9f463.

Reason: Pushed with the merge - whoops.
Change-Id: I8b786467483492e7b5a416b44d929ad21b5e1163

init/main.c

index 0adbbf79d961271fe40badb67087e6387911b2da..cc8df92d7206c78d3b2be6b7e144aebab48f561e 100644 (file)
@@ -216,6 +216,25 @@ static int __init quiet_kernel(char *str)
 early_param("debug", debug_kernel);
 early_param("quiet", quiet_kernel);
 
+static int __init loglevel(char *str)
+{
+       int newlevel;
+
+       /*
+        * Only update loglevel value when a correct setting was passed,
+        * to prevent blind crashes (when loglevel being set to 0) that
+        * are quite hard to debug
+        */
+       if (get_option(&str, &newlevel)) {
+               console_loglevel = newlevel;
+               return 0;
+       }
+
+       return -EINVAL;
+}
+
+early_param("loglevel", loglevel);
+
 /* Change NUL term back to "=", to make "param" the whole string. */
 static int __init repair_env_string(char *param, char *val,
                                    const char *unused, void *arg)