From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iebmq-0007fW-7I for mharc-grub-devel@gnu.org; Tue, 10 Dec 2019 04:26:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60913) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iebmj-0007Yu-I5 for grub-devel@gnu.org; Tue, 10 Dec 2019 04:26:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iebmi-0005kb-9z for grub-devel@gnu.org; Tue, 10 Dec 2019 04:26:25 -0500 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:39585) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iebmi-0005k9-2o for grub-devel@gnu.org; Tue, 10 Dec 2019 04:26:24 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id F114B10C1; Tue, 10 Dec 2019 04:26:22 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 10 Dec 2019 04:26:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=s2V9iQ1+pJUYA FMhoVWbY2YLei9ila2Irdk1sgvpH0E=; b=KAfKqC72vsQig4fqndbWhmGyU/86g U4x4f9PFEPVG8TMIsIYS7jguAkAUo5gtwtlsm0BST6RTYoQQMkQGzdQTrP5V71yN 6yMlvtlrUMk3ghJmd7hpmZvVpCMdkYUpLAo/qX/YXbKl8gZ+w19s/kFKEq9fcRtD V7J50MxsASr3cGDnjQc8VPNN+mzh2eeOltHppAVnGNKVYpKi762y2BK9t54L9/jx H3iuqN6RBXRrPt+EnGLTIYX9KL9RcLG+HR3zchwHfjpmsvPDa+0RRmTsHCrF0VNA 3LTjS9dvsPAKF7FSDW5zGx8+BKuVDpRzn5fvUtp1N65rIDTLlrbqoMCVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=s2V9iQ1+pJUYAFMhoVWbY2YLei9ila2Irdk1sgvpH0E=; b=xxzDYDzM aCCIKOzYEUQNbND2zkrKDmHXHljXQ+Q3vhX0JjmuPe/EEEGPRRIRlT6ZP2CaXoyR j8UIUu4PiUHn8uxP24aketOMEAVAT4wnoNUV19VIuUM0WE5sFmuZ8C3rMI/jnXK9 +i1kSWe3kUl/g0OIShYw6xnzAR1fyeDkAKdApNFauIrAD2sLaA7sM2Vp0Ryz3P2i bjJIdwv4rqm15OVm6x+WzOQSkxVfdQC6g5xLWEMUhkQW84kvr3+BWz+WwinwL+Zc DdxmFRxtOrB23FQcVFOD5JiJ2eGfOtSgMzgHWI1KHabEUoc8VibQEz22pTCyirE3 CK4Ct/L1gIP/3A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudelfedgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucfkphepkeelrdduvd drudeftddrvddtfeenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhen ucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from vm-mail (x590c82cb.dyn.telefonica.de [89.12.130.203]) by mail.messagingengine.com (Postfix) with ESMTPA id D1FA530600A8; Tue, 10 Dec 2019 04:26:21 -0500 (EST) Received: from localhost ( [10.192.0.12]) by vm-mail (OpenSMTPD) with ESMTPSA id 24523aae (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 10 Dec 2019 09:26:20 +0000 (UTC) From: Patrick Steinhardt To: grub-devel@gnu.org Cc: Patrick Steinhardt , Max Tottenham , Daniel Kiper , Daniel Kiper Subject: [PATCH v6 3/6] bootstrap: Add gnulib's base64 module Date: Tue, 10 Dec 2019 10:26:18 +0100 Message-Id: <411a822b458d132f947b160ee727d17d61656c7a.1575969933.git.ps@pks.im> X-Mailer: git-send-email 2.24.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.123.24 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 09:26:27 -0000 The upcoming support for LUKS2 disc encryption requires us to include a parser for base64-encoded data, as it is used to represent salts and digests. As gnulib already has code to decode such data, we can just add it to the boostrapping configuration in order to make it available in GRUB. The gnulib module makes use of booleans via the header. As GRUB does not provide any POSIX wrapper header for this, but instead implements support for `bool` in , we need to patch base64.h to not use anymore. We unfortunately cannot include instead, as it would then use gnulib's internal header while compiling the gnulib object but our own when including it in a GRUB module. Because of this, the patch replaces the include with a direct typedef. A second fix is required to make available `_GL_ATTRIBUTE_CONST`, which is provided by the configure script. As "base64.h" does not include , it is thus not available and results in a compile error. This is fixed by adding an include of . Signed-off-by: Patrick Steinhardt Reviewed-by: Daniel Kiper --- bootstrap.conf | 3 ++- conf/Makefile.extra-dist | 1 + grub-core/lib/gnulib-patches/fix-base64.patch | 23 +++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 grub-core/lib/gnulib-patches/fix-base64.patch diff --git a/bootstrap.conf b/bootstrap.conf index 988dda099..22b908f36 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -23,6 +23,7 @@ GNULIB_REVISION=d271f868a8df9bbec29049d01e056481b7a1a263 # directly. gnulib_modules=" argp + base64 error fnmatch getdelim @@ -78,7 +79,7 @@ cp -a INSTALL INSTALL.grub bootstrap_post_import_hook () { set -e - for patchname in fix-null-deref fix-width no-abort; do + for patchname in fix-base64 fix-null-deref fix-width no-abort; do patch -d grub-core/lib/gnulib -p2 \ < "grub-core/lib/gnulib-patches/$patchname.patch" done diff --git a/conf/Makefile.extra-dist b/conf/Makefile.extra-dist index 46c4e95e2..32b217853 100644 --- a/conf/Makefile.extra-dist +++ b/conf/Makefile.extra-dist @@ -28,6 +28,7 @@ EXTRA_DIST += grub-core/gensymlist.sh EXTRA_DIST += grub-core/genemuinit.sh EXTRA_DIST += grub-core/genemuinitheader.sh +EXTRA_DIST += grub-core/lib/gnulib-patches/fix-base64.patch EXTRA_DIST += grub-core/lib/gnulib-patches/fix-null-deref.patch EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch EXTRA_DIST += grub-core/lib/gnulib-patches/no-abort.patch diff --git a/grub-core/lib/gnulib-patches/fix-base64.patch b/grub-core/lib/gnulib-patches/fix-base64.patch new file mode 100644 index 000000000..e075b6fab --- /dev/null +++ b/grub-core/lib/gnulib-patches/fix-base64.patch @@ -0,0 +1,23 @@ +diff --git a/lib/base64.h b/lib/base64.h +index 9cd0183b8..a2aaa2d4a 100644 +--- a/lib/base64.h ++++ b/lib/base64.h +@@ -18,11 +18,16 @@ + #ifndef BASE64_H + # define BASE64_H + ++/* Get _GL_ATTRIBUTE_CONST */ ++# include ++ + /* Get size_t. */ + # include + +-/* Get bool. */ +-# include ++#ifndef GRUB_POSIX_BOOL_DEFINED ++typedef enum { false = 0, true = 1 } bool; ++#define GRUB_POSIX_BOOL_DEFINED 1 ++#endif + + # ifdef __cplusplus + extern "C" { -- 2.24.0