* [Buildroot] [PATCH v2 0/8] grub2: bump and add support for arm and aarch64
@ 2017-04-26 21:39 Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 1/8] grub2: bump up version Erico Nunes
` (7 more replies)
0 siblings, 8 replies; 14+ messages in thread
From: Erico Nunes @ 2017-04-26 21:39 UTC (permalink / raw)
To: buildroot
This patch series bumps Grub 2 to the latest and recent release
(finally) and performs some changes to the package (notably the split
into grub2 and grub2-tools) to enable arm and aarch64 support in it.
Some significant effort was put into figuring how to make this all work.
Unfortunately, not a lot of documentation or examples are available on
the subject.
Initial encouragement that this might be possible with Buildroot targets
came from [1].
Grub 2 for arm/aarch64 can be used either in a uboot platform or efi
platform.
As a uboot platform, Grub 2 image gets built as a u-boot image (i.e. output
from u-boot mkimage) and is booted in u-boot through a regular "bootm". The
only requirement from u-boot side in order to allow this is that u-boot is
built with CONFIG_API enabled. CONFIG_API is not enabled by default in most
in-tree configurations, however, it is available for quite some time now. So it
may be possible to use this even on older u-boot versions.
This is available only for arm (32-bit).
As an efi platform, Grub 2 gets built as an EFI executable. This allows
EFI firmware to find and load it similarly as it can be done for x86_64.
It is possible to run aarch64 EFI firmware in qemu [2] and load Grub 2
to test it this way (I have actually used the aarch64 firmware
distributed with edk2-aarch64 from Fedora).
Also, there is a very cool recent u-boot feature which allows u-boot to
load and boot an EFI executable - bootefi [3] - so the Grub 2 efi
platform can also be used from u-boot in recent versions. This has been
released only in u-boot v2016.05 and is enabled (mostly) by default for
arm u-boot.
efi platform is available for both arm and aarch64.
After enabling support for these Grub 2 platform in Buildroot, I have
tested them (and found to work) in the following environments:
arm-uboot:
- qemu arm vexpress, loaded through u-boot bootm as in [1], no patches
necessary.
- BeagleBone, loaded through u-boot bootm (worked after a small patch I
crafted for Grub 2 which I hope to sort out with upstream, possibly
platform specific).
arm-efi:
- BeagleBone, with u-boot v2016.05, loaded through u-boot bootefi as in
[3], no patches necessary.
aarch64-efi:
- qemu aarch64 virt, using EDK II firmware for aarch64, Grub 2 loaded
through usual UEFI path, no patches necessary.
- Odroid-C2, aarch64, using an upstream u-boot and upstream v4.11-rc8
kernel, with Grub 2 loaded through u-boot bootefi as in [3].
I have also verified that pc_x86_64_bios_defconfig and
pc_x86_64_efi_defconfig build and boot correctly with Grub 2 without
modifications after applying this patch series.
During development, I split the grub2 package into (host-)grub2-tools
and grub2. Since v1 I was having trouble in trying to make the existing
grub2 package work for arm, getting some weird relocation errors when
executing it on the target, despite it working as expected by manually
following [1] with recent grub2 and u-boot versions. I tracked it down
as much as to be something related to the use of $(HOST_CONFIGURE_OPTS)
in GRUB2_CONF_ENV, but didn't find the exact cause.
By spliting the packages into a host and target version, the errors
ceased, it also made the grub2 recipe clearer (less confusion about
mixed host/target build variables) and we also get the added benefit of
enabling grub2-tools to be built for the target. It is interesting to
have it in the target for tools such as grub2-reboot.
(I didn't actually spend more time on this for v2 as the split seems to
make much more sense anyway).
Changes v1 -> v2:
- Update to the 2.02 release, this settles the questions about using
git master or a beta release, as it is now an official release.
- Moved the grub2 additional documentation from its Config.in to a
readme.txt in the package directory as it was discussed in v1.
- Added grub2 extra documentation for arm and aarch64.
- Fixed small bugs such as the lack of depends on wchar.
- Re-tested everything, including pc_* defconfigs, except BeagleBone
(lots of extra work, not my primary target, and nothing changed on the
arm-efi part).
Odroid-C2 works much more nicely with u-boot bootefi + grub2
aarch64-efi now that it has better u-boot/kernel upstream support.
- The Image.gz format for linux aarch64.
[1] https://www.hellion.org.uk/blog/posts/grub-on-uboot-on-qemu/
[2] https://www.kraxel.org/repos/jenkins/edk2/
[3] https://www.youtube.com/watch?v=bNL1pd-rwCU
Erico Nunes (8):
grub2: bump up version
grub2-tools: new package
grub2: use grub2-tools as a host package
grub2: enable support for arm and aarch64 targets
grub2: introduce BR2_TARGET_GRUB2_CFG
grub2: move usage notes to package readme.txt
grub2: add usage notes for Grub 2 ARM and aarch64
linux: new Image.gz format for aarch64
DEVELOPERS | 1 +
boot/grub2/0001-remove-gets.patch | 21 --
...ettext-gettext.c-main_context-secondary_c.patch | 39 ----
boot/grub2/Config.in | 152 +++++---------
boot/grub2/grub2.hash | 4 +-
boot/grub2/grub2.mk | 62 +++---
boot/grub2/readme.txt | 231 +++++++++++++++++++++
linux/Config.in | 4 +
linux/linux.mk | 2 +
package/Config.in | 1 +
package/grub2-tools/Config.in | 10 +
package/grub2-tools/grub2-tools.hash | 2 +
package/grub2-tools/grub2-tools.mk | 39 ++++
13 files changed, 378 insertions(+), 190 deletions(-)
delete mode 100644 boot/grub2/0001-remove-gets.patch
delete mode 100644 boot/grub2/0002-grub-core-gettext-gettext.c-main_context-secondary_c.patch
create mode 100644 boot/grub2/readme.txt
create mode 100644 package/grub2-tools/Config.in
create mode 100644 package/grub2-tools/grub2-tools.hash
create mode 100644 package/grub2-tools/grub2-tools.mk
--
2.9.3
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 1/8] grub2: bump up version
2017-04-26 21:39 [Buildroot] [PATCH v2 0/8] grub2: bump and add support for arm and aarch64 Erico Nunes
@ 2017-04-26 21:39 ` Erico Nunes
2017-07-16 13:09 ` Thomas Petazzoni
2017-04-26 21:39 ` [Buildroot] [PATCH v2 2/8] grub2-tools: new package Erico Nunes
` (6 subsequent siblings)
7 siblings, 1 reply; 14+ messages in thread
From: Erico Nunes @ 2017-04-26 21:39 UTC (permalink / raw)
To: buildroot
After many years since the last release and a long time with grub 2.02
in beta, there is finally a release and it brings many bug fixes and
interesting features such as support for ARM.
Patch boot/grub2/0001-remove-gets.patch doesn't seem to be required
anymore as grub-core/gnulib/stdio.in.h has changed significantly since
"053cfcd Import new gnulib." and has another treatment for gets.
Patch
boot/grub2/0002-grub-core-gettext-gettext.c-main_context-secondary_c.patch
was a backport which is present after the bump and therefore is also no
longer necessary.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Changes v1 -> v2:
- bump to 2.02 instead of git, as discussed in the mailing list, and
also the 2.02 final release has finally been done this week.
- grub 2.02 is not in the Buildroot default gnu mirror yet it seems.
- needs wchar
---
boot/grub2/0001-remove-gets.patch | 21 ------------
...ettext-gettext.c-main_context-secondary_c.patch | 39 ----------------------
boot/grub2/Config.in | 5 +++
boot/grub2/grub2.hash | 4 +--
boot/grub2/grub2.mk | 4 +--
5 files changed, 9 insertions(+), 64 deletions(-)
delete mode 100644 boot/grub2/0001-remove-gets.patch
delete mode 100644 boot/grub2/0002-grub-core-gettext-gettext.c-main_context-secondary_c.patch
diff --git a/boot/grub2/0001-remove-gets.patch b/boot/grub2/0001-remove-gets.patch
deleted file mode 100644
index 0da71b3..0000000
--- a/boot/grub2/0001-remove-gets.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-ISO C11 removes the specification of gets() from the C language, eglibc 2.16+ removed it
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-
-Upstream-Status: Pending
-Index: grub-1.99/grub-core/gnulib/stdio.in.h
-===================================================================
---- grub-1.99.orig/grub-core/gnulib/stdio.in.h 2010-12-01 06:45:43.000000000 -0800
-+++ grub-1.99/grub-core/gnulib/stdio.in.h 2012-07-04 12:25:02.057099107 -0700
-@@ -140,8 +140,10 @@
- /* It is very rare that the developer ever has full control of stdin,
- so any use of gets warrants an unconditional warning. Assume it is
- always declared, since it is required by C89. */
-+#if defined gets
- #undef gets
- _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
-+#endif
-
- #if @GNULIB_FOPEN@
- # if @REPLACE_FOPEN@
diff --git a/boot/grub2/0002-grub-core-gettext-gettext.c-main_context-secondary_c.patch b/boot/grub2/0002-grub-core-gettext-gettext.c-main_context-secondary_c.patch
deleted file mode 100644
index 94be092..0000000
--- a/boot/grub2/0002-grub-core-gettext-gettext.c-main_context-secondary_c.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From f30c692c1f9ef0e93bee2b408a24baa017f1ca9d Mon Sep 17 00:00:00 2001
-From: Vladimir Serbinenko <phcoder@gmail.com>
-Date: Thu, 7 Nov 2013 01:01:47 +0100
-Subject: [PATCH] * grub-core/gettext/gettext.c (main_context),
- (secondary_context): Define after defining type and not before.
-
-[Thomas: backport from upstream commit
-f30c692c1f9ef0e93bee2b408a24baa017f1ca9d, and remove ChangeLog
-modifications to avoid conflicts.]
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
----
- grub-core/gettext/gettext.c | 4 ++--
- 2 files changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/grub-core/gettext/gettext.c b/grub-core/gettext/gettext.c
-index df73570..4880cef 100644
---- a/grub-core/gettext/gettext.c
-+++ b/grub-core/gettext/gettext.c
-@@ -34,8 +34,6 @@ GRUB_MOD_LICENSE ("GPLv3+");
- http://www.gnu.org/software/autoconf/manual/gettext/MO-Files.html .
- */
-
--static struct grub_gettext_context main_context, secondary_context;
--
- static const char *(*grub_gettext_original) (const char *s);
-
- struct grub_gettext_msg
-@@ -69,6 +67,8 @@ struct grub_gettext_context
- struct grub_gettext_msg *grub_gettext_msg_list;
- };
-
-+static struct grub_gettext_context main_context, secondary_context;
-+
- #define MO_MAGIC_NUMBER 0x950412de
-
- static grub_err_t
---
-2.7.4
-
diff --git a/boot/grub2/Config.in b/boot/grub2/Config.in
index 7dc5cae..eede814 100644
--- a/boot/grub2/Config.in
+++ b/boot/grub2/Config.in
@@ -1,6 +1,7 @@
config BR2_TARGET_GRUB2
bool "grub2"
depends on BR2_i386 || BR2_x86_64
+ depends on BR2_USE_WCHAR
help
GNU GRUB is a Multiboot boot loader. It was derived from
GRUB, the GRand Unified Bootloader, which was originally
@@ -167,3 +168,7 @@ config BR2_TARGET_GRUB2_BUILTIN_CONFIG
entries cannot be described in this embedded configuration.
endif # BR2_TARGET_GRUB2
+
+comment "grub2 needs a toolchain w/ wchar"
+ depends on BR2_i386 || BR2_x86_64 || BR2_arm || BR2_aarch64
+ depends on !BR2_USE_WCHAR
diff --git a/boot/grub2/grub2.hash b/boot/grub2/grub2.hash
index 8883905..7f0679f 100644
--- a/boot/grub2/grub2.hash
+++ b/boot/grub2/grub2.hash
@@ -1,2 +1,2 @@
-# Locally calculated after checking pgp signature
-sha256 784ec38e7edc32239ad75b8e66df04dc8bfb26d88681bc9f627133a6eb85c458 grub-2.00.tar.xz
+# Locally computed:
+sha256 810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f grub-2.02.tar.xz
diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index dc01983..171829d 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -4,8 +4,8 @@
#
################################################################################
-GRUB2_VERSION = 2.00
-GRUB2_SITE = $(BR2_GNU_MIRROR)/grub
+GRUB2_VERSION = 2.02
+GRUB2_SITE = http://ftp.gnu.org/gnu/grub
GRUB2_SOURCE = grub-$(GRUB2_VERSION).tar.xz
GRUB2_LICENSE = GPL-3.0+
GRUB2_LICENSE_FILES = COPYING
--
2.9.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 2/8] grub2-tools: new package
2017-04-26 21:39 [Buildroot] [PATCH v2 0/8] grub2: bump and add support for arm and aarch64 Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 1/8] grub2: bump up version Erico Nunes
@ 2017-04-26 21:39 ` Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 3/8] grub2: use grub2-tools as a host package Erico Nunes
` (5 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Erico Nunes @ 2017-04-26 21:39 UTC (permalink / raw)
To: buildroot
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>
---
Changes v1 -> v2:
- bump to 2.02 instead of git, as discussed in the mailing list, and
also 2.02 final release has finally been done this week.
- grub 2.02 is not in the Buildroot default gnu mirror yet it seems.
- needs wchar
- add myself to the DEVELOPERS file
---
DEVELOPERS | 1 +
package/Config.in | 1 +
package/grub2-tools/Config.in | 10 ++++++++++
package/grub2-tools/grub2-tools.hash | 2 ++
package/grub2-tools/grub2-tools.mk | 32 ++++++++++++++++++++++++++++++++
5 files changed, 46 insertions(+)
create mode 100644 package/grub2-tools/Config.in
create mode 100644 package/grub2-tools/grub2-tools.hash
create mode 100644 package/grub2-tools/grub2-tools.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 123a8f9..d6e7b85 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -472,6 +472,7 @@ F: package/acpitool/
F: package/efibootmgr/
F: package/efivar/
F: package/fwts/
+F: package/grub2-tools/
F: package/spi-tools/
F: package/xdotool/
diff --git a/package/Config.in b/package/Config.in
index 4eaa95b..6eee7d4 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -398,6 +398,7 @@ endmenu
source "package/gpm/Config.in"
source "package/gpsd/Config.in"
source "package/gptfdisk/Config.in"
+ source "package/grub2-tools/Config.in"
source "package/gvfs/Config.in"
source "package/hdparm/Config.in"
source "package/hwdata/Config.in"
diff --git a/package/grub2-tools/Config.in b/package/grub2-tools/Config.in
new file mode 100644
index 0000000..24a5664
--- /dev/null
+++ b/package/grub2-tools/Config.in
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_GRUB2_TOOLS
+ bool "grub2-tools"
+ depends on BR2_USE_WCHAR
+ help
+ Support tools to interact with GNU GRUB Multiboot boot loader.
+
+ http://www.gnu.org/software/grub/
+
+comment "grub2-tools needs a toolchain w/ wchar"
+ depends on !BR2_USE_WCHAR
diff --git a/package/grub2-tools/grub2-tools.hash b/package/grub2-tools/grub2-tools.hash
new file mode 100644
index 0000000..7f0679f
--- /dev/null
+++ b/package/grub2-tools/grub2-tools.hash
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256 810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f grub-2.02.tar.xz
diff --git a/package/grub2-tools/grub2-tools.mk b/package/grub2-tools/grub2-tools.mk
new file mode 100644
index 0000000..8bf1a31
--- /dev/null
+++ b/package/grub2-tools/grub2-tools.mk
@@ -0,0 +1,32 @@
+################################################################################
+#
+# 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)" \
+ 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
+
+$(eval $(autotools-package))
--
2.9.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 3/8] grub2: use grub2-tools as a host package
2017-04-26 21:39 [Buildroot] [PATCH v2 0/8] grub2: bump and add support for arm and aarch64 Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 1/8] grub2: bump up version Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 2/8] grub2-tools: new package Erico Nunes
@ 2017-04-26 21:39 ` Erico Nunes
2017-07-16 13:39 ` Thomas Petazzoni
2017-04-26 21:39 ` [Buildroot] [PATCH v2 4/8] grub2: enable support for arm and aarch64 targets Erico Nunes
` (4 subsequent siblings)
7 siblings, 1 reply; 14+ messages in thread
From: Erico Nunes @ 2017-04-26 21:39 UTC (permalink / raw)
To: buildroot
Grub 2 requires the host grub2-mkimage tool to build some of its target
images.
The current way of obtaining this tool in the grub2 package is to
perform a simultaneous host-tools/target-bootloader build during the
grub2 build step.
During work to enable Grub 2 support for arm/aarch64 (to come in
upcoming patches), this flow was a complication and led to hard-to-debug
problems in the target image (i.e. strange relocation errors in
runtime).
By making a better separation between the build of grub2 host tools and
target boot loader image, these problems have not been observed and it
makes the grub2 recipe less complex to understand.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
---
Changes v1 -> v2:
- Moved a small fix from the next patch to this one (pointed out by
Arnout Vandecappelle)
---
boot/grub2/grub2.mk | 32 +++++++++++---------------------
package/grub2-tools/grub2-tools.mk | 7 +++++++
2 files changed, 18 insertions(+), 21 deletions(-)
diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index 171829d..f0bd2ee 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -9,7 +9,9 @@ GRUB2_SITE = http://ftp.gnu.org/gnu/grub
GRUB2_SOURCE = grub-$(GRUB2_VERSION).tar.xz
GRUB2_LICENSE = GPL-3.0+
GRUB2_LICENSE_FILES = COPYING
-GRUB2_DEPENDENCIES = host-bison host-flex
+GRUB2_DEPENDENCIES = host-bison host-flex host-grub2-tools
+GRUB2_INSTALL_TARGET = NO
+GRUB2_INSTALL_IMAGES = YES
GRUB2_BUILTIN_MODULES = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_MODULES))
GRUB2_BUILTIN_CONFIG = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_CONFIG))
@@ -41,24 +43,20 @@ endif
# Grub2 is kind of special: it considers CC, LD and so on to be the
# tools to build the native tools (i.e to be executed on the build
# machine), and uses TARGET_CC, TARGET_CFLAGS, TARGET_CPPFLAGS,
-# TARGET_LDFLAGS to build the bootloader itself. However, to add to
-# the confusion, it also uses NM, OBJCOPY and STRIP to build the
-# bootloader itself; none of these are used to build the native
-# tools.
+# TARGET_LDFLAGS to build the bootloader itself.
#
# NOTE: TARGET_STRIP is overridden by BR2_STRIP_none, so always
# use the cross compile variant to ensure grub2 builds
GRUB2_CONF_ENV = \
- $(HOST_CONFIGURE_OPTS) \
- CPP="$(HOSTCC) -E" \
+ CPP="$(TARGET_CC) -E" \
TARGET_CC="$(TARGET_CC)" \
TARGET_CFLAGS="$(TARGET_CFLAGS)" \
TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \
TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
- NM="$(TARGET_NM)" \
- OBJCOPY="$(TARGET_OBJCOPY)" \
- STRIP="$(TARGET_CROSS)strip"
+ TARGET_NM="$(TARGET_NM)" \
+ TARGET_OBJCOPY="$(TARGET_OBJCOPY)" \
+ TARGET_STRIP="$(TARGET_CROSS)strip"
GRUB2_CONF_OPTS = \
--target=$(GRUB2_TARGET) \
@@ -70,13 +68,6 @@ GRUB2_CONF_OPTS = \
--enable-libzfs=no \
--disable-werror
-# We don't want all the native tools and Grub2 modules to be installed
-# in the target. So we in fact install everything into the host
-# directory, and the image generation process (below) will use the
-# grub-mkimage tool and Grub2 modules from the host directory.
-
-GRUB2_INSTALL_TARGET_OPTS = DESTDIR=$(HOST_DIR) install
-
ifeq ($(BR2_TARGET_GRUB2_I386_PC),y)
define GRUB2_IMAGE_INSTALL_ELTORITO
cat $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE)/cdboot.img $(GRUB2_IMAGE) > \
@@ -84,10 +75,10 @@ define GRUB2_IMAGE_INSTALL_ELTORITO
endef
endif
-define GRUB2_IMAGE_INSTALLATION
+define GRUB2_INSTALL_IMAGES_CMDS
mkdir -p $(dir $(GRUB2_IMAGE))
$(HOST_DIR)/usr/bin/grub-mkimage \
- -d $(HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE) \
+ -d $(@D)/grub-core/ \
-O $(GRUB2_TUPLE) \
-o $(GRUB2_IMAGE) \
-p "$(GRUB2_PREFIX)" \
@@ -97,14 +88,13 @@ define GRUB2_IMAGE_INSTALLATION
$(INSTALL) -D -m 0644 boot/grub2/grub.cfg $(GRUB2_CFG)
$(GRUB2_IMAGE_INSTALL_ELTORITO)
endef
-GRUB2_POST_INSTALL_TARGET_HOOKS += GRUB2_IMAGE_INSTALLATION
ifeq ($(GRUB2_PLATFORM),efi)
define GRUB2_EFI_STARTUP_NSH
echo $(notdir $(GRUB2_IMAGE)) > \
$(BINARIES_DIR)/efi-part/startup.nsh
endef
-GRUB2_POST_INSTALL_TARGET_HOOKS += GRUB2_EFI_STARTUP_NSH
+GRUB2_POST_INSTALL_IMAGES_HOOKS += GRUB2_EFI_STARTUP_NSH
endif
$(eval $(autotools-package))
diff --git a/package/grub2-tools/grub2-tools.mk b/package/grub2-tools/grub2-tools.mk
index 8bf1a31..f98f4aa 100644
--- a/package/grub2-tools/grub2-tools.mk
+++ b/package/grub2-tools/grub2-tools.mk
@@ -10,6 +10,10 @@ GRUB2_TOOLS_SOURCE = grub-$(GRUB2_VERSION).tar.xz
GRUB2_TOOLS_LICENSE = GPLv3+
GRUB2_TOOLS_LICENSE_FILES = COPYING
GRUB2_TOOLS_DEPENDENCIES = host-bison host-flex
+HOST_GRUB2_TOOLS_DEPENDENCIES = host-bison host-flex
+
+HOST_GRUB2_TOOLS_CONF_ENV = \
+ CPP="$(HOSTCC) -E"
GRUB2_TOOLS_CONF_ENV = \
CPP="$(TARGET_CC) -E" \
@@ -29,4 +33,7 @@ GRUB2_TOOLS_CONF_OPTS = \
--enable-libzfs=no \
--disable-werror
+HOST_GRUB2_TOOLS_CONF_OPTS = $(GRUB2_TOOLS_CONF_OPTS)
+
$(eval $(autotools-package))
+$(eval $(host-autotools-package))
--
2.9.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 4/8] grub2: enable support for arm and aarch64 targets
2017-04-26 21:39 [Buildroot] [PATCH v2 0/8] grub2: bump and add support for arm and aarch64 Erico Nunes
` (2 preceding siblings ...)
2017-04-26 21:39 ` [Buildroot] [PATCH v2 3/8] grub2: use grub2-tools as a host package Erico Nunes
@ 2017-04-26 21:39 ` Erico Nunes
2017-07-16 13:41 ` Thomas Petazzoni
2017-04-26 21:39 ` [Buildroot] [PATCH v2 5/8] grub2: introduce BR2_TARGET_GRUB2_CFG Erico Nunes
` (3 subsequent siblings)
7 siblings, 1 reply; 14+ messages in thread
From: Erico Nunes @ 2017-04-26 21:39 UTC (permalink / raw)
To: buildroot
This commit enables the arm-uboot, arm-efi and aarch64-efi Grub 2
platforms in Buildroot.
As a uboot platform, Grub 2 image gets built as a u-boot image (i.e.
u-boot mkimage) and is loaded from u-boot through a regular "bootm". The
only requirement from u-boot side in order to allow this is that u-boot
is built with CONFIG_API enabled. CONFIG_API seems to not be enabled by
default in most in-tree configurations, however, it seems to be
available for quite some time now. So it might be possible to use this
even on older u-boot versions. This is available only for arm (32-bit).
As an efi platform, Grub 2 gets built as an EFI executable. This allows
EFI firmware to find and load it similarly as it can be done for x86_64.
Also, since u-boot v2016.05, u-boot is able to load and boot an EFI
executable, so the Grub 2 efi platform can also be used from u-boot in
recent versions. This has been enabled (mostly) by default for ARM
u-boot.
efi platform is available for both arm and aarch64.
These targets have been tested in the following environments:
arm-uboot: qemu arm vexpress and BeagleBone
arm-efi: BeagleBone
aarch64-efi: qemu aarch64 virt and Odroid-C2
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
---
Changes v1 -> v2:
- Moved a small fix from this patch to the previous one (pointed out
by Arnout Vandecappelle)
---
boot/grub2/Config.in | 40 +++++++++++++++++++++++++++++++++++-----
boot/grub2/grub2.mk | 21 +++++++++++++++++++++
2 files changed, 56 insertions(+), 5 deletions(-)
diff --git a/boot/grub2/Config.in b/boot/grub2/Config.in
index eede814..498d5cd 100644
--- a/boot/grub2/Config.in
+++ b/boot/grub2/Config.in
@@ -1,6 +1,6 @@
config BR2_TARGET_GRUB2
bool "grub2"
- depends on BR2_i386 || BR2_x86_64
+ depends on BR2_i386 || BR2_x86_64 || BR2_arm || BR2_aarch64
depends on BR2_USE_WCHAR
help
GNU GRUB is a Multiboot boot loader. It was derived from
@@ -120,12 +120,14 @@ choice
config BR2_TARGET_GRUB2_I386_PC
bool "i386-pc"
+ depends on BR2_i386 || BR2_x86_64
help
Select this option if the platform you're targetting is a
x86 or x86-64 legacy BIOS based platform.
config BR2_TARGET_GRUB2_I386_EFI
bool "i386-efi"
+ depends on BR2_i386 || BR2_x86_64
help
Select this option if the platform you're targetting has a
32 bits EFI BIOS. Note that some x86-64 platforms use a 32
@@ -133,14 +135,38 @@ config BR2_TARGET_GRUB2_I386_EFI
config BR2_TARGET_GRUB2_X86_64_EFI
bool "x86-64-efi"
- depends on BR2_ARCH_IS_64
+ depends on BR2_x86_64
help
Select this option if the platform you're targetting has a
64 bits EFI BIOS.
+config BR2_TARGET_GRUB2_ARM_UBOOT
+ bool "arm-uboot"
+ depends on BR2_arm
+ help
+ Select this option if the platform you're targetting is an
+ ARM u-boot platform, and you want to boot Grub 2 as an u-boot
+ compatible image.
+
+config BR2_TARGET_GRUB2_ARM_EFI
+ bool "arm-efi"
+ depends on BR2_arm
+ help
+ Select this option if the platform you're targetting is an
+ ARM platform and you want to boot Grub 2 as an EFI
+ application.
+
+config BR2_TARGET_GRUB2_ARM64_EFI
+ bool "arm64-efi"
+ depends on BR2_aarch64
+ help
+ Select this option if the platform you're targetting is an
+ Aarch64 platform and you want to boot Grub 2 as an EFI
+ application.
+
endchoice
-if BR2_TARGET_GRUB2_I386_PC
+if BR2_TARGET_GRUB2_I386_PC || BR2_TARGET_GRUB2_ARM_UBOOT
config BR2_TARGET_GRUB2_BOOT_PARTITION
string "boot partition"
@@ -151,13 +177,17 @@ config BR2_TARGET_GRUB2_BOOT_PARTITION
first disk if using a legacy partition table, or 'hd0,gpt1'
if using GPT partition table.
-endif # BR2_TARGET_GRUB2_I386_PC
+endif # BR2_TARGET_GRUB2_I386_PC || BR2_TARGET_GRUB2_ARM_UBOOT
config BR2_TARGET_GRUB2_BUILTIN_MODULES
string "builtin modules"
default "boot linux ext2 fat squash4 part_msdos part_gpt normal biosdisk" if BR2_TARGET_GRUB2_I386_PC
default "boot linux ext2 fat squash4 part_msdos part_gpt normal efi_gop" \
- if BR2_TARGET_GRUB2_I386_EFI || BR2_TARGET_GRUB2_X86_64_EFI
+ if BR2_TARGET_GRUB2_I386_EFI || \
+ BR2_TARGET_GRUB2_X86_64_EFI || \
+ BR2_TARGET_GRUB2_ARM_EFI || \\
+ BR2_TARGET_GRUB2_ARM64_EFI
+ default "linux ext2 fat part_msdos normal" if BR2_TARGET_GRUB2_ARM_UBOOT
config BR2_TARGET_GRUB2_BUILTIN_CONFIG
string "builtin config"
diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index f0bd2ee..7bbdb40 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -38,6 +38,27 @@ GRUB2_PREFIX = /EFI/BOOT
GRUB2_TUPLE = x86_64-efi
GRUB2_TARGET = x86_64
GRUB2_PLATFORM = efi
+else ifeq ($(BR2_TARGET_GRUB2_ARM_UBOOT),y)
+GRUB2_IMAGE = $(BINARIES_DIR)/boot-part/grub/grub.img
+GRUB2_CFG = $(BINARIES_DIR)/boot-part/grub/grub.cfg
+GRUB2_PREFIX = ($(GRUB2_BOOT_PARTITION))/boot/grub
+GRUB2_TUPLE = arm-uboot
+GRUB2_TARGET = arm
+GRUB2_PLATFORM = uboot
+else ifeq ($(BR2_TARGET_GRUB2_ARM_EFI),y)
+GRUB2_IMAGE = $(BINARIES_DIR)/efi-part/EFI/BOOT/bootarm.efi
+GRUB2_CFG = $(BINARIES_DIR)/efi-part/EFI/BOOT/grub.cfg
+GRUB2_PREFIX = /EFI/BOOT
+GRUB2_TUPLE = arm-efi
+GRUB2_TARGET = arm
+GRUB2_PLATFORM = efi
+else ifeq ($(BR2_TARGET_GRUB2_ARM64_EFI),y)
+GRUB2_IMAGE = $(BINARIES_DIR)/efi-part/EFI/BOOT/bootaa64.efi
+GRUB2_CFG = $(BINARIES_DIR)/efi-part/EFI/BOOT/grub.cfg
+GRUB2_PREFIX = /EFI/BOOT
+GRUB2_TUPLE = arm64-efi
+GRUB2_TARGET = aarch64
+GRUB2_PLATFORM = efi
endif
# Grub2 is kind of special: it considers CC, LD and so on to be the
--
2.9.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 5/8] grub2: introduce BR2_TARGET_GRUB2_CFG
2017-04-26 21:39 [Buildroot] [PATCH v2 0/8] grub2: bump and add support for arm and aarch64 Erico Nunes
` (3 preceding siblings ...)
2017-04-26 21:39 ` [Buildroot] [PATCH v2 4/8] grub2: enable support for arm and aarch64 targets Erico Nunes
@ 2017-04-26 21:39 ` Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 6/8] grub2: move usage notes to package readme.txt Erico Nunes
` (2 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Erico Nunes @ 2017-04-26 21:39 UTC (permalink / raw)
To: buildroot
This config can be used to provide a custom Grub 2 configuration file
containing menu entries. In the previous implementation, this had to be
always done by an external script, overwriting the default file.
This should be backwards compatible as the default value is the previous
hardcoded value.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
Changes v1 -> v2:
- Only patch rebase and commit rewording.
---
boot/grub2/Config.in | 7 +++++++
boot/grub2/grub2.mk | 5 +++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/boot/grub2/Config.in b/boot/grub2/Config.in
index 498d5cd..77f5e7b 100644
--- a/boot/grub2/Config.in
+++ b/boot/grub2/Config.in
@@ -197,6 +197,13 @@ 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_CFG
+ string "grub2 menu entries config"
+ default "boot/grub2/grub.cfg"
+ help
+ Path to a Grub 2 configuration file containing the grub2 menu
+ entries.
+
endif # BR2_TARGET_GRUB2
comment "grub2 needs a toolchain w/ wchar"
diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
index 7bbdb40..7c9505f 100644
--- a/boot/grub2/grub2.mk
+++ b/boot/grub2/grub2.mk
@@ -105,8 +105,9 @@ define GRUB2_INSTALL_IMAGES_CMDS
-p "$(GRUB2_PREFIX)" \
$(if $(GRUB2_BUILTIN_CONFIG),-c $(GRUB2_BUILTIN_CONFIG)) \
$(GRUB2_BUILTIN_MODULES)
- mkdir -p $(dir $(GRUB2_CFG))
- $(INSTALL) -D -m 0644 boot/grub2/grub.cfg $(GRUB2_CFG)
+ $(if $(BR2_TARGET_GRUB2_CFG), \
+ mkdir -p $(dir $(GRUB2_CFG)) && \
+ $(INSTALL) -D -m 0644 $(BR2_TARGET_GRUB2_CFG) $(GRUB2_CFG))
$(GRUB2_IMAGE_INSTALL_ELTORITO)
endef
--
2.9.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 6/8] grub2: move usage notes to package readme.txt
2017-04-26 21:39 [Buildroot] [PATCH v2 0/8] grub2: bump and add support for arm and aarch64 Erico Nunes
` (4 preceding siblings ...)
2017-04-26 21:39 ` [Buildroot] [PATCH v2 5/8] grub2: introduce BR2_TARGET_GRUB2_CFG Erico Nunes
@ 2017-04-26 21:39 ` Erico Nunes
2017-07-16 13:33 ` Thomas Petazzoni
2017-04-26 21:39 ` [Buildroot] [PATCH v2 7/8] grub2: add usage notes for Grub 2 ARM and aarch64 Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 8/8] linux: new Image.gz format for aarch64 Erico Nunes
7 siblings, 1 reply; 14+ messages in thread
From: Erico Nunes @ 2017-04-26 21:39 UTC (permalink / raw)
To: buildroot
As discussed in the mailing list, grub2 usage notes were growing too big
for a Config.in documentation, and so it was agreed that a readme.txt in
the package directory is a better place to put them.
This commit simply moves the documentation as-is to preserve the
original contents as they were in Config.in which can be worked on in
further commits.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
This was not in v1.
---
boot/grub2/Config.in | 100 +-------------------------------------------------
boot/grub2/readme.txt | 98 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 100 insertions(+), 98 deletions(-)
create mode 100644 boot/grub2/readme.txt
diff --git a/boot/grub2/Config.in b/boot/grub2/Config.in
index 77f5e7b..8b66952 100644
--- a/boot/grub2/Config.in
+++ b/boot/grub2/Config.in
@@ -12,104 +12,8 @@ config BR2_TARGET_GRUB2
Amongst others, GRUB2 offers EFI support, which GRUB Legacy
doesn't provide.
- Notes on using Grub2 for BIOS-based platforms
- =============================================
-
- 1. Create a disk image
- dd if=/dev/zero of=disk.img bs=1M count=32
- 2. Partition it (either legacy or GPT style partitions work)
- cfdisk disk.img
- - Create one partition, type Linux, for the root
- filesystem. The only constraint is to make sure there
- is enough free space *before* the first partition to
- store Grub2. Leaving 1 MB of free space is safe.
- 3. Setup loop device and loop partitions
- sudo losetup -f disk.img
- sudo partx -a /dev/loop0
- 4. Prepare the root partition
- sudo mkfs.ext3 -L root /dev/loop0p1
- sudo mount /dev/loop0p1 /mnt
- sudo tar -C /mnt -xf output/images/rootfs.tar
- sudo umount /mnt
- 5. Install Grub2
- sudo ./output/host/usr/sbin/grub-bios-setup \
- -b ./output/host/usr/lib/grub/i386-pc/boot.img \
- -c ./output/images/grub.img -d . /dev/loop0
- 6. Cleanup loop device
- sudo partx -d /dev/loop0
- sudo losetup -d /dev/loop0
- 7. Your disk.img is ready!
-
- Using genimage
- --------------
-
- If you use genimage to generate your complete image,
- installing Grub can be tricky. Here is how to achieve Grub's
- installation with genimage:
-
- partition boot {
- in-partition-table = "no"
- image = "path_to_boot.img"
- offset = 0
- size = 512
- }
- partition grub {
- in-partition-table = "no"
- image = "path_to_grub.img"
- offset = 512
- }
-
- The result is not byte to byte identical to what
- grub-bios-setup does but it works anyway.
-
- To test your BIOS image in Qemu
- -------------------------------
-
- qemu-system-{i386,x86-64} -hda disk.img
-
- Notes on using Grub2 for EFI-based platforms
- ============================================
-
- 1. Create a disk image
- dd if=/dev/zero of=disk.img bs=1M count=32
- 2. Partition it with GPT partitions
- cgdisk disk.img
- - Create a first partition, type EF00, for the
- bootloader and kernel image
- - Create a second partition, type 8300, for the root
- filesystem.
- 3. Setup loop device and loop partitions
- sudo losetup -f disk.img
- sudo partx -a /dev/loop0
- 4. Prepare the boot partition
- sudo mkfs.vfat -n boot /dev/loop0p1
- sudo mount /dev/loop0p1 /mnt
- sudo cp -a output/images/efi-part/* /mnt/
- sudo cp output/images/bzImage /mnt/
- sudo umount /mnt
- 5. Prepare the root partition
- sudo mkfs.ext3 -L root /dev/loop0p2
- sudo mount /dev/loop0p2 /mnt
- sudo tar -C /mnt -xf output/images/rootfs.tar
- sudo umount /mnt
- 6 Cleanup loop device
- sudo partx -d /dev/loop0
- sudo losetup -d /dev/loop0
- 7. Your disk.img is ready!
-
- To test your EFI image in Qemu
- ------------------------------
-
- 1. Download the EFI BIOS for Qemu
- Version IA32 or X64 depending on the chosen Grub2
- platform (i386-efi vs. x86-64-efi)
- http://sourceforge.net/projects/edk2/files/OVMF/
- 2. Extract, and rename OVMF.fd to bios.bin and
- CirrusLogic5446.rom to vgabios-cirrus.bin.
- 3. qemu-system-{i386,x86-64} -L ovmf-dir/ -hda disk.img
- 4. Make sure to pass pci=nocrs to the kernel command line,
- to workaround a bug in the EFI BIOS regarding the
- EFI framebuffer.
+ For additional notes on using Grub 2 with Buildroot, please
+ check boot/grub2/readme.txt
http://www.gnu.org/software/grub/
diff --git a/boot/grub2/readme.txt b/boot/grub2/readme.txt
new file mode 100644
index 0000000..278d770
--- /dev/null
+++ b/boot/grub2/readme.txt
@@ -0,0 +1,98 @@
+Notes on using Grub2 for BIOS-based platforms
+=============================================
+
+1. Create a disk image
+ dd if=/dev/zero of=disk.img bs=1M count=32
+2. Partition it (either legacy or GPT style partitions work)
+ cfdisk disk.img
+ - Create one partition, type Linux, for the root
+ filesystem. The only constraint is to make sure there
+ is enough free space *before* the first partition to
+ store Grub2. Leaving 1 MB of free space is safe.
+3. Setup loop device and loop partitions
+ sudo losetup -f disk.img
+ sudo partx -a /dev/loop0
+4. Prepare the root partition
+ sudo mkfs.ext3 -L root /dev/loop0p1
+ sudo mount /dev/loop0p1 /mnt
+ sudo tar -C /mnt -xf output/images/rootfs.tar
+ sudo umount /mnt
+5. Install Grub2
+ sudo ./output/host/usr/sbin/grub-bios-setup \
+ -b ./output/host/usr/lib/grub/i386-pc/boot.img \
+ -c ./output/images/grub.img -d . /dev/loop0
+6. Cleanup loop device
+ sudo partx -d /dev/loop0
+ sudo losetup -d /dev/loop0
+7. Your disk.img is ready!
+
+Using genimage
+--------------
+
+If you use genimage to generate your complete image,
+installing Grub can be tricky. Here is how to achieve Grub's
+installation with genimage:
+
+partition boot {
+ in-partition-table = "no"
+ image = "path_to_boot.img"
+ offset = 0
+ size = 512
+}
+partition grub {
+ in-partition-table = "no"
+ image = "path_to_grub.img"
+ offset = 512
+}
+
+The result is not byte to byte identical to what
+grub-bios-setup does but it works anyway.
+
+To test your BIOS image in Qemu
+-------------------------------
+
+qemu-system-{i386,x86-64} -hda disk.img
+
+Notes on using Grub2 for EFI-based platforms
+============================================
+
+1. Create a disk image
+ dd if=/dev/zero of=disk.img bs=1M count=32
+2. Partition it with GPT partitions
+ cgdisk disk.img
+ - Create a first partition, type EF00, for the
+ bootloader and kernel image
+ - Create a second partition, type 8300, for the root
+ filesystem.
+3. Setup loop device and loop partitions
+ sudo losetup -f disk.img
+ sudo partx -a /dev/loop0
+4. Prepare the boot partition
+ sudo mkfs.vfat -n boot /dev/loop0p1
+ sudo mount /dev/loop0p1 /mnt
+ sudo cp -a output/images/efi-part/* /mnt/
+ sudo cp output/images/bzImage /mnt/
+ sudo umount /mnt
+5. Prepare the root partition
+ sudo mkfs.ext3 -L root /dev/loop0p2
+ sudo mount /dev/loop0p2 /mnt
+ sudo tar -C /mnt -xf output/images/rootfs.tar
+ sudo umount /mnt
+6 Cleanup loop device
+ sudo partx -d /dev/loop0
+ sudo losetup -d /dev/loop0
+7. Your disk.img is ready!
+
+To test your EFI image in Qemu
+------------------------------
+
+1. Download the EFI BIOS for Qemu
+ Version IA32 or X64 depending on the chosen Grub2
+ platform (i386-efi vs. x86-64-efi)
+ http://sourceforge.net/projects/edk2/files/OVMF/
+2. Extract, and rename OVMF.fd to bios.bin and
+ CirrusLogic5446.rom to vgabios-cirrus.bin.
+3. qemu-system-{i386,x86-64} -L ovmf-dir/ -hda disk.img
+4. Make sure to pass pci=nocrs to the kernel command line,
+ to workaround a bug in the EFI BIOS regarding the
+ EFI framebuffer.
--
2.9.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 7/8] grub2: add usage notes for Grub 2 ARM and aarch64
2017-04-26 21:39 [Buildroot] [PATCH v2 0/8] grub2: bump and add support for arm and aarch64 Erico Nunes
` (5 preceding siblings ...)
2017-04-26 21:39 ` [Buildroot] [PATCH v2 6/8] grub2: move usage notes to package readme.txt Erico Nunes
@ 2017-04-26 21:39 ` Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 8/8] linux: new Image.gz format for aarch64 Erico Nunes
7 siblings, 0 replies; 14+ messages in thread
From: Erico Nunes @ 2017-04-26 21:39 UTC (permalink / raw)
To: buildroot
Add notes to test grub2 running on ARM using qemu. arm shows how to run
it using u-boot and aarch64 shows how to do it using efi, which is
similar to what has to be done for x86_64.
The source for OVMF builds is also changed to
https://www.kraxel.org/repos/jenkins/edk2/ which is the source for
nightly builds (as rpms but which can be extracted in any distribution),
as the sourceforge link provided only very old builds.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
This was not in v1
---
boot/grub2/readme.txt | 141 ++++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 137 insertions(+), 4 deletions(-)
diff --git a/boot/grub2/readme.txt b/boot/grub2/readme.txt
index 278d770..14a966a 100644
--- a/boot/grub2/readme.txt
+++ b/boot/grub2/readme.txt
@@ -53,8 +53,8 @@ To test your BIOS image in Qemu
qemu-system-{i386,x86-64} -hda disk.img
-Notes on using Grub2 for EFI-based platforms
-============================================
+Notes on using Grub2 for x86/x86_64 EFI-based platforms
+=======================================================
1. Create a disk image
dd if=/dev/zero of=disk.img bs=1M count=32
@@ -83,16 +83,149 @@ Notes on using Grub2 for EFI-based platforms
sudo losetup -d /dev/loop0
7. Your disk.img is ready!
-To test your EFI image in Qemu
+To test your i386/x86-64 EFI image in Qemu
------------------------------
1. Download the EFI BIOS for Qemu
Version IA32 or X64 depending on the chosen Grub2
platform (i386-efi vs. x86-64-efi)
- http://sourceforge.net/projects/edk2/files/OVMF/
+ https://www.kraxel.org/repos/jenkins/edk2/
+ (or use one provided by your distribution as OVMF)
2. Extract, and rename OVMF.fd to bios.bin and
CirrusLogic5446.rom to vgabios-cirrus.bin.
3. qemu-system-{i386,x86-64} -L ovmf-dir/ -hda disk.img
4. Make sure to pass pci=nocrs to the kernel command line,
to workaround a bug in the EFI BIOS regarding the
EFI framebuffer.
+
+Notes on using Grub2 for ARM u-boot-based platforms
+===================================================
+
+The following steps are used to exemplify the arm-uboot platform working in the
+simplest way possible and with a single buildroot-generated filesystem. The
+steps can of course be adapted to have a more common setup (i.e. with a
+separate boot partition).
+
+ 1. Load qemu_arm_vexpress_defconfig
+ 2. Enable u-boot with the vexpress_ca9x4 board name and with u-boot.elf image
+ format.
+ 3. Enable grub2 for the arm-uboot platform.
+ 4. Enable "Install kernel image to /boot in target" in the kernel menu to
+ populate a /boot directory with zImage in it.
+ 5. The upstream u-boot vexpress_ca9x4 doesn't have CONFIG_API enabled by
+ default, which is required.
+ Before building, patch u-boot (for example, make u-boot-extract to edit the
+ source before buildling) file include/configs/vexpress_common.h to define:
+
+ #define CONFIG_API
+ #define CONFIG_SYS_MMC_MAX_DEVICE 1
+
+ 6. Create a custom grub2 menu entries config file with the following contents
+ and set its path in BR2_TARGET_GRUB2_CFG:
+
+ set default="0"
+ set timeout="5"
+
+ menuentry "Buildroot" {
+ set root='(hd0)'
+ linux /boot/zImage root=/dev/mmcblk0 console=ttyAMA0
+ devicetree /boot/vexpress-v2p-ca9.dtb
+ }
+
+ 7. Create a custom builtin config file with the following contents and set its
+ path in BR2_TARGET_GRUB2_BUILTIN_CONFIG:
+
+ set root=(hd0)
+ set prefix=/boot/grub
+
+ 8. Create a custom post-build script which copies files from
+ ${BINARIES_DIR}/boot-part to $(TARGET_DIR)/boot (set its path in
+ BR2_ROOTFS_POST_BUILD_SCRIPT):
+
+ #!/bin/sh
+ cp -r ${BINARIES_DIR}/boot-part/* ${TARGET_DIR}/boot/
+
+ 9. make
+10. Run qemu with:
+
+ qemu-system-arm -M vexpress-a9 -kernel output/images/u-boot -m 1024 \
+ -nographic -sd output/images/rootfs.ext2
+
+11. In u-boot, stop at the prompt and run grub2 with:
+
+ => ext2load mmc 0:0 ${loadaddr} /boot/grub/grub.img
+ => bootm
+
+12. This should bring the grub2 menu, upon which selecting the "Buildroot"
+ entry should boot Linux.
+
+
+Notes on using Grub2 for Aarch64 EFI-based platforms
+====================================================
+
+The following steps are used to exemplify the arm64-efi platform with the use
+of qemu and EFI firmware built for qemu.
+
+ 1. Load qemu_aarch64_virt_defconfig
+ 2. Enable grub2 for the arm64-efi platform.
+ 3. Create a custom grub2 menu entries config file with the following contents
+ and set its path in BR2_TARGET_GRUB2_CFG:
+
+ set default="0"
+ set timeout="5"
+ menuentry "Buildroot" {
+ linux /Image console=ttyAMA0
+ }
+
+ 4. Enable host genimage and create a genimage.cfg script which creates the
+ disk image containing a EFI system partition:
+
+ image efi-part.vfat {
+ vfat {
+ file startup.nsh {
+ image = "efi-part/startup.nsh"
+ }
+ file EFI {
+ image = "efi-part/EFI"
+ }
+ file Image {
+ image = "Image"
+ }
+ }
+ size = 16M
+ }
+ image disk.img {
+ hdimage {
+ }
+ partition boot {
+ partition-type = 0xEF
+ image = "efi-part.vfat"
+ }
+ }
+
+ 5. Create a custom post-image script (set its path in BR2_ROOTFS_POST_IMAGE_SCRIPT):
+
+ BOARD_DIR="$(dirname $0)"
+ GENIMAGE_CFG="${BOARD_DIR}/genimage.cfg"
+ GENIMAGE_TMP="${BUILD_DIR}/genimage.tmp"
+ rm -rf "${GENIMAGE_TMP}"
+ genimage \
+ --rootpath "${TARGET_DIR}" \
+ --tmppath "${GENIMAGE_TMP}" \
+ --inputpath "${BINARIES_DIR}" \
+ --outputpath "${BINARIES_DIR}" \
+ --config "${GENIMAGE_CFG}"
+
+ 6. Run qemu with:
+ 7. Download the EFI firmware for qemu aarch64
+ https://www.kraxel.org/repos/jenkins/edk2/
+ (or use one provided by your distribution as OVMF-aarch64 or AAVMF)
+
+ 8. Run qemu with:
+
+ qemu-system-aarch64 -M virt -cpu cortex-a57 -m 512 -nographic \
+ -bios <path/to/EDK2>/QEMU_EFI.fd -hda output/images/disk.img \
+ -netdev user,id=eth0 -device virtio-net-device,netdev=eth0
+
+ 9. This should bring the grub2 menu, upon which selecting the "Buildroot"
+ entry should boot Linux.
--
2.9.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 8/8] linux: new Image.gz format for aarch64
2017-04-26 21:39 [Buildroot] [PATCH v2 0/8] grub2: bump and add support for arm and aarch64 Erico Nunes
` (6 preceding siblings ...)
2017-04-26 21:39 ` [Buildroot] [PATCH v2 7/8] grub2: add usage notes for Grub 2 ARM and aarch64 Erico Nunes
@ 2017-04-26 21:39 ` Erico Nunes
7 siblings, 0 replies; 14+ messages in thread
From: Erico Nunes @ 2017-04-26 21:39 UTC (permalink / raw)
To: buildroot
Distributions such as Fedora use the Image.gz image format for aarch64
to be booted with grub. It exists in linux since v3.10.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
---
This was not in v1.
It is actually an independent patch from the rest of the grub2 changes
but is somewhat related as this is probably the image format to be used
with grub2 for aarch64.
---
linux/Config.in | 4 ++++
linux/linux.mk | 2 ++
2 files changed, 6 insertions(+)
diff --git a/linux/Config.in b/linux/Config.in
index b651152..9062c9f 100644
--- a/linux/Config.in
+++ b/linux/Config.in
@@ -244,6 +244,10 @@ config BR2_LINUX_KERNEL_IMAGE
bool "Image"
depends on BR2_aarch64
+config BR2_LINUX_KERNEL_IMAGE_GZ
+ bool "Image.gz"
+ depends on BR2_aarch64
+
config BR2_LINUX_KERNEL_LINUX_BIN
bool "linux.bin"
depends on BR2_microblaze
diff --git a/linux/linux.mk b/linux/linux.mk
index e387c7d..a4d90be 100644
--- a/linux/linux.mk
+++ b/linux/linux.mk
@@ -147,6 +147,8 @@ else ifeq ($(BR2_LINUX_KERNEL_SIMPLEIMAGE),y)
LINUX_IMAGE_NAME = simpleImage.$(KERNEL_DTS_NAME)
else ifeq ($(BR2_LINUX_KERNEL_IMAGE),y)
LINUX_IMAGE_NAME = Image
+else ifeq ($(BR2_LINUX_KERNEL_IMAGE_GZ),y)
+LINUX_IMAGE_NAME = Image.gz
else ifeq ($(BR2_LINUX_KERNEL_LINUX_BIN),y)
LINUX_IMAGE_NAME = linux.bin
else ifeq ($(BR2_LINUX_KERNEL_VMLINUX_BIN),y)
--
2.9.3
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 1/8] grub2: bump up version
2017-04-26 21:39 ` [Buildroot] [PATCH v2 1/8] grub2: bump up version Erico Nunes
@ 2017-07-16 13:09 ` Thomas Petazzoni
0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2017-07-16 13:09 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 26 Apr 2017 23:39:46 +0200, Erico Nunes wrote:
> After many years since the last release and a long time with grub 2.02
> in beta, there is finally a release and it brings many bug fixes and
> interesting features such as support for ARM.
>
> Patch boot/grub2/0001-remove-gets.patch doesn't seem to be required
> anymore as grub-core/gnulib/stdio.in.h has changed significantly since
> "053cfcd Import new gnulib." and has another treatment for gets.
> Patch
> boot/grub2/0002-grub-core-gettext-gettext.c-main_context-secondary_c.patch
> was a backport which is present after the bump and therefore is also no
> longer necessary.
>
> Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thanks, I've applied, after doing a few changes, see below.
> diff --git a/boot/grub2/Config.in b/boot/grub2/Config.in
> index 7dc5cae..eede814 100644
> --- a/boot/grub2/Config.in
> +++ b/boot/grub2/Config.in
> @@ -1,6 +1,7 @@
> config BR2_TARGET_GRUB2
> bool "grub2"
> depends on BR2_i386 || BR2_x86_64
Instead of duplicating the dependency here and in the Config.in
comment, I've added a hidden BR2_TARGET_GRUB2_ARCH_SUPPORTS
> +comment "grub2 needs a toolchain w/ wchar"
> + depends on BR2_i386 || BR2_x86_64 || BR2_arm || BR2_aarch64
And use it here. Also, I've dropped the BR2_arm || BR2_aarch64 here,
since this commit hasn't added ARM/AArch64 support yet.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 6/8] grub2: move usage notes to package readme.txt
2017-04-26 21:39 ` [Buildroot] [PATCH v2 6/8] grub2: move usage notes to package readme.txt Erico Nunes
@ 2017-07-16 13:33 ` Thomas Petazzoni
0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2017-07-16 13:33 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 26 Apr 2017 23:39:51 +0200, Erico Nunes wrote:
> As discussed in the mailing list, grub2 usage notes were growing too big
> for a Config.in documentation, and so it was agreed that a readme.txt in
> the package directory is a better place to put them.
>
> This commit simply moves the documentation as-is to preserve the
> original contents as they were in Config.in which can be worked on in
> further commits.
>
> Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
> This was not in v1.
> ---
> boot/grub2/Config.in | 100 +-------------------------------------------------
> boot/grub2/readme.txt | 98 +++++++++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 100 insertions(+), 98 deletions(-)
> create mode 100644 boot/grub2/readme.txt
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 3/8] grub2: use grub2-tools as a host package
2017-04-26 21:39 ` [Buildroot] [PATCH v2 3/8] grub2: use grub2-tools as a host package Erico Nunes
@ 2017-07-16 13:39 ` Thomas Petazzoni
2017-08-11 16:39 ` Erico Nunes
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Petazzoni @ 2017-07-16 13:39 UTC (permalink / raw)
To: buildroot
Hello,
I'm finally reviewing this patch series. Sorry for the time it has
taken, especially since I believe it is a very useful topic. I have a
few questions below.
On Wed, 26 Apr 2017 23:39:48 +0200, Erico Nunes wrote:
> diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
> index 171829d..f0bd2ee 100644
> --- a/boot/grub2/grub2.mk
> +++ b/boot/grub2/grub2.mk
> @@ -9,7 +9,9 @@ GRUB2_SITE = http://ftp.gnu.org/gnu/grub
> GRUB2_SOURCE = grub-$(GRUB2_VERSION).tar.xz
> GRUB2_LICENSE = GPL-3.0+
> GRUB2_LICENSE_FILES = COPYING
> -GRUB2_DEPENDENCIES = host-bison host-flex
> +GRUB2_DEPENDENCIES = host-bison host-flex host-grub2-tools
Do we still need to depend on host-bison and host-flex, now that the
tools are built by as part of host-grub2-tools ?
Also, what in boot/grub2/grub2.mk ensures that the tools are *not*
built ?
> +GRUB2_INSTALL_TARGET = NO
Grub really doesn't install anything to the target ? I thought it
installed some modules in /usr/lib/grub2 or something like that, that
grub2 could load dynamically at runtime. Did I miss something?
> # Grub2 is kind of special: it considers CC, LD and so on to be the
> # tools to build the native tools (i.e to be executed on the build
> # machine), and uses TARGET_CC, TARGET_CFLAGS, TARGET_CPPFLAGS,
> -# TARGET_LDFLAGS to build the bootloader itself. However, to add to
> -# the confusion, it also uses NM, OBJCOPY and STRIP to build the
> -# bootloader itself; none of these are used to build the native
> -# tools.
> +# TARGET_LDFLAGS to build the bootloader itself.
It is not clear to me what is happening now: you no longer pass
HOST_CONFIGURE_OPTS in GRUB2_CONF_ENV, but we continue to pass
TARGET_CC/TARGET_CFLAGS/TARGET_CPPFLAGS, etc.
So at the very least, the comment needs to be updated.
> #
> # NOTE: TARGET_STRIP is overridden by BR2_STRIP_none, so always
> # use the cross compile variant to ensure grub2 builds
>
> GRUB2_CONF_ENV = \
> - $(HOST_CONFIGURE_OPTS) \
> - CPP="$(HOSTCC) -E" \
> + CPP="$(TARGET_CC) -E" \
> TARGET_CC="$(TARGET_CC)" \
> TARGET_CFLAGS="$(TARGET_CFLAGS)" \
> TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \
> TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
> - NM="$(TARGET_NM)" \
> - OBJCOPY="$(TARGET_OBJCOPY)" \
> - STRIP="$(TARGET_CROSS)strip"
> + TARGET_NM="$(TARGET_NM)" \
> + TARGET_OBJCOPY="$(TARGET_OBJCOPY)" \
> + TARGET_STRIP="$(TARGET_CROSS)strip"
This is the part that confuses me.
> diff --git a/package/grub2-tools/grub2-tools.mk b/package/grub2-tools/grub2-tools.mk
> index 8bf1a31..f98f4aa 100644
> --- a/package/grub2-tools/grub2-tools.mk
> +++ b/package/grub2-tools/grub2-tools.mk
> @@ -10,6 +10,10 @@ GRUB2_TOOLS_SOURCE = grub-$(GRUB2_VERSION).tar.xz
> GRUB2_TOOLS_LICENSE = GPLv3+
> GRUB2_TOOLS_LICENSE_FILES = COPYING
> GRUB2_TOOLS_DEPENDENCIES = host-bison host-flex
> +HOST_GRUB2_TOOLS_DEPENDENCIES = host-bison host-flex
> +
> +HOST_GRUB2_TOOLS_CONF_ENV = \
> + CPP="$(HOSTCC) -E"
>
> GRUB2_TOOLS_CONF_ENV = \
> CPP="$(TARGET_CC) -E" \
> @@ -29,4 +33,7 @@ GRUB2_TOOLS_CONF_OPTS = \
> --enable-libzfs=no \
> --disable-werror
>
> +HOST_GRUB2_TOOLS_CONF_OPTS = $(GRUB2_TOOLS_CONF_OPTS)
> +
> $(eval $(autotools-package))
> +$(eval $(host-autotools-package))
Perhaps adding a host variant for the grub2-tools package could have
been a separate patch. But that's not a big deal, the above
questions/comments are much more important.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 4/8] grub2: enable support for arm and aarch64 targets
2017-04-26 21:39 ` [Buildroot] [PATCH v2 4/8] grub2: enable support for arm and aarch64 targets Erico Nunes
@ 2017-07-16 13:41 ` Thomas Petazzoni
0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2017-07-16 13:41 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 26 Apr 2017 23:39:49 +0200, Erico Nunes wrote:
> These targets have been tested in the following environments:
>
> arm-uboot: qemu arm vexpress and BeagleBone
> arm-efi: BeagleBone
> aarch64-efi: qemu aarch64 virt and Odroid-C2
It would be nice to create some tests in the runtime tests
infrastructure to test Grub2 on ARM/ARM64. We already test it on x86
through the ISO9660 tests.
But OK, this can be added at a later point.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH v2 3/8] grub2: use grub2-tools as a host package
2017-07-16 13:39 ` Thomas Petazzoni
@ 2017-08-11 16:39 ` Erico Nunes
0 siblings, 0 replies; 14+ messages in thread
From: Erico Nunes @ 2017-08-11 16:39 UTC (permalink / raw)
To: buildroot
Thanks for the review and sorry for the late reply as well.
I plan to respin this soon to be reviewed (for 2017.11 now).
On Sun, Jul 16, 2017 at 3:39 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
>> diff --git a/boot/grub2/grub2.mk b/boot/grub2/grub2.mk
>> index 171829d..f0bd2ee 100644
>> --- a/boot/grub2/grub2.mk
>> +++ b/boot/grub2/grub2.mk
>> @@ -9,7 +9,9 @@ GRUB2_SITE = http://ftp.gnu.org/gnu/grub
>> GRUB2_SOURCE = grub-$(GRUB2_VERSION).tar.xz
>> GRUB2_LICENSE = GPL-3.0+
>> GRUB2_LICENSE_FILES = COPYING
>> -GRUB2_DEPENDENCIES = host-bison host-flex
>> +GRUB2_DEPENDENCIES = host-bison host-flex host-grub2-tools
>
> Do we still need to depend on host-bison and host-flex, now that the
> tools are built by as part of host-grub2-tools ?
I'm not sure who actually needs host-bison or host-flex, if we prefer
to rely on the transitivity I can drop them here and it will continue
working.
> Also, what in boot/grub2/grub2.mk ensures that the tools are *not*
> built ?
>
>> +GRUB2_INSTALL_TARGET = NO
>
> Grub really doesn't install anything to the target ? I thought it
> installed some modules in /usr/lib/grub2 or something like that, that
> grub2 could load dynamically at runtime. Did I miss something?
With the split, grub2-tools started to install the modules to e.g.
/usr/lib/grub/arm64-efi/*.mod. So you are right, and I had not
realized that.
Note that these modules are not needed to boot in the simplest case
though, enabling only grub2 with this patch still results in a
bootable system, at least for our cases in readme.txt.
My first thought now is that these modules should be kept being
installed by grub2 and not be moved to grub2-tools, so I'll revisit
this. Maybe to make it simpler we could drop grub2-tools (target) and
only keep host-grub2-tools? The downside is that the installation of
the grub2 user space tools in the target would end up being not
optional.
>> # Grub2 is kind of special: it considers CC, LD and so on to be the
>> # tools to build the native tools (i.e to be executed on the build
>> # machine), and uses TARGET_CC, TARGET_CFLAGS, TARGET_CPPFLAGS,
>> -# TARGET_LDFLAGS to build the bootloader itself. However, to add to
>> -# the confusion, it also uses NM, OBJCOPY and STRIP to build the
>> -# bootloader itself; none of these are used to build the native
>> -# tools.
>> +# TARGET_LDFLAGS to build the bootloader itself.
>
> It is not clear to me what is happening now: you no longer pass
> HOST_CONFIGURE_OPTS in GRUB2_CONF_ENV, but we continue to pass
> TARGET_CC/TARGET_CFLAGS/TARGET_CPPFLAGS, etc.
>
> So at the very least, the comment needs to be updated.
>
>> #
>> # NOTE: TARGET_STRIP is overridden by BR2_STRIP_none, so always
>> # use the cross compile variant to ensure grub2 builds
>>
>> GRUB2_CONF_ENV = \
>> - $(HOST_CONFIGURE_OPTS) \
>> - CPP="$(HOSTCC) -E" \
>> + CPP="$(TARGET_CC) -E" \
>> TARGET_CC="$(TARGET_CC)" \
>> TARGET_CFLAGS="$(TARGET_CFLAGS)" \
>> TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \
>> TARGET_LDFLAGS="$(TARGET_LDFLAGS)" \
>> - NM="$(TARGET_NM)" \
>> - OBJCOPY="$(TARGET_OBJCOPY)" \
>> - STRIP="$(TARGET_CROSS)strip"
>> + TARGET_NM="$(TARGET_NM)" \
>> + TARGET_OBJCOPY="$(TARGET_OBJCOPY)" \
>> + TARGET_STRIP="$(TARGET_CROSS)strip"
>
> This is the part that confuses me.
This is to intentionally build everything for the target, and leave
anything that has to be built for the host to host-grub2-tools.
I can check if we can drop more of these variables. I was hoping here
to change as little as possible to keep this working and not to have
an even more complex patchset, so that we could continue with a
cleanup on this in further patches.
>> diff --git a/package/grub2-tools/grub2-tools.mk b/package/grub2-tools/grub2-tools.mk
>> index 8bf1a31..f98f4aa 100644
>> --- a/package/grub2-tools/grub2-tools.mk
>> +++ b/package/grub2-tools/grub2-tools.mk
>> @@ -10,6 +10,10 @@ GRUB2_TOOLS_SOURCE = grub-$(GRUB2_VERSION).tar.xz
>> GRUB2_TOOLS_LICENSE = GPLv3+
>> GRUB2_TOOLS_LICENSE_FILES = COPYING
>> GRUB2_TOOLS_DEPENDENCIES = host-bison host-flex
>> +HOST_GRUB2_TOOLS_DEPENDENCIES = host-bison host-flex
>> +
>> +HOST_GRUB2_TOOLS_CONF_ENV = \
>> + CPP="$(HOSTCC) -E"
>>
>> GRUB2_TOOLS_CONF_ENV = \
>> CPP="$(TARGET_CC) -E" \
>> @@ -29,4 +33,7 @@ GRUB2_TOOLS_CONF_OPTS = \
>> --enable-libzfs=no \
>> --disable-werror
>>
>> +HOST_GRUB2_TOOLS_CONF_OPTS = $(GRUB2_TOOLS_CONF_OPTS)
>> +
>> $(eval $(autotools-package))
>> +$(eval $(host-autotools-package))
>
> Perhaps adding a host variant for the grub2-tools package could have
> been a separate patch. But that's not a big deal, the above
> questions/comments are much more important.
I can do this for v3.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2017-08-11 16:39 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-26 21:39 [Buildroot] [PATCH v2 0/8] grub2: bump and add support for arm and aarch64 Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 1/8] grub2: bump up version Erico Nunes
2017-07-16 13:09 ` Thomas Petazzoni
2017-04-26 21:39 ` [Buildroot] [PATCH v2 2/8] grub2-tools: new package Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 3/8] grub2: use grub2-tools as a host package Erico Nunes
2017-07-16 13:39 ` Thomas Petazzoni
2017-08-11 16:39 ` Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 4/8] grub2: enable support for arm and aarch64 targets Erico Nunes
2017-07-16 13:41 ` Thomas Petazzoni
2017-04-26 21:39 ` [Buildroot] [PATCH v2 5/8] grub2: introduce BR2_TARGET_GRUB2_CFG Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 6/8] grub2: move usage notes to package readme.txt Erico Nunes
2017-07-16 13:33 ` Thomas Petazzoni
2017-04-26 21:39 ` [Buildroot] [PATCH v2 7/8] grub2: add usage notes for Grub 2 ARM and aarch64 Erico Nunes
2017-04-26 21:39 ` [Buildroot] [PATCH v2 8/8] linux: new Image.gz format for aarch64 Erico Nunes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox