2013-06-06 23:54:13 +02:00
|
|
|
################################################################################
|
2005-06-23 07:09:05 +02:00
|
|
|
#
|
|
|
|
# grub
|
|
|
|
#
|
2013-06-06 23:54:13 +02:00
|
|
|
################################################################################
|
2006-03-18 14:07:29 +01:00
|
|
|
|
2011-07-05 21:54:05 +02:00
|
|
|
GRUB_VERSION = 0.97
|
|
|
|
GRUB_SOURCE = grub_$(GRUB_VERSION).orig.tar.gz
|
.mk files: bulk aligment and whitespace cleanup of assignments
The Buildroot coding style defines one space around make assignments and
does not align the assignment symbols.
This patch does a bulk fix of offending packages. The package
infrastructures (or more in general assignments to calculated variable
names, like $(2)_FOO) are not touched.
Alignment of line continuation characters (\) is kept as-is.
The sed command used to do this replacement is:
find * -name "*.mk" | xargs sed -i \
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*$#\1 \2#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\]\+\)$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\s*\([^\\ \t]\+\s*\\\)\s*$#\1 \2 \3#'
-e 's#^\([A-Z0-9a-z_]\+\)\s*\([?:+]\?=\)\(\s*\\\)#\1 \2\3#'
Brief explanation of this command:
^\([A-Z0-9a-z_]\+\) a regular variable at the beginning of the line
\([?:+]\?=\) any assignment character =, :=, ?=, +=
\([^\\]\+\) any string not containing a line continuation
\([^\\ \t]\+\s*\\\) string, optional whitespace, followed by a
line continuation character
\(\s*\\\) optional whitespace, followed by a line
continuation character
Hence, the first subexpression handles empty assignments, the second
handles regular assignments, the third handles regular assignments with
line continuation, and the fourth empty assignments with line
continuation.
This expression was tested on following test text: (initial tab not
included)
FOO = spaces before
FOO = spaces before and after
FOO = tab before
FOO = tab and spaces before
FOO = tab after
FOO = tab and spaces after
FOO = spaces and tab after
FOO = \
FOO = bar \
FOO = bar space \
FOO = \
GENIMAGE_DEPENDENCIES = host-pkgconf libconfuse
FOO += spaces before
FOO ?= spaces before and after
FOO :=
FOO =
FOO =
FOO =
FOO =
$(MAKE1) CROSS_COMPILE=$(TARGET_CROSS) -C
AT91BOOTSTRAP3_DEFCONFIG = \
AXEL_DISABLE_I18N=--i18n=0
After this bulk change, following manual fixups were done:
- fix line continuation alignment in cegui06 and spice (the sed
expression leaves the number of whitespace between the value and line
continuation character intact, but the whitespace before that could have
changed, causing misalignment.
- qt5base was reverted, as this package uses extensive alignment which
actually makes the code more readable.
Finally, the end result was manually reviewed.
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Cc: Yann E. Morin <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-07 09:06:03 +02:00
|
|
|
GRUB_PATCH = grub_$(GRUB_VERSION)-67.diff.gz
|
|
|
|
GRUB_SITE = http://snapshot.debian.org/archive/debian/20130129T225227Z/pool/main/g/grub
|
2007-01-29 19:34:37 +01:00
|
|
|
|
2012-08-18 11:25:38 +02:00
|
|
|
GRUB_LICENSE = GPLv2+
|
|
|
|
GRUB_LICENSE_FILES = COPYING
|
|
|
|
|
2013-11-11 17:47:28 +01:00
|
|
|
# Passing -O0 since the default -O2 passed by Buildroot generates
|
|
|
|
# non-working stage2. Passing --build-id=none to the linker, because
|
|
|
|
# the ".note.gnu.build-id" ELF sections generated by default confuse
|
|
|
|
# objcopy when generating raw binaries. Passing -fno-stack-protector
|
|
|
|
# to avoid undefined references to __stack_chk_fail.
|
|
|
|
GRUB_CFLAGS = \
|
|
|
|
-DSUPPORT_LOOPDEV \
|
|
|
|
-O0 -Wl,--build-id=none \
|
|
|
|
-fno-stack-protector
|
2006-11-29 21:26:05 +01:00
|
|
|
|
2013-12-28 15:56:38 +01:00
|
|
|
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_SPLASH),--enable-graphics,--disable-graphics)
|
|
|
|
|
2007-01-29 19:34:37 +01:00
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_DISKLESS) += --enable-diskless
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_3c595) += --enable-3c595
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_3c90x) += --enable-3c90x
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_davicom) += --enable-davicom
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_e1000) += --enable-e1000
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_eepro100) += --enable-eepro100
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_epic100) += --enable-epic100
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_forcedeth) += --enable-forcedeth
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_natsemi) += --enable-natsemi
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_ns83820) += --enable-ns83820
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_ns8390) += --enable-ns8390
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_pcnet32) += --enable-pcnet32
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_pnic) += --enable-pnic
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_rtl8139) += --enable-rtl8139
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_r8169) += --enable-r8169
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_sis900) += --enable-sis900
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_tg3) += --enable-tg3
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_tulip) += --enable-tulip
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_tlan) += --enable-tlan
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_undi) += --enable-undi
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_via_rhine) += --enable-via-rhine
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_w89c840) += --enable-w89c840
|
|
|
|
|
grub: replace string option for filesystem selection by booleans
In 1cece2813bf635ae29e9a8287322439b9c5992f7 (grub: add option to
configure the list of supported filesystems), we introduced the
BR2_TARGET_GRUB_FS_SUPPORT option which allows to provide a
space-separated list of filesystems that Grub should support.
However, it turns out that this not very practical, because the
iso9660 filesystem logic in Buildroot should force the ISO9660 support
to be enabled in Grub, which is not easy to do with a string option.
Therefore, this patch changes this option from a string option to a
list of boolean option, one per filesystem supported.
A few useful details:
- Since Grub legacy is dead, the list of filesystem, and therefore
the number of options, will not grow.
- We have only added options for filesystems that are likely to be
used in an embedded Linux context. Filesystems such as VSTAfs,
Minix, UFS2 or FFS2 are not supported.
- There is no need to add some Config.in.legacy support for the
previous option, since it was added after Buildroot 2013.11, and
was therefore never part of an official Buildroot release.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-12-28 15:56:34 +01:00
|
|
|
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_EXT2),--enable-ext2fs,--disable-ext2fs)
|
|
|
|
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_FAT),--enable-fat,--disable-fat)
|
|
|
|
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_ISO9660),--enable-iso9660,--disable-iso9660)
|
|
|
|
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_JFS),--enable-jfs,--disable-jfs)
|
|
|
|
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_REISERFS),--enable-reiserfs,--disable-reiserfs)
|
|
|
|
GRUB_CONFIG-y += $(if $(BR2_TARGET_GRUB_FS_XFS),--enable-xfs,--disable-xfs)
|
|
|
|
GRUB_CONFIG-y += --disable-ffs --disable-ufs2 --disable-minix --disable-vstafs
|
2013-11-11 17:47:33 +01:00
|
|
|
|
grub: replace string option for filesystem selection by booleans
In 1cece2813bf635ae29e9a8287322439b9c5992f7 (grub: add option to
configure the list of supported filesystems), we introduced the
BR2_TARGET_GRUB_FS_SUPPORT option which allows to provide a
space-separated list of filesystems that Grub should support.
However, it turns out that this not very practical, because the
iso9660 filesystem logic in Buildroot should force the ISO9660 support
to be enabled in Grub, which is not easy to do with a string option.
Therefore, this patch changes this option from a string option to a
list of boolean option, one per filesystem supported.
A few useful details:
- Since Grub legacy is dead, the list of filesystem, and therefore
the number of options, will not grow.
- We have only added options for filesystems that are likely to be
used in an embedded Linux context. Filesystems such as VSTAfs,
Minix, UFS2 or FFS2 are not supported.
- There is no need to add some Config.in.legacy support for the
previous option, since it was added after Buildroot 2013.11, and
was therefore never part of an official Buildroot release.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2013-12-28 15:56:34 +01:00
|
|
|
GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_EXT2),e2fs)
|
|
|
|
GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_FAT),fat)
|
|
|
|
GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_ISO9660),iso9660)
|
|
|
|
GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_JFS),jfs)
|
|
|
|
GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_REISERFS),reiserfs)
|
|
|
|
GRUB_STAGE_1_5_TO_INSTALL += $(if $(BR2_TARGET_GRUB_FS_XFS),xfs)
|
2013-11-11 17:47:33 +01:00
|
|
|
|
2011-07-05 21:54:05 +02:00
|
|
|
define GRUB_DEBIAN_PATCHES
|
|
|
|
# Apply the patches from the Debian patch
|
2013-12-04 22:11:00 +01:00
|
|
|
(cd $(@D) ; for f in `cat debian/patches/series | grep -v ^#` ; do \
|
2011-11-26 21:56:25 +01:00
|
|
|
cat debian/patches/$$f | patch -g0 -p1 ; \
|
2011-07-05 21:54:05 +02:00
|
|
|
done)
|
|
|
|
endef
|
2005-06-23 07:09:05 +02:00
|
|
|
|
2011-07-05 21:54:05 +02:00
|
|
|
GRUB_POST_PATCH_HOOKS += GRUB_DEBIAN_PATCHES
|
2005-06-23 07:09:05 +02:00
|
|
|
|
2011-07-05 21:54:05 +02:00
|
|
|
GRUB_CONF_ENV = \
|
2013-11-11 17:47:28 +01:00
|
|
|
$(HOST_CONFIGURE_OPTS) \
|
2013-12-04 20:33:50 +01:00
|
|
|
CFLAGS="$(HOST_CFLAGS) $(GRUB_CFLAGS) -m32"
|
2005-06-23 07:09:05 +02:00
|
|
|
|
2014-09-27 21:32:44 +02:00
|
|
|
GRUB_CONF_OPTS = \
|
2011-07-05 21:54:05 +02:00
|
|
|
--disable-auto-linux-mem-opt \
|
|
|
|
$(GRUB_CONFIG-y)
|
2005-06-23 07:09:05 +02:00
|
|
|
|
2007-01-29 19:34:37 +01:00
|
|
|
ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
|
2011-07-05 21:54:05 +02:00
|
|
|
define GRUB_INSTALL_SPLASH
|
|
|
|
cp boot/grub/splash.xpm.gz $(TARGET_DIR)/boot/grub/
|
2013-12-29 18:33:47 +01:00
|
|
|
endef
|
|
|
|
else
|
|
|
|
define GRUB_INSTALL_SPLASH
|
|
|
|
$(SED) '/^splashimage/d' $(TARGET_DIR)/boot/grub/menu.lst
|
2011-07-05 21:54:05 +02:00
|
|
|
endef
|
2007-01-29 19:34:37 +01:00
|
|
|
endif
|
2005-06-23 07:09:05 +02:00
|
|
|
|
2013-11-11 17:47:28 +01:00
|
|
|
# We're cheating here as we're installing the grub binary not in the
|
|
|
|
# target directory (where it is useless), but in the host
|
|
|
|
# directory. This grub binary can be used to install grub into the MBR
|
|
|
|
# of a disk or disk image.
|
|
|
|
|
2011-07-05 21:54:05 +02:00
|
|
|
define GRUB_INSTALL_TARGET_CMDS
|
2013-11-11 17:47:28 +01:00
|
|
|
install -m 0755 -D $(@D)/grub/grub $(HOST_DIR)/sbin/grub
|
2011-07-05 21:54:05 +02:00
|
|
|
mkdir -p $(TARGET_DIR)/boot/grub
|
|
|
|
cp $(@D)/stage1/stage1 $(TARGET_DIR)/boot/grub
|
2013-11-11 17:47:33 +01:00
|
|
|
for f in $(GRUB_STAGE_1_5_TO_INSTALL) ; do \
|
|
|
|
cp $(@D)/stage2/$${f}_stage1_5 $(TARGET_DIR)/boot/grub ; \
|
|
|
|
done
|
2011-07-05 21:54:05 +02:00
|
|
|
cp $(@D)/stage2/stage2 $(TARGET_DIR)/boot/grub
|
2013-11-11 17:47:31 +01:00
|
|
|
cp boot/grub/menu.lst $(TARGET_DIR)/boot/grub
|
2011-07-05 21:54:05 +02:00
|
|
|
$(GRUB_INSTALL_SPLASH)
|
|
|
|
endef
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(autotools-package))
|