boot/grub2: add option to install tools
authorErico Nunes <nunes.erico@gmail.com>
Wed, 26 Sep 2018 22:37:16 +0000 (00:37 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 26 Nov 2018 19:59:33 +0000 (20:59 +0100)
Add an option to install grub2 support tools to the target.

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

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
boot/grub2/Config.in
boot/grub2/grub2.mk
support/scripts/check-bin-arch

index 9a61b3b63366c3921d6f914d847e70a1682842c1..e33d24f62f53335ba527752d6f464b66612eb304 100644 (file)
@@ -76,6 +76,15 @@ config BR2_TARGET_GRUB2_BUILTIN_CONFIG
          device and other configuration parameters, but however menu
          entries cannot be described in this embedded configuration.
 
+config BR2_TARGET_GRUB2_INSTALL_TOOLS
+       bool "install tools"
+       help
+         Install support tools to interact with GNU GRUB Multiboot
+         boot loader.
+
+         This will also install the Grub 2 loadable modules to the
+         target.
+
 endif # BR2_TARGET_GRUB2
 
 comment "grub2 needs a toolchain w/ wchar"
index 1b366d04077618336478bb2bf91ea3faca391508..bb678ef5de26da19821f57227b71771ac56906ce 100644 (file)
@@ -12,7 +12,12 @@ GRUB2_LICENSE_FILES = COPYING
 GRUB2_DEPENDENCIES = host-bison host-flex host-grub2
 HOST_GRUB2_DEPENDENCIES = host-bison host-flex
 GRUB2_INSTALL_IMAGES = YES
+
+ifeq ($(BR2_TARGET_GRUB2_INSTALL_TOOLS),y)
+GRUB2_INSTALL_TARGET = YES
+else
 GRUB2_INSTALL_TARGET = NO
+endif
 
 GRUB2_BUILTIN_MODULES = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_MODULES))
 GRUB2_BUILTIN_CONFIG = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_CONFIG))
index 7f97696735c847c45c443642583d932268ded487..66b8d8993234917083c9dbe6a2b867558ea66216 100755 (executable)
@@ -20,6 +20,10 @@ declare -a IGNORES=(
        # pru-software-support) legitimately install ELF binaries that
        # are not for the target architecture
        "/usr/share"
+
+       # Skip files in /lib/grub, since it is possible to have it
+       # for a different architecture (e.g. i386 grub on x86_64).
+       "/lib/grub"
 )
 
 while getopts p:l:r:a:i: OPT ; do