2005-06-23 07:09:05 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# grub
|
|
|
|
#
|
|
|
|
#############################################################
|
2006-03-10 09:06:27 +01:00
|
|
|
GRUB_SOURCE:=grub_0.97.orig.tar.gz
|
2009-01-31 13:29:55 +01:00
|
|
|
GRUB_PATCH:=grub_0.97-35.diff.gz
|
|
|
|
GRUB_SITE:=http://snapshot.debian.net/archive/2008/03/29/debian/pool/main/g/grub/
|
2008-04-03 11:28:56 +02:00
|
|
|
GRUB_PATCH_SITE:=$(GRUB_SITE)
|
2006-10-01 17:17:52 +02:00
|
|
|
GRUB_CAT:=$(ZCAT)
|
2006-03-10 09:06:27 +01:00
|
|
|
GRUB_DIR:=$(BUILD_DIR)/grub-0.97
|
2005-06-23 07:09:05 +02:00
|
|
|
GRUB_BINARY:=grub/grub
|
2007-02-04 17:34:56 +01:00
|
|
|
GRUB_TARGET_BINARY:=sbin/grub
|
2010-03-15 23:48:48 +01:00
|
|
|
GRUB_SPLASHIMAGE=$(TOPDIR)/boot/grub/splash.xpm.gz
|
2006-03-18 14:07:29 +01:00
|
|
|
|
2007-01-29 19:34:37 +01:00
|
|
|
|
|
|
|
GRUB_CFLAGS=-DSUPPORT_LOOPDEV
|
2006-11-29 21:26:05 +01:00
|
|
|
ifeq ($(BR2_LARGEFILE),)
|
|
|
|
GRUB_CFLAGS+=-U_FILE_OFFSET_BITS
|
|
|
|
endif
|
|
|
|
|
2007-01-29 19:34:37 +01:00
|
|
|
|
|
|
|
GRUB_CONFIG-$(BR2_TARGET_GRUB_SPLASH) += --enable-graphics
|
|
|
|
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
|
|
|
|
|
2005-06-23 07:09:05 +02:00
|
|
|
$(DL_DIR)/$(GRUB_SOURCE):
|
2009-01-16 12:48:43 +01:00
|
|
|
$(call DOWNLOAD,$(GRUB_SITE),$(GRUB_SOURCE))
|
2005-06-23 07:09:05 +02:00
|
|
|
|
|
|
|
$(DL_DIR)/$(GRUB_PATCH):
|
2009-01-16 12:48:43 +01:00
|
|
|
$(call DOWNLOAD,$(GRUB_PATCH_SITE),$(GRUB_PATCH))
|
2005-06-23 07:09:05 +02:00
|
|
|
|
|
|
|
grub-source: $(DL_DIR)/$(GRUB_SOURCE) $(DL_DIR)/$(GRUB_PATCH)
|
|
|
|
|
|
|
|
$(GRUB_DIR)/.unpacked: $(DL_DIR)/$(GRUB_SOURCE) $(DL_DIR)/$(GRUB_PATCH)
|
|
|
|
$(GRUB_CAT) $(DL_DIR)/$(GRUB_SOURCE) | tar -C $(BUILD_DIR) -xvf -
|
2007-01-29 19:34:37 +01:00
|
|
|
toolchain/patch-kernel.sh $(GRUB_DIR) $(DL_DIR) $(GRUB_PATCH)
|
2006-03-18 14:07:29 +01:00
|
|
|
for i in `grep -v "^#" $(GRUB_DIR)/debian/patches/00list`; do \
|
2005-06-23 07:09:05 +02:00
|
|
|
cat $(GRUB_DIR)/debian/patches/$$i | patch -p1 -d $(GRUB_DIR); \
|
|
|
|
done
|
2010-03-14 18:20:45 +01:00
|
|
|
toolchain/patch-kernel.sh $(GRUB_DIR) boot/grub grub.\*.patch{,.bz2}
|
2007-01-29 19:34:37 +01:00
|
|
|
touch $@
|
2005-06-23 07:09:05 +02:00
|
|
|
|
|
|
|
$(GRUB_DIR)/.configured: $(GRUB_DIR)/.unpacked
|
|
|
|
(cd $(GRUB_DIR); rm -rf config.cache; \
|
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
CFLAGS="$(TARGET_CFLAGS)" \
|
|
|
|
CPPFLAGS="$(GRUB_CFLAGS)" \
|
2009-10-01 21:24:42 +02:00
|
|
|
./configure $(QUIET) \
|
2005-06-23 07:09:05 +02:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--prefix=/ \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--infodir=/usr/info \
|
|
|
|
--disable-auto-linux-mem-opt \
|
2007-01-29 19:34:37 +01:00
|
|
|
$(GRUB_CONFIG-y) \
|
2007-08-22 11:56:41 +02:00
|
|
|
)
|
2007-02-04 17:34:56 +01:00
|
|
|
touch $@
|
2005-06-23 07:09:05 +02:00
|
|
|
|
|
|
|
$(GRUB_DIR)/$(GRUB_BINARY): $(GRUB_DIR)/.configured
|
2010-07-06 09:27:32 +02:00
|
|
|
$(MAKE) CC="$(TARGET_CC)" -C $(GRUB_DIR)
|
2007-09-30 20:06:32 +02:00
|
|
|
rm -f $(GRUB_DIR)/$(GRUB_BINARY)
|
2010-07-06 09:27:32 +02:00
|
|
|
$(MAKE) CC="$(TARGET_CC)" CFLAGS+=-static -C $(GRUB_DIR)/grub grub
|
2007-09-30 20:06:32 +02:00
|
|
|
mkdir -p $(dir $(STAGING_DIR)/$(GRUB_TARGET_BINARY))
|
|
|
|
mv $(GRUB_DIR)/$(GRUB_BINARY) $(STAGING_DIR)/$(GRUB_TARGET_BINARY).static
|
2010-07-06 09:27:32 +02:00
|
|
|
$(MAKE) CC="$(TARGET_CC)" -C $(GRUB_DIR)/grub
|
2005-06-23 07:09:05 +02:00
|
|
|
|
2007-02-04 17:34:56 +01:00
|
|
|
$(GRUB_DIR)/.installed: $(GRUB_DIR)/$(GRUB_BINARY)
|
|
|
|
cp $(GRUB_DIR)/$(GRUB_BINARY) $(TARGET_DIR)/$(GRUB_TARGET_BINARY)
|
2006-11-17 12:47:04 +01:00
|
|
|
test -d $(TARGET_DIR)/boot/grub || mkdir -p $(TARGET_DIR)/boot/grub
|
|
|
|
cp $(GRUB_DIR)/stage1/stage1 $(GRUB_DIR)/stage2/*1_5 $(GRUB_DIR)/stage2/stage2 $(TARGET_DIR)/boot/grub/
|
2007-01-29 19:34:37 +01:00
|
|
|
ifeq ($(BR2_TARGET_GRUB_SPLASH),y)
|
|
|
|
test -f $(TARGET_DIR)/boot/grub/$(GRUB_SPLASHIMAGE) || \
|
|
|
|
cp $(GRUB_SPLASHIMAGE) $(TARGET_DIR)/boot/grub/
|
|
|
|
endif
|
2007-02-04 17:34:56 +01:00
|
|
|
touch $@
|
2005-06-23 07:09:05 +02:00
|
|
|
|
2010-03-15 23:28:40 +01:00
|
|
|
grub: $(GRUB_DIR)/.installed
|
2005-06-23 07:09:05 +02:00
|
|
|
|
|
|
|
grub-clean:
|
2010-07-06 09:27:32 +02:00
|
|
|
$(MAKE) DESTDIR=$(TARGET_DIR) CC="$(TARGET_CC)" -C $(GRUB_DIR) uninstall
|
2006-11-29 13:17:26 +01:00
|
|
|
-$(MAKE) -C $(GRUB_DIR) clean
|
2007-01-29 19:34:37 +01:00
|
|
|
rm -f $(TARGET_DIR)/boot/grub/$(GRUB_SPLASHIMAGE) \
|
|
|
|
$(TARGET_DIR)/sbin/$(GRUB_BINARY) \
|
|
|
|
$(TARGET_DIR)/boot/grub/{stage{1,2},*1_5}
|
2005-06-23 07:09:05 +02:00
|
|
|
|
|
|
|
grub-dirclean:
|
|
|
|
rm -rf $(GRUB_DIR)
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-12-08 09:15:58 +01:00
|
|
|
ifeq ($(BR2_TARGET_GRUB),y)
|
2005-06-23 07:09:05 +02:00
|
|
|
TARGETS+=grub
|
|
|
|
endif
|