grub2-tools: new package

Support tools to interact with GNU GRUB Multiboot boot loader.

In the context of Buildroot, some useful target tools provided by
grub2-tools are grub2-editenv, grub2-reboot, which provide means to
manage the Grub 2 environment, boot order, and others.

This package is also meant as a preparation step to be turned into a
host-package later and help decouple the target and host portions of the
actual Grub 2 boot loader package.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Downloaded from: https://patchwork.ozlabs.org/patch/755651/
Reviewed-by: Miroslav Mareš <mmares@cesnet.cz>

Change-Id: Ic91591b584c832c936b49af76f1f56fd7c6cf5ad
diff --git a/package/grub2-tools/grub2-tools.mk b/package/grub2-tools/grub2-tools.mk
new file mode 100644
index 0000000..440a2bc
--- /dev/null
+++ b/package/grub2-tools/grub2-tools.mk
@@ -0,0 +1,33 @@
+################################################################################
+#
+# grub2-tools
+#
+################################################################################
+
+GRUB2_TOOLS_VERSION = 2.02
+GRUB2_TOOLS_SITE = http://ftp.gnu.org/gnu/grub
+GRUB2_TOOLS_SOURCE = grub-$(GRUB2_VERSION).tar.xz
+GRUB2_TOOLS_LICENSE = GPLv3+
+GRUB2_TOOLS_LICENSE_FILES = COPYING
+GRUB2_TOOLS_DEPENDENCIES = host-bison host-flex
+
+GRUB2_TOOLS_CONF_ENV = \
+	CPP="$(TARGET_CC) -E" \
+	TARGET_CC="$(TARGET_CC)" \
+	TARGET_CFLAGS="$(TARGET_CFLAGS) -fno-stack-protector" \
+	TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \
+	TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
+	TARGET_NM="$(TARGET_NM)" \
+	TARGET_OBJCOPY="$(TARGET_OBJCOPY)" \
+	TARGET_STRIP="$(TARGET_CROSS)strip"
+
+GRUB2_TOOLS_CONF_OPTS = \
+	--disable-grub-mkfont \
+	--enable-efiemu=no \
+	ac_cv_lib_lzma_lzma_code=no \
+	--enable-device-mapper=no \
+	--enable-libzfs=no \
+	--disable-werror \
+	--with-platform=none
+
+$(eval $(autotools-package))