From: Shivang Upadhyay <shivangu@linux.ibm.com>
To: keyrings@vger.kernel.org
Cc: shivangu@linux.ibm.com, sourabhjain@linux.ibm.com,
dhowells@redhat.com, dwmw2@infradead.org
Subject: [PATCH] certs: buffer OpenSSL log output to avoid flooding compile log
Date: Wed, 19 Nov 2025 16:40:51 +0530 [thread overview]
Message-ID: <20251119111052.26718-1-shivangu@linux.ibm.com> (raw)
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 <shivangu@linux.ibm.com>
---
certs/Makefile | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/certs/Makefile b/certs/Makefile
index f6fa4d8d75e0..f57272b77b36 100644
--- a/certs/Makefile
+++ b/certs/Makefile
@@ -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)
--
2.51.0
reply other threads:[~2025-11-19 11:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251119111052.26718-1-shivangu@linux.ibm.com \
--to=shivangu@linux.ibm.com \
--cc=dhowells@redhat.com \
--cc=dwmw2@infradead.org \
--cc=keyrings@vger.kernel.org \
--cc=sourabhjain@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).