From: Felix Pehla <29adc1fd92@gmail.com> Date: Tue, 26 Aug 2025 18:13:00 +0000 (+0200) Subject: sd-boot: allow setting the log level through loader.conf X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F38701%2Fhead;p=thirdparty%2Fsystemd.git sd-boot: allow setting the log level through loader.conf Allow configuring the log level used by sd-boot by setting `log-level=` in loader.conf. `info` is used by default. --- diff --git a/man/loader.conf.xml b/man/loader.conf.xml index 1a90e15ffac..0d12b1e8743 100644 --- a/man/loader.conf.xml +++ b/man/loader.conf.xml @@ -480,6 +480,28 @@ sbvarsign --attr "${attr}" --key KEK.key --cert KEK.pem --output db.auth db db.e + + + log-level + + Controls the log level used by + systemd-boot7. + + + Valid values are emerg, alert, crit, + err, warning, notice, + info, and debug. + + If unspecified, info will be used, unless one has already been configured + via an SMBIOS Type 11 string, see + smbios-type-117. + + + Note that the configured level will only be used after loader.conf has + been parsed, so log messages generated before that point may be unaffected by this setting. + + + diff --git a/src/boot/boot.c b/src/boot/boot.c index 3ac59866aa1..abf7693a360 100644 --- a/src/boot/boot.c +++ b/src/boot/boot.c @@ -1113,6 +1113,9 @@ static void config_defaults_load_from_file(Config *config, char *content) { } config->console_mode = u; } + } else if (streq8(key, "log-level")) { + if (log_set_max_level_from_string(value) < 0) + log_error("Error parsing 'log-level' config option, ignoring: %s", value); } }