summaryrefslogtreecommitdiff
path: root/package/grub
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@uclibc-ng.org>2016-11-08 02:52:30 +0100
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-11-13 20:30:02 +0100
commitdf894ff3f570536ea1aa3e96a9d063e8f2f7c746 (patch)
treec7b6d43a1934c30f8e4253cfa0b30fd0896d4d95 /package/grub
parent5366aa37eca50b97c477d423f3417c6f4a504f8f (diff)
grub: rework package, add mips support, update to latest git
Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
Diffstat (limited to 'package/grub')
-rw-r--r--package/grub/Makefile70
-rw-r--r--package/grub/patches/patch-configure11
-rw-r--r--package/grub/patches/patch-grub-core_gnulib_stdio_in_h14
-rw-r--r--package/grub/patches/patch-grub-core_kern_emu_hostdisk_c36
4 files changed, 33 insertions, 98 deletions
diff --git a/package/grub/Makefile b/package/grub/Makefile
index 25d5bdea7..ecbbdb2ed 100644
--- a/package/grub/Makefile
+++ b/package/grub/Makefile
@@ -4,25 +4,25 @@
include $(ADK_TOPDIR)/rules.mk
PKG_NAME:= grub
-PKG_VERSION:= 2.00
-PKG_RELEASE:= 7
-PKG_HASH:= 784ec38e7edc32239ad75b8e66df04dc8bfb26d88681bc9f627133a6eb85c458
+PKG_VERSION:= git
+PKG_RELEASE:= 1
PKG_DESCR:= multiboot boot loader
PKG_SECTION:= base/boot
PKG_BUILDDEP:= bison-host grub-host
PKG_URL:= http://www.gnu.org/software/grub
-PKG_SITES:= ftp://ftp.gnu.org/gnu/grub/
+PKG_SITES:= git://git.savannah.gnu.org/grub.git
PKG_NOPARALLEL:= 1
-PKG_ARCH_DEPENDS:= x86 x86_64
+PKG_ARCH_DEPENDS:= x86 x86_64 mips mips64
PKG_SUBPKGS:= GRUB GRUB_TOOLS
PKGSD_GRUB_TOOLS:= grub2 tools
-PKG_CHOICES_GRUB:= PC EFI_X86 EFI_X86_64
+PKG_CHOICES_GRUB:= PC EFI_X86 EFI_X86_64 ARC
PKGCD_PC:= build for PC BIOS
PKGCD_EFI_X86:= build for EFI x86
PKGCD_EFI_X86_64:= build for EFI x86_64
+PKGCD_ARC:= build for MIPS/MIPS64 ARC
include $(ADK_TOPDIR)/mk/host.mk
include $(ADK_TOPDIR)/mk/package.mk
@@ -34,53 +34,57 @@ $(eval $(call PKG_template,GRUB_TOOLS,grub-tools,$(PKG_VERSION)-${PKG_RELEASE},$
TARGET_CFLAGS:=$(filter-out -fstack-protector-all,$(TARGET_CFLAGS))
TARGET_CFLAGS:=$(filter-out -flto,$(TARGET_CFLAGS))
+AUTOTOOL_STYLE:= autogen
+
GRUB2_BOOT_PARTITION:= hd0,msdos1
+ifeq ($(ADK_PACKAGE_GRUB_ARC),y)
+GRUB2_ARCH:= mips-arc
+CONFIGURE_ARGS+= --with-platform=arc
+GRUB2_IMAGE = $(FW_DIR)/grub.img
+GRUB2_CFG = $(TARGET_DIR)/boot/grub/grub.cfg
+GRUB2_PREFIX = ($(GRUB2_BOOT_PARTITION))/boot/grub
+GRUB2_TARGET = mips
+GRUB2_PLATFORM = arc
+GRUB2_MODULES = boot linux ext2 fat part_msdos part_gpt normal biosdisk
+endif
+
ifeq ($(ADK_PACKAGE_GRUB_PC),y)
+GRUB2_ARCH:= i386-pc
+CONFIGURE_ARGS+= --with-platform=pc
+HOST_CONFIGURE_ARGS+= --with-platform=pc
GRUB2_IMAGE = $(FW_DIR)/grub.img
GRUB2_CFG = $(TARGET_DIR)/boot/grub/grub.cfg
GRUB2_PREFIX = ($(GRUB2_BOOT_PARTITION))/boot/grub
-GRUB2_TUPLE = i386-pc
GRUB2_TARGET = i386
GRUB2_PLATFORM = pc
GRUB2_MODULES = boot linux ext2 fat part_msdos part_gpt normal biosdisk
endif
ifeq ($(ADK_PACKAGE_GRUB_EFI_X86),y)
+GRUB2_ARCH:= x86_64-efi
+CONFIGURE_ARGS+= --with-platform=efi
+HOST_CONFIGURE_ARGS+= --with-platform=efi
GRUB2_IMAGE = $(FW_DIR)/efi-part/EFI/BOOT/bootia32.efi
GRUB2_CFG = $(FW_DIR)/efi-part/EFI/BOOT/grub.cfg
GRUB2_PREFIX = /EFI/BOOT
-GRUB2_TUPLE = i386-efi
GRUB2_TARGET = i386
GRUB2_PLATFORM = efi
GRUB2_MODULES = boot linux ext2 fat part_msdos part_gpt normal efi_gop
endif
ifeq ($(ADK_PACKAGE_GRUB_EFI_X86_64),y)
+GRUB2_ARCH:= x86_64-efi
+CONFIGURE_ARGS+= --with-platform=efi
+HOST_CONFIGURE_ARGS+= --with-platform=efi
GRUB2_IMAGE = $(FW_DIR)/efi-part/EFI/BOOT/bootx64.efi
GRUB2_CFG = $(FW_DIR)/efi-part/EFI/BOOT/grub.cfg
GRUB2_PREFIX = /EFI/BOOT
-GRUB2_TUPLE = x86_64-efi
GRUB2_TARGET = x86_64
GRUB2_PLATFORM = efi
GRUB2_MODULES = boot linux ext2 fat part_msdos part_gpt normal efi_gop
endif
-# core.img is generated via
-# grub-mkimage -O ${GRUB_ARCH} -o core.img -c embed.cfg ${GRUB_MODULES}
-GRUB_MODULES:= ext2 part_msdos biosdisk
-
-ifeq ($(ADK_PACKAGE_GRUB_PC),y)
-GRUB_ARCH:= i386-pc
-CONFIGURE_ARGS+= --with-platform=pc
-HOST_CONFIGURE_ARGS+= --with-platform=pc
-endif
-ifeq ($(ADK_PACKAGE_GRUB_EFI_X86)$(ADK_PACKAGE_GRUB_EFI_X86_64),y)
-GRUB_ARCH:= x86_64-efi
-CONFIGURE_ARGS+= --with-platform=efi
-HOST_CONFIGURE_ARGS+= --with-platform=efi
-endif
-
HOST_CONFIGURE_ARGS+= --enable-efiemu=no \
--disable-grub-mkfont \
--enable-device-mapper=no \
@@ -94,26 +98,18 @@ CONFIGURE_ARGS+= --disable-grub-mkfont \
XAKE_FLAGS+= GCC_HONOUR_COPTS=s
grub-install:
-ifeq ($(ADK_PACKAGE_GRUB_PC),y)
- ${INSTALL_DIR} $(IDIR_GRUB)/boot/grub/${GRUB_ARCH}
- ${CP} ${WRKINST}/usr/lib/grub/${GRUB_ARCH}/*{mod,lst,img} \
- $(IDIR_GRUB)/boot/grub/${GRUB_ARCH}/
- $(CP) ./files/core.img.${GRUB_ARCH} \
- $(IDIR_GRUB)/boot/grub/core.img
- $(CP) $(WRKINST)/usr/lib/grub/i386-pc/boot.img \
- $(FW_DIR)/
-else
+ifeq ($(ADK_PACKAGE_GRUB_EFI_X86)$(ADK_PACKAGE_GRUB_EFI_X86_64),y)
$(INSTALL_DIR) $(FW_DIR)/efi-part/EFI/BOOT
- ${CP} ${WRKINST}/usr/lib/grub/${GRUB_ARCH} \
+ ${CP} ${WRKINST}/usr/lib/grub/${GRUB2_ARCH} \
$(FW_DIR)/efi-part/EFI/BOOT
+endif
$(STAGING_HOST_DIR)/usr/bin/grub-mkimage \
- -d $(STAGING_HOST_DIR)/usr/lib/grub/$(GRUB2_TUPLE) \
- -O $(GRUB2_TUPLE) \
+ -d $(WRKINST)/usr/lib/grub/$(GRUB2_ARCH) \
+ -O $(GRUB2_ARCH) \
-o $(GRUB2_IMAGE) \
-p "$(GRUB2_PREFIX)" \
$(GRUB2_MODULES)
$(CP) ./files/grub.cfg $(GRUB2_CFG)
-endif
grub-tools-install:
${INSTALL_DIR} $(IDIR_GRUB_TOOLS)/usr/{sbin,bin,share,lib}
diff --git a/package/grub/patches/patch-configure b/package/grub/patches/patch-configure
deleted file mode 100644
index a3920a1c1..000000000
--- a/package/grub/patches/patch-configure
+++ /dev/null
@@ -1,11 +0,0 @@
---- grub-2.00.orig/configure 2012-06-26 13:59:16.000000000 +0200
-+++ grub-2.00/configure 2014-04-06 20:34:33.000000000 +0200
-@@ -3880,7 +3882,7 @@ TARGET_CPPFLAGS="$TARGET_CPPFLAGS -I\$(t
-
- case "$target_cpu" in
- i[3456]86) target_cpu=i386 ;;
-- amd64) target_cpu=x86_64 ;;
-+ amd64|x86_64) target_cpu=x86_64 ;;
- sparc) target_cpu=sparc64 ;;
- mipsel|mips64el)
- target_cpu=mipsel;
diff --git a/package/grub/patches/patch-grub-core_gnulib_stdio_in_h b/package/grub/patches/patch-grub-core_gnulib_stdio_in_h
deleted file mode 100644
index 79ab772ad..000000000
--- a/package/grub/patches/patch-grub-core_gnulib_stdio_in_h
+++ /dev/null
@@ -1,14 +0,0 @@
---- grub-2.00.orig/grub-core/gnulib/stdio.in.h 2010-12-01 15:45:43.000000000 +0100
-+++ grub-2.00/grub-core/gnulib/stdio.in.h 2014-04-05 10:02:52.000000000 +0200
-@@ -137,11 +137,6 @@ _GL_WARN_ON_USE (fflush, "fflush is not
- "use gnulib module fflush for portable POSIX compliance");
- #endif
-
--/* It is very rare that the developer ever has full control of stdin,
-- so any use of gets warrants an unconditional warning. Assume it is
-- always declared, since it is required by C89. */
--#undef gets
--_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
-
- #if @GNULIB_FOPEN@
- # if @REPLACE_FOPEN@
diff --git a/package/grub/patches/patch-grub-core_kern_emu_hostdisk_c b/package/grub/patches/patch-grub-core_kern_emu_hostdisk_c
deleted file mode 100644
index e238bb7fd..000000000
--- a/package/grub/patches/patch-grub-core_kern_emu_hostdisk_c
+++ /dev/null
@@ -1,36 +0,0 @@
---- grub-2.00.orig/grub-core/kern/emu/hostdisk.c 2012-06-25 10:32:04.000000000 +0200
-+++ grub-2.00/grub-core/kern/emu/hostdisk.c 2014-04-06 13:14:06.000000000 +0200
-@@ -761,25 +761,6 @@ linux_find_partition (char *dev, grub_di
- }
- #endif /* __linux__ */
-
--#if defined(__linux__) && (!defined(__GLIBC__) || \
-- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))))
-- /* Maybe libc doesn't have large file support. */
--grub_err_t
--grub_util_fd_seek (int fd, const char *name, grub_uint64_t off)
--{
-- loff_t offset, result;
-- static int _llseek (uint filedes, ulong hi, ulong lo,
-- loff_t *res, uint wh);
-- _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo,
-- loff_t *, res, uint, wh);
--
-- offset = (loff_t) off;
-- if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET))
-- return grub_error (GRUB_ERR_BAD_DEVICE, N_("cannot seek `%s': %s"),
-- name, strerror (errno));
-- return GRUB_ERR_NONE;
--}
--#else
- grub_err_t
- grub_util_fd_seek (int fd, const char *name, grub_uint64_t off)
- {
-@@ -790,7 +771,6 @@ grub_util_fd_seek (int fd, const char *n
- name, strerror (errno));
- return 0;
- }
--#endif
-
- static void
- flush_initial_buffer (const char *os_dev __attribute__ ((unused)))