Commit Graph

40 Commits

Author SHA1 Message Date
Erico Nunes
2a27294e9a grub2: force -fno-stack-protector in CFLAGS
grub2 fails to configure when BR2_SSP_ALL is enabled, with the following
configure error:

  checking whether -fno-asynchronous-unwind-tables works... yes
  checking whether -fno-unwind-tables works... yes
  checking for target linking format... unknown
  configure: error: no suitable link format found

This can be worked around by enforcing -fno-stack-protector in the
package CFLAGS in a way that overrides the SSP flag, as is already done
for the valgrind package.

Fixes bug #10261.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reported-by: Dr I J Ormshaw <ian_ormshaw@waters.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-08-30 22:09:21 +02:00
Erico Nunes
0802ede021 grub2: move usage notes to package readme.txt
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>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-16 15:25:27 +02:00
Erico Nunes
5ffafd2353 grub2: bump up version
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.

Since we're adding a Config.in comment, we also introduce a
BR2_TARGET_GRUB2_ARCH_SUPPORTS hidden boolean, in order to avoid
repeating the architecture dependencies.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Thomas: add BR2_TARGET_GRUB2_ARCH_SUPPORTS, remove bogus dependencies
on ARM and AArch64, since enabling Grub2 on those architectures is
done in another commit.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-16 14:55:33 +02:00
Arnout Vandecappelle
6895400fd2 grub2: install in $(HOST_DIR) instead of $(HOST_DIR)/usr
grub2 builds for the target but installs with DESTDIR=$(HOST_DIR). Since
we set prefix to /usr in TARGET_CONF_OPTS, this results in installing
things in $(HOST_DIR)/usr.

To make sure we don't install in $(HOST_DIR)/usr, override --prefix and
--exec-prefix.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-05 16:06:47 +02:00
Arnout Vandecappelle
d3a59d8e66 grub2: remove host/usr reference from help text
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-05 16:06:29 +02:00
Arnout Vandecappelle
19ba17ee3b Globally replace $(HOST_DIR)/usr/lib with $(HOST_DIR)/lib
Since things are no longer installed in $(HOST_DIR)/usr, the callers
should also not refer to it.

This is a mechanical change with
git grep -l '$(HOST_DIR)/usr/lib' | xargs sed -i 's%$(HOST_DIR)/usr/lib%$(HOST_DIR)/lib%g'

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-05 15:20:05 +02:00
Arnout Vandecappelle
0f9c0bf3d5 Globally replace $(HOST_DIR)/usr/bin with $(HOST_DIR)/bin
Since things are no longer installed in $(HOST_DIR)/usr, the callers
should also not refer to it.

This is a mechanical change with
git grep -l '$(HOST_DIR)/usr/bin' | xargs sed -i 's%$(HOST_DIR)/usr/bin%$(HOST_DIR)/bin%g'

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-05 15:19:29 +02:00
Yann E. MORIN
0d643fd3e8 core: change the strip command from a choice to a boolean
Curently, we have a choice to select between stripping and not
stripping. This is legacy code from back when we had a third option,
sstrip (super-strip).

Since we removed sstrip, stripping or not stripping is now just a
boolean rather than a choice.

Make it so.

We make BR2_STRIP_strip default to 'y' to keep the current behaviour of
defaulting to stripping.

Move BR2_STIP_none to legacy, and instruct the user to review the new
setting.

Drop any reference to BR2_STRIP_none in comments.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-07-01 15:07:25 +02:00
Rahul Bedarkar
337aa51f3f boot, package: use SPDX short identifier for GPLv3/GPLv3+
We want to use SPDX identifier for license string as much as possible.
SPDX short identifier for GPLv3/GPLv3+ is GPL-3.0/GPL-3.0+.

This change is done using following command.
find . -name "*.mk" | xargs sed -ri '/LICENSE( )?[\+:]?=/s/\<GPLv3\>/GPL-3.0/g'

Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-04-01 15:17:59 +02:00
Charles Hardin
fc174b7057 grub2: fix build with BR2_STRIP_none
grub2 assumes the strip command will generate output and the output should
always be stripped - so, just use the $(TARGET_CROSS)strip to make sure that
the build succeeds regardless of the buildroot strip configuration.

Signed-off-by: Charles Hardin <ckhardin@exablox.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-07-31 20:19:40 +02:00
Thomas Petazzoni
4770c4ef83 grub2: add patch to fix build with recent gcc versions
This commit backports a patch from upstream grub2 that fixes a build
issue occuring at least with recent gcc versions:

gettext/gettext.c:37:36: error: storage size of 'main_context' isn't known
 static struct grub_gettext_context main_context, secondary_context;

Fixes bug #8991.

Bug reproduced with:

BR2_x86_64=y
BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_5=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_GCC_VERSION_6_X=y
BR2_TARGET_GRUB2=y
BR2_TARGET_GRUB2_X86_64_EFI=y
BR2_TARGET_GRUB2_BUILTIN_MODULES="boot linux ext2 fat squash4 part_msdos part_gpt normal efi_gop terminal"

and verified fixed after adding this patch.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-07-25 22:07:05 +02:00
Thomas Petazzoni
238761e390 grub2: rename patch with the proper naming convention
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-07-25 21:58:29 +02:00
Gilles Chanteperdrix
b64f7b7eee grub2: really disable liblzma
There is no option --enable-liblzma=no in grub2's configure script, so
the only way to disable liblzma support is to pass
ac_cv_lib_lzma_lzma_code=no.

Signed-off-by: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
[Thomas: expand commit log, as suggested by Yann E. Morin.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-06-15 23:01:18 +02:00
Gustavo Zacarias
09a44ddd44 boot/grub2: enable squashfs support by default
Size growth is minimal and generally a non-issue for x86-based
platforms.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-03-29 03:02:05 +02:00
Gustavo Zacarias
9284b4aa39 boot/grub2: add rootwait to default config
It doesn't hurt, and is useful for removable boot media like a pendrive
that may depend on usb enumeration and isn't available immediately.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2016-03-10 22:21:35 +01:00
Arnout Vandecappelle
890c9e761b grub2: pass target NM, OBJCOPY and STRIP
Fixes https://bugs.busybox.net/show_bug.cgi?id=8256

grub2's build system interprets CC, CFLAGS and CPPFLAGS as for the host
and uses TARGET_CC etc. for the target. However, NM, OBJCOPY and STRIP
are used for the target. We currently pass the host-versions of these
tools as part of $(HOST_CONFIGURE_OPTS).

While we're at it, also pass TARGET_LDFLAGS.

This problem had not been noticed up to now because usually we build on
an x86 machine for the x86 architecture, so the binutils are compatible.
However, this is not true on an i386 when building for x86_64.

Cc: Christophe Bricout <christophebricout@yahoo.fr>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-09-20 14:52:19 +02:00
Kinsella, Ray
8f609ed603 grub2: build El Torito image only for i386 PC platform
Building Grub2 El Torito for i386 EFI errors complaining it cannot
find cdboot.img

        cdboot.img: No such file or directory

This commit builds El Torito for i386 PC only.

[Thomas: fix installation ordering.]

Signed-off-by: Ray Kinsella <ray.kinsella@intel.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-29 17:03:15 +02:00
Thomas Petazzoni
8decd25477 grub2: prepare and install El Torito image
In order to support ISO9660 bootable images that rely on Grub 2, this
commit modifies thr Grub 2 makefile to generate and install an El
Torito image. Such an image is simply produced by concatenating the
cdboot.img provided by Grub 2, and the Grub 2 image generated by
Buildroot using grub-mkimage.

Since this action is so simple and cost-free, we don't bother adding a
Grub 2 sub-option for that, and simply generate the El Torito image
unconditionally.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-06-14 23:24:59 +02:00
Gustavo Zacarias
bf554b9602 grub2: add hash
Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-03-03 21:57:49 +01:00
Samuel Martin
fcc8d123ea bootlader/grub2: disable x86-64-efi choice on !BR2_ARCH_IS_64
When x86-64-efi platform is selected, grub2 automatically adds -m64 to the
CFLAGS. This makes the configure script failed when the toolchain does not
have multilib support (like the Buildroot ones).

Reported-by: Noe Rubinstein <nrubinstein@aldebaran-robotics.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-03 12:05:53 +01:00
Jerzy Grzegorek
1769933d98 package: indentation cleanup
Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-26 05:47:05 +01:00
Alvaro G. M
b5bd127857 grub2: modify kernel location to /boot/zImage
This is the location where buildroot install the image if requested,
so this should be the default search path for the bootloader.

Signed-off-by: Alvaro G. M <alvaro.gamez@hazent.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-11 14:55:20 +02:00
Thomas De Schampheleire
aaffd209fa packages: rename FOO_CONF_OPT into FOO_CONF_OPTS
To be consistent with the recent change of FOO_MAKE_OPT into FOO_MAKE_OPTS,
make the same change for FOO_CONF_OPT.

Sed command used:
   find * -type f | xargs sed -i 's#_CONF_OPT\>#&S#g'

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-04 18:54:16 +02:00
Thomas De Schampheleire
57f2b8d255 packages: rename FOO_INSTALL_TARGET_OPT into FOO_INSTALL_TARGET_OPTS
To be consistent with the recent change of FOO_MAKE_OPT into FOO_MAKE_OPTS,
make the same change for FOO_INSTALL_TARGET_OPT.

Sed command used:
   find * -type f | xargs sed -i 's#_INSTALL_TARGET_OPT\>#&S#g'

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-04 18:48:33 +02:00
Jerzy Grzegorek
c7f4b96471 package: remove the trailing slash sign from <PKG>_SITE variable
Since the trailing slash is stripped from $($(PKG)_SITE) by pkg-generic.mk:

$(call DOWNLOAD,$($(PKG)_SITE:/=)/$($(PKG)_SOURCE))

so it is redundant.
This patch removes it from $(PKG)_SITE variable for BR consistency.

Signed-off-by: Jerzy Grzegorek <jerzy.grzegorek@trzebnica.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-31 23:17:46 +02:00
Jérôme Pouiller
0fe134f082 grub2: add a tip to create disk image w/o root permission
[Thomas: minor fixes/improvements.]

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-23 23:42:28 +02:00
Thomas Petazzoni
a3ac2a6f58 grub2: fix a few minor issues in help text
The help text of grub2 explains the detailed steps to create a disk
image with grub2 installed on it. However, the steps for the
BIOS-based systems have a few minor issues fixed by this patch:

 - When calling partx to get the partitions detected, we should do it
   on the /dev/loop0 block device, and not on the underlying disk.img
   image file.
 - The grub-bios-setup utility must be called as root to work properly
   on /dev/loop0.
 - The steps to cleanup the partx and loop device were missing.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-15 20:09:11 +02:00
Jérôme Pouiller
8a5a57de1c grub2: Specify boot partition
Since boot partition was not specified, grub tools try to detect it
automatically. This patch add an option to force it.

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-07-02 10:59:01 +02:00
Dima Zavin
1f9a0b3815 grub2: add a configuration option to embed a config file
Add an option for embedding a config file directly in grub.

Signed-off-by: Dima Zavin <dmitriyz@google.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-04-20 17:48:46 +02:00
Thomas Petazzoni
c24fdb3680 grub2: add new package
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-19 23:28:04 +01:00
Thomas Petazzoni
a5dc0cdced grub2: remove package
Grub 2 has been marked BROKEN in June 2010, and nobody cared to fix it
since then.

At that time, it was marked broken because the build process needed a
Ruby interpreter available on the host, and it's really a pain that
building a bootloader needs such a thing.

I've tried to upgrade the package to Grub2 1.99-rcX, and now it does
not need a Ruby interpreter anymore, but instead requires a tool
called "autogen", which itself needs the Guile Scheme interpreter.

Since we haven't heard any complaints about Grub2 being marked broken,
and since it's such a pain to package, let's get rid of it. Of course,
anybody interested in Grub2 is invited to contribute a working
package.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-07-10 15:31:16 +02:00
Thomas Petazzoni
a1c8fa41f6 Update all packages to quote $(TARGET_CC)
Now that TARGET_CC contains several space-separated words, it must be
used quoted everywhere.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-07-07 08:20:21 +02:00
Thomas Petazzoni
38a88b6918 grub2: only available on x86 and PowerPC and mark as BROKEN
The build process of grub2 breaks the compilation. It breaks with:

./configure: line 4766: syntax error near unexpected token `external'
./configure: line 4766: `AM_GNU_GETTEXT(external)'

In addition to this, it later requires Ruby. Do we really want to make
Buildroot depend on Ruby being installed on the host ? Do we really
want to build our own Ruby ? Do we even care about Grub2 ?

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-12 13:38:44 +02:00
Thomas Petazzoni
1d73ef9449 grub2: remove non-existing options
Much of the grub2.mk seems to have been copy/pasted from
grub.mk. However, all the network/splashimage related ./configure
options do not exist in grub2.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-12 13:38:44 +02:00
Thomas Petazzoni
d36fbf1eda grub2: fix build
grub2 now builds fine, but some work remains to make it usable. What
should be installed exactly in the TARGET_DIR ? What is the
installation procedure and what should Buildroot do ?

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-12 13:38:43 +02:00
Thomas Petazzoni
7aaf4e8995 grub2: bump version
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-12 13:38:43 +02:00
Thomas Petazzoni
bff56ab548 grub/grub2: update splash image location
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-12 13:38:43 +02:00
Thomas Petazzoni
e6b73b6548 grub/grub2: drop unnecessary dependency on uclibc
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-12 13:38:43 +02:00
Thomas Petazzoni
399131e62b grub2: remove GRUB2_ARCH_SUPPORTED
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-12 13:38:42 +02:00
Thomas Petazzoni
649b5b9250 bootloaders: move bootloader build code to boot/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2010-06-10 21:05:12 +02:00