nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone

Blame SOURCES/0189-libtasn1-compile-into-asn1-module.patch

8e15ce
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8e15ce
From: Daniel Axtens <dja@axtens.net>
8e15ce
Date: Fri, 5 Jun 2020 17:47:25 +1000
8e15ce
Subject: [PATCH] libtasn1: compile into asn1 module
8e15ce
8e15ce
Create a wrapper file that specifies the module license.
8e15ce
Set up the makefile so it is built.
8e15ce
8e15ce
Signed-off-by: Daniel Axtens <dja@axtens.net>
8e15ce
---
8e15ce
 grub-core/Makefile.core.def        | 15 +++++++++++++++
8e15ce
 grub-core/lib/libtasn1_wrap/wrap.c | 26 ++++++++++++++++++++++++++
8e15ce
 2 files changed, 41 insertions(+)
8e15ce
 create mode 100644 grub-core/lib/libtasn1_wrap/wrap.c
8e15ce
8e15ce
diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
8e15ce
index 97347ae76f9..21d2c541850 100644
8e15ce
--- a/grub-core/Makefile.core.def
8e15ce
+++ b/grub-core/Makefile.core.def
8e15ce
@@ -2576,3 +2576,18 @@ module = {
8e15ce
   common = commands/i386/wrmsr.c;
8e15ce
   enable = x86;
8e15ce
 };
8e15ce
+
8e15ce
+module = {
8e15ce
+  name = asn1;
8e15ce
+  common = lib/libtasn1/lib/decoding.c;
8e15ce
+  common = lib/libtasn1/lib/coding.c;
8e15ce
+  common = lib/libtasn1/lib/element.c;
8e15ce
+  common = lib/libtasn1/lib/structure.c;
8e15ce
+  common = lib/libtasn1/lib/parser_aux.c;
8e15ce
+  common = lib/libtasn1/lib/gstr.c;
8e15ce
+  common = lib/libtasn1/lib/errors.c;
8e15ce
+  common = lib/libtasn1_wrap/wrap.c;
8e15ce
+  cflags = '$(CFLAGS_POSIX) $(CFLAGS_GNULIB)';
8e15ce
+  // -Wno-type-limits comes from libtasn1's configure.ac
8e15ce
+  cppflags = '$(CPPFLAGS_POSIX) $(CPPFLAGS_GNULIB) -I$(srcdir)/lib/libtasn1/lib -Wno-type-limits';
8e15ce
+};
8e15ce
diff --git a/grub-core/lib/libtasn1_wrap/wrap.c b/grub-core/lib/libtasn1_wrap/wrap.c
8e15ce
new file mode 100644
8e15ce
index 00000000000..622ba942e33
8e15ce
--- /dev/null
8e15ce
+++ b/grub-core/lib/libtasn1_wrap/wrap.c
8e15ce
@@ -0,0 +1,26 @@
8e15ce
+/*
8e15ce
+ *  GRUB  --  GRand Unified Bootloader
8e15ce
+ *  Copyright (C) 2020 IBM Corporation
8e15ce
+ *
8e15ce
+ *  GRUB is free software: you can redistribute it and/or modify
8e15ce
+ *  it under the terms of the GNU General Public License as published by
8e15ce
+ *  the Free Software Foundation, either version 3 of the License, or
8e15ce
+ *  (at your option) any later version.
8e15ce
+ *
8e15ce
+ *  GRUB is distributed in the hope that it will be useful,
8e15ce
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
8e15ce
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
8e15ce
+ *  GNU General Public License for more details.
8e15ce
+ *
8e15ce
+ *  You should have received a copy of the GNU General Public License
8e15ce
+ *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
8e15ce
+ */
8e15ce
+
8e15ce
+#include <grub/dl.h>
8e15ce
+
8e15ce
+/*
8e15ce
+ * libtasn1 is provided under LGPL2.1+, which is compatible
8e15ce
+ * with GPL3+. As Grub as a whole is under GPL3+, this module
8e15ce
+ * is therefore under GPL3+ also.
8e15ce
+ */
8e15ce
+GRUB_MOD_LICENSE ("GPLv3+");