diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2022-12-23 01:25:33 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2023-01-22 23:43:32 +0900 |
commit | c0d3b83100c896e1b0909023df58a0ebdd428d61 (patch) | |
tree | b98004e9534c5573f04795e27957affb4cf857fc /certs/extract-cert.c | |
parent | 8962b6b475bddc011c414f40ffd02f0ed4e02771 (diff) | |
download | lwn-c0d3b83100c896e1b0909023df58a0ebdd428d61.tar.gz lwn-c0d3b83100c896e1b0909023df58a0ebdd428d61.zip |
kbuild: do not print extra logs for V=2
Some scripts increase the verbose level when V=1, but others when
not V=0.
I think the former is correct because V=2 is not a log level but
a switch to print the reason for rebuilding.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Diffstat (limited to 'certs/extract-cert.c')
-rw-r--r-- | certs/extract-cert.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/certs/extract-cert.c b/certs/extract-cert.c index 8c1fb9a70d66..70e9ec89d87d 100644 --- a/certs/extract-cert.c +++ b/certs/extract-cert.c @@ -78,7 +78,7 @@ static void drain_openssl_errors(void) static const char *key_pass; static BIO *wb; static char *cert_dst; -static int kbuild_verbose; +static bool verbose; static void write_cert(X509 *x509) { @@ -90,19 +90,22 @@ static void write_cert(X509 *x509) } X509_NAME_oneline(X509_get_subject_name(x509), buf, sizeof(buf)); ERR(!i2d_X509_bio(wb, x509), "%s", cert_dst); - if (kbuild_verbose) + if (verbose) fprintf(stderr, "Extracted cert: %s\n", buf); } int main(int argc, char **argv) { char *cert_src; + char *verbose_env; OpenSSL_add_all_algorithms(); ERR_load_crypto_strings(); ERR_clear_error(); - kbuild_verbose = atoi(getenv("KBUILD_VERBOSE")?:"0"); + verbose_env = getenv("KBUILD_VERBOSE"); + if (verbose_env && strchr(verbose_env, '1')) + verbose = true; key_pass = getenv("KBUILD_SIGN_PIN"); |