From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iaaGR-0000pf-R9 for mharc-grub-devel@gnu.org; Fri, 29 Nov 2019 02:00:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53879) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaaGA-0000W3-KG for grub-devel@gnu.org; Fri, 29 Nov 2019 02:00:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iaa8F-0007py-TR for grub-devel@gnu.org; Fri, 29 Nov 2019 01:52:01 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:40113) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iaa8F-0007ed-Ox for grub-devel@gnu.org; Fri, 29 Nov 2019 01:51:59 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 653F7227D4; Fri, 29 Nov 2019 01:51:56 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 29 Nov 2019 01:51:56 -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=UBkZ6nM3eHXMJCIc2Xj/DiHjUu3zS 2kUmqvJ3EXga9LC1PaP+rrjSBrZ8YvJFSv8kGn9XdR8+gJDvwC/qSpAZeRlRAWTy uwYH6IyKkm+VbUuzdm71a/Em5wnJ2TNz1om9i74n7DlcXwICC8IofORZJkKK1ovC V74UFFY/FC/dEhqM/aP0lZck1DWeo8mHoVB6O2OHYbsRREX571f2aEn6gtoFTHYl LwRuS0orPufw/l/vP9A1CqufUH3NqdqKU1H1Wcw2vP63QSNIMI/LN6ovRCqiCLgd uDvotKIZ2QpvKoptgdCLQKqtDxqTSChG4mK3I4KrpervYZdQvDrUvqdrA== 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=GnXT/0O1 whn5goSua8q87re56UZgWmyKtnMGpxcK/V5dlpxCQc1mOWH3g3Ump+uYtEXpfL+C OPCw2bmvf6fmAqige5+epZEUKlRmywOHCsn+iXtOH17UYijkkf9GlUCCJuuUp48W Bbsp3PrkFZ5jNRE90h4gTeNHBPea9K0kKzGSu9T3A1imocU5i3FXUIe30xeH2wty wBf5wHQ5Rz1cWPB235/Tk+Su/TmYiEuPjlkWKZsIPAKSWUCaPxgW5vKUCSel2ShX GgvKapv4lXu+z/kHEOJvDF7HGI/Xsh0Dh4pjWc0FPSZFdCJdS7TDL+VGNBl29bxz Ts40YWgGLrHGKg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeikedguddttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecukfhppeejkedrhe ehrddvvdehrddvfeehnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm necuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from NSJAIL (x4e37e1eb.dyn.telefonica.de [78.55.225.235]) by mail.messagingengine.com (Postfix) with ESMTPA id 7EB773060069; Fri, 29 Nov 2019 01:51:55 -0500 (EST) Received: from localhost ( [10.192.0.11]) by NSJAIL (OpenSMTPD) with ESMTPSA id 3aa45b22 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 29 Nov 2019 06:51:52 +0000 (UTC) From: Patrick Steinhardt To: grub-devel@gnu.org Cc: Patrick Steinhardt , Max Tottenham , Daniel Kiper , Daniel Kiper Subject: [PATCH v5 3/6] bootstrap: Add gnulib's base64 module Date: Fri, 29 Nov 2019 07:51:47 +0100 Message-Id: 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: 66.111.4.28 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: Fri, 29 Nov 2019 07:00: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