certs: buffer OpenSSL log output to avoid flooding compile log
Subsystems (2)
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.
Signed-off-by Shivang Upadhyay <[email protected]>
--- certs/Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
certs/Makefile +9 -1
@@ -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