From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1iWcfG-0003Um-Gy for mharc-grub-devel@gnu.org; Mon, 18 Nov 2019 03:45:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:52446) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iWcfD-0003Ta-0d for grub-devel@gnu.org; Mon, 18 Nov 2019 03:45:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iWcfB-0001GP-Rt for grub-devel@gnu.org; Mon, 18 Nov 2019 03:45:38 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42175) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iWcfB-0001FP-Nh for grub-devel@gnu.org; Mon, 18 Nov 2019 03:45:37 -0500 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6356F22483; Mon, 18 Nov 2019 03:45:36 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 18 Nov 2019 03:45:36 -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=R4hFdQ+fbih2v2T9SOqDoi/HqajBy dJOriq8vdh4Nq7jUvEMrnmZ4OR+oBNF0Cd/z8dZHj4lejWi5IFBPB78WmQWTWt8b Q7fURbfZBM1DOPSQURcCJL8FacT6mz0nnW8ZGUj9kFdEzKV5ukWo4g2EsArOmdLw dB+b0GxVCnfigGoB9ke+UFe0hNKVz+p+fFREBVp20e9Y70omTkNSZE7LsrzaYsOV h7O/W5qVZLsBIEXCc3MVzi5+SHlc3+ZVVevjuM7pm8gEQpcAUFYdR7MTIihsRZGN V3BbvtJ0WzQFJcXudI2SA3yzcMlMDWE0iXsywD+LKrRDTANxwL3AbsRzA== 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=T9bvh/vQ kyBrVoGpQfUWyYIjFZ9eFvOnvsWscY9BaYqxtJqfyRKrQD3U832ltJ1EyRwzjAQD ib4NiztnShhgBdEKiWzFEjET7K3qeFu8Ze3AZrQjAINcumv8TRoGDFG1VxqNxy9h 74iGUtaUyFSdT1aUSdo8PW1HKdNSZyqTSGs4mlbdnLbAyGqBQ+lMXyKL7ytksebL H8UU7LT0lalTs0RRSYVuvzJ8IBOAQaU/8i6BVEwMbhBLhWRtW8VpLI0x1c/MAHpa itnMRSa/atQDbujxYIewZJwS4CKovF1lE/tKkLql1SaQpQdHyg5tL4ZrtlZ/PPar 78OdaKYeoQt/AA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudeggedguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomheprfgrthhr ihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimheqnecukfhppeekledrud egrddvvdelrddukedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm necuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from NSJAIL (x590ee5b5.dyn.telefonica.de [89.14.229.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 8404B3060061; Mon, 18 Nov 2019 03:45:35 -0500 (EST) Received: from localhost ( [10.192.0.11]) by NSJAIL (OpenSMTPD) with ESMTPSA id 95fabb67 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 18 Nov 2019 08:45:32 +0000 (UTC) From: Patrick Steinhardt To: grub-devel@gnu.org Cc: Patrick Steinhardt , Max Tottenham , Daniel Kiper , Daniel Kiper Subject: [PATCH v4 3/6] bootstrap: Add gnulib's base64 module Date: Mon, 18 Nov 2019 09:45:14 +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: Mon, 18 Nov 2019 08:45:40 -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