From patchwork Thu Feb 25 16:31:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102682 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp254446lbc; Thu, 25 Feb 2016 08:33:10 -0800 (PST) X-Received: by 10.98.40.200 with SMTP id o191mr64399446pfo.83.1456417989947; Thu, 25 Feb 2016 08:33:09 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h78si13454314pfj.67.2016.02.25.08.33.09; Thu, 25 Feb 2016 08:33:09 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760908AbcBYQdH (ORCPT + 30 others); Thu, 25 Feb 2016 11:33:07 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:56677 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760641AbcBYQcv (ORCPT ); Thu, 25 Feb 2016 11:32:51 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue005) with ESMTPA (Nemesis) id 0M9L3K-1adsuE3cB4-00CiQP; Thu, 25 Feb 2016 17:31:44 +0100 From: Arnd Bergmann To: David Howells , David Woodhouse Cc: linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, Michal Marek , Arnd Bergmann , keyrings@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] modsign: hide openssl output in silent builds Date: Thu, 25 Feb 2016 17:31:32 +0100 Message-Id: <1456417901-2192433-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:CkqB/yKryk1lQsKpOUdN9W6XUNeC2EpHKzlJExbrHCXS0qo8/78 yaba2nlNLOQlm2IpTNcN6MeHiGJwWmI242LOt4akfwAjQwwMmpOtWppjeBmxpFZ6/IeDk+t GZHn6K9097XMBWbEdkFVimeWlRnuKKW5/Tm9rYvQzXrKPmGN6/X0ahi954cigSidohuzZPP TpF2Af08u2dBEUTPSGJsw== X-UI-Out-Filterresults: notjunk:1; V01:K0:W45TFi3e0bs=:Mwithr5Pq9Xlsz3gLDOCCH G/b1CPWbf0lLI8Z5v9rMy2HVacd8quTmcMQEdb9yqDxo46FIMeTc1NQ8IvEMx6UX6XNSpOFxL yeaMF/SlKcJhRHnAB/p5aA4MGZipmTGrfH9gifiI3IzCK3cf1XP0ZEl1JPUVrpGZtR7GsmuEY 9ZSsLNyu17A0Lelxmru9AsTJVcw09/TwqyNs4hwTQdKOnCQZENkl3NdEJ97EuZqM6aSpp+gle PGvS2Yv8glPbkcXT62KeXVzaShIsrNLXgWydoNVduNmoVW1LBIhNeoxCctGzS+O7dW1RunpDP O15PharkHkUnNKDcy9ZwnzQ3bRxOVa94oBB7re5RDbYT2UQRTg6ZzO96yIa+1u8pYnH//eZ8a OkzOTUuZ4Nnp0525QwvufymjFfbvDUP0w4l2GWIBkFnGkN3C9V3aJW9movHTJAEVqXHngYm7M TMBUe0dTCd6eWr85Z0ECxMNe83XxoI88Fyq0ORZ/pWaxR9WY8bH1POpbPf9LRWtuFOYEpW/w4 CN4fKp2iIp2+OM9Gi05GKdD8RyHPIdvnb85JQ6qEd7XO704kbdWQnZ6Xfae4PRDetLHjTM6tL LXaayhCd/63oi6K0ehU4CAo8I45u/Y990LqFKfdOigsWhAGpSIbVZKub3CPh3mCu9fTn4CMLh Uv76MQFbAF2TplCUffSdzzaYmKNtdC64GKPKRwuweLFsGFqE8oRJsYOu+9mAX4Peywxs= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a user calls 'make -s', we can assume they don't want to see any output except for warnings and errors, but instead they see this for a warning free build: ### ### Now generating an X.509 key pair to be used for signing modules. ### ### If this takes a long time, you might wish to run rngd in the ### background to keep the supply of entropy topped up. It ### needs to be run as root, and uses a hardware random ### number generator if one is available. ### Generating a 4096 bit RSA private key .................................................................................................................................................................................................................................++ ..............................................................................................................................++ writing new private key to 'certs/signing_key.pem' ----- ### ### Key pair generated. ### The output can confuse simple build testing scripts that just check for an empty build log. This patch silences all the output: - "echo" is changed to "@$(kecho)", which is dropped when "-s" gets passed - the openssl command itself is only printed with V=1, using the $(Q) macro - The output of openssl gets redircted to /dev/null on "-s" builds. Signed-off-by: Arnd Bergmann --- certs/Makefile | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) -- 2.7.0 diff --git a/certs/Makefile b/certs/Makefile index 28ac694dd11a..2773c4afa24c 100644 --- a/certs/Makefile +++ b/certs/Makefile @@ -36,29 +36,34 @@ ifndef CONFIG_MODULE_SIG_HASH $(error Could not determine digest type to use from kernel config) endif +redirect_openssl = 2>&1 +quiet_redirect_openssl = 2>&1 +silent_redirect_openssl = 2>/dev/null + # We do it this way rather than having a boolean option for enabling an # external private key, because 'make randconfig' might enable such a # boolean option and we unfortunately can't make it depend on !RANDCONFIG. ifeq ($(CONFIG_MODULE_SIG_KEY),"certs/signing_key.pem") $(obj)/signing_key.pem: $(obj)/x509.genkey - @echo "###" - @echo "### Now generating an X.509 key pair to be used for signing modules." - @echo "###" - @echo "### If this takes a long time, you might wish to run rngd in the" - @echo "### background to keep the supply of entropy topped up. It" - @echo "### needs to be run as root, and uses a hardware random" - @echo "### number generator if one is available." - @echo "###" - openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \ + @$(kecho) "###" + @$(kecho) "### Now generating an X.509 key pair to be used for signing modules." + @$(kecho) "###" + @$(kecho) "### If this takes a long time, you might wish to run rngd in the" + @$(kecho) "### background to keep the supply of entropy topped up. It" + @$(kecho) "### needs to be run as root, and uses a hardware random" + @$(kecho) "### number generator if one is available." + @$(kecho) "###" + $(Q)openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \ -batch -x509 -config $(obj)/x509.genkey \ -outform PEM -out $(obj)/signing_key.pem \ - -keyout $(obj)/signing_key.pem 2>&1 - @echo "###" - @echo "### Key pair generated." - @echo "###" + -keyout $(obj)/signing_key.pem \ + $($(quiet)redirect_openssl) + @$(kecho) "###" + @$(kecho) "### Key pair generated." + @$(kecho) "###" $(obj)/x509.genkey: - @echo Generating X.509 key generation config + @$(kecho) Generating X.509 key generation config @echo >$@ "[ req ]" @echo >>$@ "default_bits = 4096" @echo >>$@ "distinguished_name = req_distinguished_name"