]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
swtpm-util: Silence noise from swtpm_setup
authorDaan De Meyer <daan@amutable.com>
Sun, 5 Apr 2026 17:36:14 +0000 (19:36 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 5 Apr 2026 18:34:11 +0000 (20:34 +0200)
There's no way to configure the log level for swtpm_setup, so pipe
it's logfile (which defaults to stderr) to /dev/null unless debug
logging is enabled.

src/shared/swtpm-util.c

index 61413e7226aadb0700fbfc6cdf5ebe6e698be3ad..156a5422df9c5eef4578b328e8f83c65344f6a5b 100644 (file)
@@ -216,6 +216,9 @@ int manufacture_swtpm(const char *state_dir, const char *secret) {
         if (best_profile && strv_extendf(&args, "--profile-name=%s", best_profile) < 0)
                 return log_oom();
 
+        if (!DEBUG_LOGGING && strv_extend_many(&args, "--logfile", "/dev/null") < 0)
+                return log_oom();
+
         if (DEBUG_LOGGING) {
                 _cleanup_free_ char *cmdline = quote_command_line(args, SHELL_ESCAPE_EMPTY);
                 log_debug("About to spawn: %s", strnull(cmdline));