2007-06-27 23:03:42 +02:00
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# grub2
|
|
|
|
#
|
2010-03-16 21:27:46 +01:00
|
|
|
# TODO
|
|
|
|
#
|
|
|
|
# * grub2's autogen uses ruby, which isn't part of the core Debian
|
|
|
|
# installation. So either decide it is a requirement for Buildroot,
|
|
|
|
# or build it for the host.
|
|
|
|
#
|
|
|
|
# * improve the installation procedure. For the moment, it just
|
|
|
|
# installs everything in $(TARGET_DIR).
|
|
|
|
#
|
2007-06-27 23:03:42 +02:00
|
|
|
#############################################################
|
2010-03-15 23:58:19 +01:00
|
|
|
GRUB2_SOURCE:=grub2_1.98.orig.tar.gz
|
|
|
|
GRUB2_PATCH:=grub2_1.98-1.diff.gz
|
2007-12-27 13:00:12 +01:00
|
|
|
GRUB2_SITE=$(BR2_DEBIAN_MIRROR)/debian/pool/main/g/grub2
|
2010-03-15 23:58:19 +01:00
|
|
|
GRUB2_PATCH_SITE:=$(GRUB2_SITE)
|
2007-06-27 23:03:42 +02:00
|
|
|
GRUB2_CAT:=$(ZCAT)
|
2010-03-15 23:58:19 +01:00
|
|
|
GRUB2_DIR:=$(BUILD_DIR)/grub-1.98
|
2007-06-27 23:03:42 +02:00
|
|
|
|
|
|
|
GRUB2_CFLAGS=-DSUPPORT_LOOPDEV
|
|
|
|
ifeq ($(BR2_LARGEFILE),)
|
|
|
|
GRUB2_CFLAGS+=-U_FILE_OFFSET_BITS
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(DL_DIR)/$(GRUB2_SOURCE):
|
2009-01-16 12:48:43 +01:00
|
|
|
$(call DOWNLOAD,$(GRUB2_SITE),$(GRUB2_SOURCE))
|
2007-06-27 23:03:42 +02:00
|
|
|
|
|
|
|
$(DL_DIR)/$(GRUB2_PATCH):
|
2009-01-16 12:48:43 +01:00
|
|
|
$(call DOWNLOAD,$(GRUB2_PATCH_SITE),$(GRUB2_PATCH))
|
2007-06-27 23:03:42 +02:00
|
|
|
|
|
|
|
grub2-source: $(DL_DIR)/$(GRUB2_SOURCE) $(DL_DIR)/$(GRUB2_PATCH)
|
|
|
|
|
|
|
|
$(GRUB2_DIR)/.unpacked: $(DL_DIR)/$(GRUB2_SOURCE) $(DL_DIR)/$(GRUB2_PATCH)
|
2010-03-16 21:27:46 +01:00
|
|
|
mkdir -p $(@D)
|
|
|
|
$(GRUB2_CAT) $(DL_DIR)/$(GRUB2_SOURCE) | tar $(TAR_STRIP_COMPONENTS)=1 -C $(@D) -xvf -
|
|
|
|
toolchain/patch-kernel.sh $(@D) $(DL_DIR) $(GRUB2_PATCH)
|
|
|
|
for i in `grep -v "^#" $(@D)/debian/patches/00list`; do \
|
|
|
|
cat $(@D)/debian/patches/$$i | patch -p1 -d $(@D); \
|
2007-06-27 23:03:42 +02:00
|
|
|
done
|
2010-03-16 21:27:46 +01:00
|
|
|
toolchain/patch-kernel.sh $(@D) boot/grub2 grub-\*.patch
|
2007-06-27 23:03:42 +02:00
|
|
|
touch $@
|
|
|
|
|
|
|
|
$(GRUB2_DIR)/.configured: $(GRUB2_DIR)/.unpacked
|
|
|
|
(cd $(GRUB2_DIR); rm -rf config.cache; \
|
2010-03-16 21:27:46 +01:00
|
|
|
$(TARGET_CONFIGURE_OPTS) ; \
|
|
|
|
./autogen.sh ; \
|
2007-06-27 23:03:42 +02:00
|
|
|
$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
$(TARGET_CONFIGURE_ARGS) \
|
|
|
|
CPPFLAGS="$(GRUB2_CFLAGS)" \
|
|
|
|
grub_cv_i386_check_nested_functions=no \
|
2009-10-01 21:24:42 +02:00
|
|
|
./configure $(QUIET) \
|
2007-06-27 23:03:42 +02:00
|
|
|
--target=$(GNU_TARGET_NAME) \
|
|
|
|
--host=$(GNU_TARGET_NAME) \
|
|
|
|
--build=$(GNU_HOST_NAME) \
|
|
|
|
--prefix=/ \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--infodir=/usr/info \
|
2010-03-16 21:27:46 +01:00
|
|
|
--disable-grub-mkfont \
|
|
|
|
--disable-grub-fstest \
|
|
|
|
--disable-grub-emu-usb \
|
|
|
|
--disable-werror \
|
2007-06-27 23:03:42 +02:00
|
|
|
$(DISABLE_LARGEFILE) \
|
|
|
|
$(GRUB2_CONFIG-y) \
|
2007-08-22 11:56:41 +02:00
|
|
|
)
|
2007-06-27 23:03:42 +02:00
|
|
|
touch $@
|
|
|
|
|
2010-03-16 21:27:46 +01:00
|
|
|
$(GRUB2_DIR)/.compiled: $(GRUB2_DIR)/.configured
|
2010-07-06 09:27:32 +02:00
|
|
|
$(MAKE) CC="$(TARGET_CC)" -C $(@D)
|
2010-03-16 21:27:46 +01:00
|
|
|
touch $@
|
2007-06-27 23:03:42 +02:00
|
|
|
|
2010-03-16 21:27:46 +01:00
|
|
|
$(GRUB2_DIR)/.installed: $(GRUB2_DIR)/.compiled
|
|
|
|
$(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install
|
2007-06-27 23:03:42 +02:00
|
|
|
touch $@
|
|
|
|
|
2010-03-16 21:27:46 +01:00
|
|
|
grub2: host-automake host-autoconf $(GRUB2_DIR)/.installed
|
2007-06-27 23:03:42 +02:00
|
|
|
|
|
|
|
grub2-clean:
|
2010-07-06 09:27:32 +02:00
|
|
|
$(MAKE) DESTDIR=$(TARGET_DIR) CC="$(TARGET_CC)" -C $(GRUB2_DIR) uninstall
|
2007-06-27 23:03:42 +02:00
|
|
|
-$(MAKE) -C $(GRUB2_DIR) clean
|
|
|
|
|
|
|
|
grub2-dirclean:
|
|
|
|
rm -rf $(GRUB2_DIR)
|
|
|
|
|
|
|
|
#############################################################
|
|
|
|
#
|
|
|
|
# Toplevel Makefile options
|
|
|
|
#
|
|
|
|
#############################################################
|
2008-12-08 09:15:58 +01:00
|
|
|
ifeq ($(BR2_TARGET_GRUB2),y)
|
2007-06-27 23:03:42 +02:00
|
|
|
TARGETS+=grub2
|
|
|
|
endif
|