# Conditional build:
%bcond_with grubemu # grub-emu debugging utility
%bcond_without efiemu # efiemu runtimes (64-bit efiemu on 32-bit boot platform)
-%bcond_with unifont # unifont based fonts
+%bcond_without unifont # unifont based fonts
%bcond_without arc # MIPS ARC platform support
%bcond_without coreboot # coreboot/linuxbios platform support (x86/arm specific)
%bcond_without efi # EFI platform support
Summary(pt_BR.UTF-8): Gerenciador de inicialização GRUB2
Name: grub2
Version: 2.12
-Release: 1
+Release: 2
License: GPL v2
Group: Base
Source0: https://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz
Patch5: grub-mkconfig-diagnostics.patch
Patch6: posix.patch
Patch7: %{name}-fonts_path.patch
+Patch8: initrd-max-address.patch
Patch9: just-say-linux.patch
Patch10: ignore-kernel-symlinks.patch
-Patch11: initrd-search.patch
+Patch11: choose-preferred-initrd.patch
Patch12: %{name}-cfg.patch
Patch14: blscfg.patch
Patch15: restricted.patch
+Patch16: x32.patch
URL: http://www.gnu.org/software/grub/
BuildRequires: autoconf >= 2.64
BuildRequires: automake >= 1:1.11.1-1
BuildRequires: texinfo
BuildRequires: xz
BuildRequires: xz-devel
+BuildRequires: zfs-devel
Requires: %{name}-platform = %{version}-%{release}
Requires: issue
Requires: which
%prep
%setup -q -n grub-%{version}
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
-%patch9 -p1
-%patch10 -p1
-%patch11 -p1
-%patch12 -p0
-%patch14 -p1
-%patch15 -p1
+%patch -P1 -p1
+%patch -P2 -p1
+%patch -P3 -p1
+%patch -P4 -p1
+%patch -P5 -p1
+%patch -P6 -p1
+%patch -P7 -p1
+%patch -P8 -p1
+%patch -P9 -p1
+%patch -P10 -p1
+%patch -P11 -p1
+%patch -P12 -p0
+%patch -P14 -p1
+%patch -P15 -p1
+%patch -P16 -p1
# we don't have C.utf-8 and need an UTF-8 locale for build
sed -i -e 's/LC_ALL=C.UTF-8/LC_ALL=en_US.utf-8/g' po/Makefile* po/Rules*
ln -f -s ../configure .
# mawk stalls at ./genmoddep.awk, so force gawk
- AWK=gawk \
%configure \
+ AWK=gawk \
+ CPP="%{__cc} -E" \
PYTHON="%{__python3}" \
--with-platform=${platform} \
--disable-werror \
--- /dev/null
+; https://help-grub.gnu.narkive.com/8RcDkxFC/grub-and-linux-s-initrd-addr-max
+; https://git.rthoni.com/robin.thoni/ipxe/commit/4cc786de810a74659b6266d04188c78b5b202103?lang=pl-PL
+--- grub-2.12/include/grub/i386/linux.h~ 2023-10-03 14:21:48.000000000 +0200
++++ grub-2.12/include/grub/i386/linux.h 2024-11-04 14:15:17.553066287 +0100
+@@ -23,7 +23,7 @@
+
+ #define GRUB_LINUX_I386_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */
+ #define GRUB_LINUX_DEFAULT_SETUP_SECTS 4
+-#define GRUB_LINUX_INITRD_MAX_ADDRESS 0x37FFFFFF
++#define GRUB_LINUX_INITRD_MAX_ADDRESS 0x7FFFFFFF
+ #define GRUB_LINUX_MAX_SETUP_SECTS 64
+ #define GRUB_LINUX_BOOT_LOADER_TYPE 0x72
+ #define GRUB_LINUX_HEAP_END_OFFSET (0x9000 - 0x200)
--- /dev/null
+--- grub-2.12/include/grub/efi/api.h.orig 2023-11-22 18:52:44.000000000 +0100
++++ grub-2.12/include/grub/efi/api.h 2024-06-06 19:27:51.082911968 +0200
+@@ -587,7 +587,7 @@
+ */
+ #if defined(__i386__)
+ #define __grub_efi_api __attribute__((regparm(0)))
+-#elif defined(__x86_64__)
++#elif defined(__x86_64__) && !defined(__ILP32__)
+ #define __grub_efi_api __attribute__((ms_abi))
+ #else
+ #define __grub_efi_api