|
@@ -12,10 +12,15 @@ GRUB_SITE = http://snapshot.debian.org/archive/debian/20080329T000000Z/pool/ma
|
|
|
GRUB_LICENSE = GPLv2+
|
|
|
GRUB_LICENSE_FILES = COPYING
|
|
|
|
|
|
-GRUB_CFLAGS=-DSUPPORT_LOOPDEV
|
|
|
-ifeq ($(BR2_LARGEFILE),)
|
|
|
-GRUB_CFLAGS+=-U_FILE_OFFSET_BITS
|
|
|
-endif
|
|
|
+# 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
|
|
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_SPLASH) += --enable-graphics
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_DISKLESS) += --enable-diskless
|
|
@@ -51,24 +56,26 @@ endef
|
|
|
GRUB_POST_PATCH_HOOKS += GRUB_DEBIAN_PATCHES
|
|
|
|
|
|
GRUB_CONF_ENV = \
|
|
|
- CFLAGS="$(TARGET_CFLAGS) $(GRUB_CFLAGS)"
|
|
|
+ $(HOST_CONFIGURE_OPTS) \
|
|
|
+ CFLAGS="$(HOST_CFLAGS) $(GRUB_CFLAGS)"
|
|
|
|
|
|
GRUB_CONF_OPT = \
|
|
|
--disable-auto-linux-mem-opt \
|
|
|
$(GRUB_CONFIG-y)
|
|
|
|
|
|
-define GRUB_INSTALL_STAGING_CMDS
|
|
|
- install -m 0755 -D $(@D)/grub/grub $(STAGING_DIR)/sbin/grub
|
|
|
-endef
|
|
|
-
|
|
|
ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
|
|
|
define GRUB_INSTALL_SPLASH
|
|
|
cp boot/grub/splash.xpm.gz $(TARGET_DIR)/boot/grub/
|
|
|
endef
|
|
|
endif
|
|
|
|
|
|
+# 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.
|
|
|
+
|
|
|
define GRUB_INSTALL_TARGET_CMDS
|
|
|
- install -m 0755 -D $(@D)/grub/grub $(TARGET_DIR)/sbin/grub
|
|
|
+ install -m 0755 -D $(@D)/grub/grub $(HOST_DIR)/sbin/grub
|
|
|
mkdir -p $(TARGET_DIR)/boot/grub
|
|
|
cp $(@D)/stage1/stage1 $(TARGET_DIR)/boot/grub
|
|
|
cp $(@D)/stage2/*1_5 $(TARGET_DIR)/boot/grub
|
|
@@ -76,13 +83,4 @@ define GRUB_INSTALL_TARGET_CMDS
|
|
|
$(GRUB_INSTALL_SPLASH)
|
|
|
endef
|
|
|
|
|
|
-define GRUB_UNINSTALL_STAGING_CMDS
|
|
|
- rm -f $(STAGING_DIR)/sbin/grub
|
|
|
-endef
|
|
|
-
|
|
|
-define GRUB_UNINSTALL_TARGET_CMDS
|
|
|
- rm -f $(TARGET_DIR)/sbin/grub
|
|
|
- rm -rf $(TARGET_DIR)/boot/grub
|
|
|
-endef
|
|
|
-
|
|
|
$(eval $(autotools-package))
|