Skip to contentSkip to conversation

certs: buffer OpenSSL log output to avoid flooding compile log

PATCH New Shivang Upadhyay 1 participant 1 message Nov 19, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 certs: buffer OpenSSL log output to avoid flooding compile log

When running openssl genkey in multithreaded builds, its output can interleave with other compiler messages, making the build log messy and difficult to read.

=== example log ===

	  GENKEY  certs/signing_key.pem
	..+....+..+....+.....+......++++++++++
		<snip/>
	......+...+  CC [M]  sound/core/sound.o
	..+++++

This patch redirects OpenSSL’s output into a temporary file. So the output is grouped and clearly separated from other build messages.

---
 certs/Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
certs/Makefile +9 -1
index f6fa4d8d75e0..f57272b77b36 100644
@@ -47,7 +47,15 @@ keytype-$(CONFIG_MODULE_SIG_KEY_TYPE_ECDSA) := -newkey ec -pkeyopt ec_paramgen_c
 quiet_cmd_gen_key = GENKEY  $@
       cmd_gen_key = openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \
 		-batch -x509 -config $< \
-		-outform PEM -out $@ -keyout $@ $(keytype-y) 2>&1
+		-outform PEM -out $@ -keyout $@ $(keytype-y) 2>&1 |
+		( \
+			openssl_log=$$(mktemp); \
+			cat > $$openssl_log; \
+			printf "    [openssl output]: "; \
+			tr -d '\n' < $$openssl_log; \
+			echo ""; \
+			rm -f $$openssl_log; \
+		)
 
 $(obj)/signing_key.pem: $(obj)/x509.genkey FORCE
 	$(call if_changed,gen_key)
Signature · 1 line
2.51.0