From 9bd7c48d8abb0f31ab47b0056de56e69e9f7fea3 Mon Sep 17 00:00:00 2001 From: Nolen Johnson Date: Sun, 9 Jul 2023 20:44:39 -0400 Subject: [PATCH] Revert "[DNM] [TMP] HACK: Disable log level from being set" This reverts commit 698e5846f704891f3e704989a268ed3ab3d9f463. Reason: Pushed with the merge - whoops. Change-Id: I8b786467483492e7b5a416b44d929ad21b5e1163 --- init/main.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/init/main.c b/init/main.c index 0adbbf79d961..cc8df92d7206 100644 --- a/init/main.c +++ b/init/main.c @@ -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) -- 2.20.1