From patchwork Sat Nov 7 14:30:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandy Harris X-Patchwork-Id: 7575581 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A8897C05C6 for ; Sat, 7 Nov 2015 14:31:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C3FA02062E for ; Sat, 7 Nov 2015 14:31:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E737620618 for ; Sat, 7 Nov 2015 14:31:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753625AbbKGObK (ORCPT ); Sat, 7 Nov 2015 09:31:10 -0500 Received: from mail-qg0-f47.google.com ([209.85.192.47]:32824 "EHLO mail-qg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753548AbbKGOaw (ORCPT ); Sat, 7 Nov 2015 09:30:52 -0500 Received: by qgea14 with SMTP id a14so30599477qge.0; Sat, 07 Nov 2015 06:30:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YUvIXcLZQCA9RqL3KT7XHxN3bsiqLqW88EPUpVdnvXg=; b=GQkQBo/iO+lcdD3H40CFNgpPuwZxc+5NHMKFCguXjS5snnC7/W2KgWucvmbWg5efcF ssRRgv8Px2HaN8upqbFh7f0ccLwK3i1AI8yfiCP41VJku2yijaXxTru494s2S7ZIED+A 2NMB6oHQXefCMmWJxwh3jD2y8dYURtzigmymM8Xq2VMwx4KuaF51t40fv5OqRvFd5oO7 erhNYU1IDkxr988rS+Kid+4hjuFqwSpxLoFelsS2oyZmt96bidDEMbpyGcaluVpjVffW QpVS8d9G5+VxHHIY5AYKFyAtXbtHM4PBZXMPwRH7DUS6otX2BkHxw/lt6l7bCp1zGtMz O5VA== X-Received: by 10.140.216.135 with SMTP id m129mr19988292qhb.90.1446906651852; Sat, 07 Nov 2015 06:30:51 -0800 (PST) Received: from Sandy-laptop.hitronhub.home (CPE00fc8d085973-CM00fc8d085970.cpe.net.cable.rogers.com. [99.224.153.28]) by smtp.gmail.com with ESMTPSA id d8sm1367697qgd.34.2015.11.07.06.30.50 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 07 Nov 2015 06:30:51 -0800 (PST) From: Sandy Harris To: "Theodore Ts\\'o" , Jason Cooper , "H. Peter Anvin" , John Denker Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Subject: [PATCH 7/7] Create generated/random_init.h, used by random driver Date: Sat, 7 Nov 2015 09:30:42 -0500 Message-Id: <1446906642-19372-7-git-send-email-sandyinchina@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1446906642-19372-1-git-send-email-sandyinchina@gmail.com> References: <1446906642-19372-1-git-send-email-sandyinchina@gmail.com> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Sandy Harris --- Kbuild | 21 +++++++++++++++++++++ scripts/Makefile | 1 + 2 files changed, 22 insertions(+) diff --git a/Kbuild b/Kbuild index f55cefd..494c665 100644 --- a/Kbuild +++ b/Kbuild @@ -5,6 +5,7 @@ # 2) Generate timeconst.h # 3) Generate asm-offsets.h (may need bounds.h and timeconst.h) # 4) Check for missing system calls +# 5) Generate random_init.h # Default sed regexp - multiline due to syntax constraints define sed-y @@ -98,3 +99,23 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE # Keep these three files during make clean no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file) + +##### +# 5) Generate random_init.h + +ifdef CONFIG_RANDOM_INIT +init-file := include/generated/random_init.h +used-file := scripts/gen_random +source-file := $(used-file).c +always += $(init-file) +targets += $(init-file) +$(init-file) : $(used-file) + $(Q) $(used-file) > $(init-file) +ifdef CONFIG_RANDOM_GCM +$(used-file) : $(source-file) + $(CC) $< -DCONFIG_RANDOM_GCM -o $@ +else +$(used-file) : $(source-file) + $(CC) $< -o $@ +endif +endif diff --git a/scripts/Makefile b/scripts/Makefile index 1b26617..3cea546 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -18,6 +18,7 @@ hostprogs-$(CONFIG_BUILDTIME_EXTABLE_SORT) += sortextable hostprogs-$(CONFIG_ASN1) += asn1_compiler hostprogs-$(CONFIG_MODULE_SIG) += sign-file hostprogs-$(CONFIG_SYSTEM_TRUSTED_KEYRING) += extract-cert +hostprogs-$(CONFIG_RANDOM_INIT) += gen_random HOSTCFLAGS_sortextable.o = -I$(srctree)/tools/include HOSTCFLAGS_asn1_compiler.o = -I$(srctree)/include