2012-09-22 20:10:38 +00:00
|
|
|
#
|
2015-06-06 13:49:24 +00:00
|
|
|
# Copyright (C) 2006-2015 OpenWrt.org
|
2012-09-22 20:10:38 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
|
|
|
|
|
|
|
PKG_NAME:=grub
|
2017-09-28 02:55:46 +00:00
|
|
|
PKG_CPE_ID:=cpe:/a:gnu:grub2
|
2019-07-18 13:32:39 +00:00
|
|
|
PKG_VERSION:=2.04
|
2020-04-01 21:44:37 +00:00
|
|
|
PKG_RELEASE:=3
|
2012-09-22 20:10:38 +00:00
|
|
|
|
2014-03-12 11:21:16 +00:00
|
|
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
2017-05-20 07:11:16 +00:00
|
|
|
PKG_SOURCE_URL:=@GNU/grub
|
2019-07-18 13:32:39 +00:00
|
|
|
PKG_HASH:=e5292496995ad42dabe843a0192cf2a2c502e7ffcc7479398232b10a472df77d
|
2012-09-22 20:10:38 +00:00
|
|
|
|
|
|
|
HOST_BUILD_PARALLEL:=1
|
|
|
|
PKG_BUILD_DEPENDS:=grub2/host
|
|
|
|
|
2020-04-01 21:44:37 +00:00
|
|
|
PKG_ASLR_PIE:=0
|
2015-06-25 11:20:39 +00:00
|
|
|
PKG_SSP:=0
|
|
|
|
|
2017-01-19 08:18:57 +00:00
|
|
|
PKG_FLAGS:=nonshared
|
|
|
|
|
2012-09-22 20:10:38 +00:00
|
|
|
include $(INCLUDE_DIR)/host-build.mk
|
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
2020-03-26 05:51:32 +00:00
|
|
|
define Package/grub2/Default
|
2016-10-26 15:51:44 +00:00
|
|
|
CATEGORY:=Boot Loaders
|
|
|
|
SECTION:=boot
|
2020-03-26 05:51:32 +00:00
|
|
|
TITLE:=GRand Unified Bootloader ($(1))
|
2012-09-22 20:10:38 +00:00
|
|
|
URL:=http://www.gnu.org/software/grub/
|
2019-01-13 20:37:47 +00:00
|
|
|
DEPENDS:=@TARGET_x86
|
2020-03-26 05:51:32 +00:00
|
|
|
VARIANT:=$(1)
|
2012-09-22 20:10:38 +00:00
|
|
|
endef
|
|
|
|
|
2020-03-26 05:51:32 +00:00
|
|
|
Package/grub2=$(call Package/grub2/Default,pc)
|
|
|
|
Package/grub2-efi=$(call Package/grub2/Default,efi)
|
|
|
|
|
2013-05-07 12:35:07 +00:00
|
|
|
define Package/grub2-editenv
|
|
|
|
CATEGORY:=Utilities
|
|
|
|
SECTION:=utils
|
2016-10-23 19:04:49 +00:00
|
|
|
SUBMENU:=Boot Loaders
|
2013-05-07 12:35:07 +00:00
|
|
|
TITLE:=Grub2 Environment editor
|
|
|
|
URL:=http://www.gnu.org/software/grub/
|
2019-01-13 20:37:47 +00:00
|
|
|
DEPENDS:=@TARGET_x86
|
2020-03-26 05:51:32 +00:00
|
|
|
VARIANT:=pc
|
2013-05-07 12:35:07 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/grub2-editenv/description
|
|
|
|
Edit grub2 environment files.
|
|
|
|
endef
|
|
|
|
|
2016-01-21 11:46:18 +00:00
|
|
|
HOST_BUILD_PREFIX := $(STAGING_DIR_HOST)
|
|
|
|
|
2016-11-21 15:36:56 +00:00
|
|
|
CONFIGURE_VARS += \
|
|
|
|
grub_build_mkfont_excuse="don't want fonts"
|
|
|
|
|
2013-05-07 12:35:07 +00:00
|
|
|
CONFIGURE_ARGS += \
|
|
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
|
|
|
--disable-werror \
|
2014-03-30 19:55:39 +00:00
|
|
|
--disable-nls \
|
2014-03-30 19:55:43 +00:00
|
|
|
--disable-device-mapper \
|
2014-08-01 11:19:46 +00:00
|
|
|
--disable-libzfs \
|
2018-02-22 08:29:54 +00:00
|
|
|
--disable-grub-mkfont \
|
2020-03-26 05:51:32 +00:00
|
|
|
--with-platform=$(BUILD_VARIANT)
|
2013-05-07 12:35:07 +00:00
|
|
|
|
2016-11-21 15:36:56 +00:00
|
|
|
HOST_CONFIGURE_VARS += \
|
|
|
|
grub_build_mkfont_excuse="don't want fonts"
|
|
|
|
|
2012-09-22 20:10:38 +00:00
|
|
|
HOST_CONFIGURE_ARGS += \
|
2016-11-21 15:36:56 +00:00
|
|
|
--disable-grub-mkfont \
|
2012-09-22 20:10:38 +00:00
|
|
|
--target=$(REAL_GNU_TARGET_NAME) \
|
|
|
|
--sbindir="$(STAGING_DIR_HOST)/bin" \
|
2012-09-23 09:49:56 +00:00
|
|
|
--disable-werror \
|
2014-08-01 11:19:46 +00:00
|
|
|
--disable-libzfs \
|
2020-03-26 05:51:32 +00:00
|
|
|
--disable-nls \
|
|
|
|
--with-platform=none
|
2012-09-22 20:10:38 +00:00
|
|
|
|
|
|
|
HOST_MAKE_FLAGS += \
|
2012-09-23 10:38:06 +00:00
|
|
|
TARGET_RANLIB=$(TARGET_RANLIB) \
|
|
|
|
LIBLZMA=$(STAGING_DIR_HOST)/lib/liblzma.a
|
2012-09-22 20:10:38 +00:00
|
|
|
|
2020-04-01 21:44:37 +00:00
|
|
|
TARGET_CFLAGS := $(filter-out -fno-plt,$(TARGET_CFLAGS))
|
2020-03-26 05:51:32 +00:00
|
|
|
|
2012-09-22 20:10:38 +00:00
|
|
|
define Host/Configure
|
|
|
|
$(SED) 's,(RANLIB),(TARGET_RANLIB),' $(HOST_BUILD_DIR)/grub-core/Makefile.in
|
|
|
|
$(Host/Configure/Default)
|
|
|
|
endef
|
|
|
|
|
2020-03-26 05:51:32 +00:00
|
|
|
define Package/grub2/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-bios-setup $(1)/usr/sbin/
|
|
|
|
$(INSTALL_DIR) $(STAGING_DIR_IMAGE)/grub2
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/grub-core/boot.img $(STAGING_DIR_IMAGE)/grub2/
|
|
|
|
$(CP) $(PKG_BUILD_DIR)/grub-core/cdboot.img $(STAGING_DIR_IMAGE)/grub2/
|
|
|
|
sed 's#msdos1#gpt1#g' ./files/grub-early.cfg >$(PKG_BUILD_DIR)/grub-early.cfg
|
|
|
|
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
|
|
|
-d $(PKG_BUILD_DIR)/grub-core \
|
|
|
|
-p /boot/grub \
|
|
|
|
-O i386-pc \
|
|
|
|
-c $(PKG_BUILD_DIR)/grub-early.cfg \
|
|
|
|
-o $(STAGING_DIR_IMAGE)/grub2/gpt-core.img \
|
|
|
|
at_keyboard biosdisk boot chain configfile fat linux ls part_gpt reboot serial vga
|
2020-03-20 10:10:54 +00:00
|
|
|
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
2020-03-26 05:51:32 +00:00
|
|
|
-d $(PKG_BUILD_DIR)/grub-core \
|
2020-03-20 10:10:54 +00:00
|
|
|
-p /boot/grub \
|
|
|
|
-O i386-pc \
|
|
|
|
-c ./files/grub-early.cfg \
|
2020-03-26 05:51:32 +00:00
|
|
|
-o $(STAGING_DIR_IMAGE)/grub2/generic-core.img \
|
2020-03-20 10:10:54 +00:00
|
|
|
at_keyboard biosdisk boot chain configfile ext2 linux ls part_msdos reboot serial vga
|
|
|
|
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
2020-03-26 05:51:32 +00:00
|
|
|
-d $(PKG_BUILD_DIR)/grub-core \
|
2020-03-20 10:10:54 +00:00
|
|
|
-p /boot/grub \
|
|
|
|
-O i386-pc \
|
|
|
|
-c ./files/grub-early.cfg \
|
2020-03-26 05:51:32 +00:00
|
|
|
-o $(STAGING_DIR_IMAGE)/grub2/eltorito.img \
|
|
|
|
at_keyboard biosdisk boot chain configfile iso9660 linux ls part_msdos reboot serial test vga
|
2020-03-20 10:10:54 +00:00
|
|
|
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
2020-03-26 05:51:32 +00:00
|
|
|
-d $(PKG_BUILD_DIR)/grub-core \
|
2020-03-20 10:10:54 +00:00
|
|
|
-p /boot/grub \
|
|
|
|
-O i386-pc \
|
|
|
|
-c ./files/grub-early.cfg \
|
2020-03-26 05:51:32 +00:00
|
|
|
-o $(STAGING_DIR_IMAGE)/grub2/legacy-core.img \
|
2020-03-20 10:10:54 +00:00
|
|
|
biosdisk boot chain configfile ext2 linux ls part_msdos reboot serial vga
|
|
|
|
endef
|
|
|
|
|
2020-03-26 05:51:32 +00:00
|
|
|
define Package/grub2-efi/install
|
|
|
|
sed 's#msdos1#gpt1#g' ./files/grub-early.cfg >$(PKG_BUILD_DIR)/grub-early.cfg
|
|
|
|
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
|
|
|
-d $(PKG_BUILD_DIR)/grub-core \
|
|
|
|
-p /boot/grub \
|
|
|
|
-O $(CONFIG_ARCH)-efi \
|
|
|
|
-c $(PKG_BUILD_DIR)/grub-early.cfg \
|
|
|
|
-o $(STAGING_DIR_IMAGE)/grub2/boot$(if $(CONFIG_x86_64),x64,ia32).efi \
|
|
|
|
at_keyboard boot chain configfile fat linux ls part_gpt reboot serial efi_gop efi_uga
|
|
|
|
$(STAGING_DIR_HOST)/bin/grub-mkimage \
|
|
|
|
-d $(PKG_BUILD_DIR)/grub-core \
|
|
|
|
-p /boot/grub \
|
|
|
|
-O $(CONFIG_ARCH)-efi \
|
|
|
|
-c ./files/grub-early.cfg \
|
|
|
|
-o $(STAGING_DIR_IMAGE)/grub2/iso-boot$(if $(CONFIG_x86_64),x64,ia32).efi \
|
|
|
|
at_keyboard boot chain configfile fat iso9660 linux ls part_msdos part_gpt reboot serial test efi_gop efi_uga
|
2020-01-14 17:45:44 +00:00
|
|
|
endef
|
|
|
|
|
2013-05-07 12:35:07 +00:00
|
|
|
define Package/grub2-editenv/install
|
|
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
|
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
|
|
|
|
endef
|
|
|
|
|
2012-09-22 20:10:38 +00:00
|
|
|
$(eval $(call HostBuild))
|
|
|
|
$(eval $(call BuildPackage,grub2))
|
2020-03-26 05:51:32 +00:00
|
|
|
$(eval $(call BuildPackage,grub2-efi))
|
2013-05-07 12:35:07 +00:00
|
|
|
$(eval $(call BuildPackage,grub2-editenv))
|