Received: by 10.223.185.116 with SMTP id b49csp1128903wrg; Fri, 23 Feb 2018 12:26:22 -0800 (PST) X-Google-Smtp-Source: AH8x224lz7ryLcVwFXeMH9JagKqW6xbcdnzmII7yT4MuTiGplhbVfjADHB/p2Hjsxkeq/KvKZHCT X-Received: by 10.98.198.156 with SMTP id x28mr2903968pfk.22.1519417582498; Fri, 23 Feb 2018 12:26:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519417582; cv=none; d=google.com; s=arc-20160816; b=VGO90FjwyZIBr3uplMrCb4F3D/fSbPxfDS8iZ3bbgbxgx0kc7QfQWddiwjxEMJaYkc /5Kb/cO80bQwmL26GamM0G8h/DcZqZ/dNyqUFBZ6QyWRM/taWKvRld3YndRA+37h8+s+ TAoGsq+HYtjyp+CBMBeI1+kuklarTOgHGiQv0P0mgbXRD726f+f1w3QLuZwjoo1cEjRu IYWb5pO/FR5XWkHLt45mJJH2Eg8x/oykP77HFBjKCB1B316H2Yr3HdZ6ckuzW7ZEs+DA sb53zRP7gyd7VFxMoAfK4/Rsv9VIyonQiWq7/5o4nfg/9KNioMT4uM6SYqgUjnluVU99 rXAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+tMHpoDDE11nDeeqfBnSjKeQ3wKNGdtdd2wg+qNpGJ4=; b=fKsm5jWAW8AzNacr6zTluDfYobv1Z6j941uBWE3HBYIVd65xoBh9CQcHVmCeTrCA4V OX/IYl8PywQ/zeLrHe+15npwj26RpDpCpUjU/PdFmBKqat56RDvq1M5dMQW25aYC4Q+a fxKFBfqiC/Ub7FO6XjfaNNYv2tZQpNaYVO8rqWG1ZZBDqJ2hP9NjynBu0JByX9THL1bN kCS60bksY8h80JP1Tiil9PZo5A5HtYEwtwMrGVp9evFuNL915shfCnLHlgd3chW9Db70 nqL3Ux6vaoJBPFhQRAlyP5iv6pm6c4IVIL5BKPuwhN/l0U7FK2ovHeNTmNLHGgTbNtdL epuA== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b81si2309624pfj.331.2018.02.23.12.26.07; Fri, 23 Feb 2018 12:26:22 -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 S1754341AbeBWUZD (ORCPT + 99 others); Fri, 23 Feb 2018 15:25:03 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38796 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932226AbeBWShr (ORCPT ); Fri, 23 Feb 2018 13:37:47 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id AA050BBF; Fri, 23 Feb 2018 18:37:46 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , David Howells Subject: [PATCH 4.4 109/193] modsign: hide openssl output in silent builds Date: Fri, 23 Feb 2018 19:25:42 +0100 Message-Id: <20180223170343.002218818@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit 5d06ee20b662a78417245714fc576cba90e6374f upstream. 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 redirected to /dev/null on "-s" builds. Signed-off-by: Arnd Bergmann Signed-off-by: David Howells Signed-off-by: Greg Kroah-Hartman --- certs/Makefile | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) --- 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"