%define Werror_cflags %nil # Modules always contain just 32-bit code %define _libdir %{_exec_prefix}/lib %ifarch x86_64 # 64bit intel machines use 32bit boot loader # (We cannot just redefine _target_cpu, as we'd get i386.rpm packages) %global _target_platform i386-%{_vendor}-%{_target_os}%{?_gnu} %global efi_arch x86_64-efi %else %global efi_arch i386-efi %endif %define tarver 2.02~beta2 %global pc_arch i386-pc %define git 10101 %define rel 7 Name: grub2 Version: 2.02 Release: %mkrel -c git%{git} %{rel} Summary: Boot-loader with support for Linux, Multiboot and more Group: System/Boot and Init License: GPLv3+ and GPLv2 # unicode font is GPLv2 URL: http://www.gnu.org/software/grub/ Source0: ftp://ftp.gnu.org/gnu/grub/grub-%{tarver}.tar.xz Source1: 90_persistent Source2: grub.default Source3: README.Mageia Source4: README.efi Source7: theme.txt # pf2 fonts may be regenerated in SOURCES using ./mkfonts Source8: mkfonts Source9: unicode.pf2 Source10: MageiaLogo-Bold-16.pf2 Source11: MageiaLogo-Bold-20.pf2 Source12: MageiaLogo-Bold-28.pf2 Source13: MageiaLogo-Regular-20.pf2 Source14: Mageia5-grub2-1024x768.png Source15: MageiaLogoFonts-bdf.tar.xz Source16: gitignore # Upstream git snapshot Patch1: grub2-grub-2.02-beta2-mga-git-%{git}.patch # fix CVE-2014-4607 in bundled minilzo Patch2: grub-2.00-minilzo.patch Patch3: grub2-2.00-mga-add_failsafe-10_linux.in.patch # Fedora patches not upstream Patch0101: 0443-Migrate-PPC-from-Yaboot-to-Grub2.patch Patch0102: 0450-Pass-x-hex-hex-straight-through-unmolested.patch Patch0103: 0451-Fix-crash-on-http.patch Patch0104: 0460-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch Patch0105: 0462-for-ppc-reset-console-display-attr-when-clear-screen.patch Patch0106: 0476-Use-the-correct-indentation-for-the-term-help-text.patch Patch0107: 0126-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch Patch0108: 0039-Don-t-require-a-password-to-boot-entries-generated-b.patch Patch0109: 0040-Don-t-emit-Booting-.-message.patch Patch0110: 0041-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch Patch0111: 0042-May-as-well-try-it.patch Patch0114: 0045-trim-arp-packets-with-abnormal-size.patch Patch0115: 0046-Fix-convert-function-to-support-NVMe-devices.patch Patch0116: 0047-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch Patch0119: 0050-reopen-SNP-protocol-for-exclusive-use-by-grub.patch Patch0120: 0051-Reduce-timer-event-frequency-by-10.patch Patch0121: 0052-always-return-error-to-UEFI.patch Patch0122: 0053-Suport-for-bi-endianess-in-elf-file.patch Patch0123: 0054-Add-grub_util_readlink.patch Patch0124: 0055-Make-editenv-chase-symlinks-including-those-across-d.patch Patch0126: 0057-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch Patch0127: 0058-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch Patch0128: 0059-Add-GRUB_DISABLE_UUID.patch Patch0129: 0060-Allow-fallback-to-include-entries-by-title-not-just-.patch Patch0132: 0063-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch Patch0134: 0065-Make-grub2-mkconfig-construct-titles-that-look-like-.patch Patch0135: 0066-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch Patch0136: 0067-Make-.gitignore-suck-way-less.patch Patch0137: 0068-Update-info-with-grub.cfg-netboot-selection-order-11.patch Patch0138: 0069-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch Patch0139: 0070-Add-friendly-grub2-password-config-tool-985962.patch Patch0140: 0071-Make-exit-take-a-return-code.patch Patch0143: 0074-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch Patch0144: 10001-Put-the-correct-.file-directives-in-our-.S-files.patch Patch0145: 10002-Make-efi-machines-load-an-env-block-from-a-variable.patch Patch0146: 10003-Make-it-possible-to-enabled-build-id-sha1.patch Patch0147: 10005-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch Patch0148: 10006-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch Patch0149: 0075-Fix-security-issue-when-reading-username-and-passwor.patch Patch0150: 0076-01_users-Handle-GRUB_PASSWORD-better.patch Patch0151: grub2-2.02-mga-fix_halt_at_grub_prompt.patch BuildRequires: flex BuildRequires: bison BuildRequires: ruby BuildRequires: binutils BuildRequires: glibc-static-devel BuildRequires: ncurses-devel BuildRequires: liblzo-devel BuildRequires: pkgconfig(freetype2) BuildRequires: pkgconfig(libusb) BuildRequires: help2man BuildRequires: texinfo BuildRequires: libdevmapper-devel BuildRequires: fuse-devel BuildRequires: autogen BuildRequires: pkgconfig(liblzma) BuildRequires: pkgconfig(rpm) Conflicts: %{name}-efi Provides: bootloader Provides: grub2bootloader = %{version}-%{release} Requires: %{name}-common = %{version}-%{release} %description This is the second version of the GRUB (Grand Unified Boot-loader), a highly configurable and customizable boot-loader with modular architecture. It supports a wide range of kernel formats, file systems, computer architectures and hardware devices. Refer to the README.Mageia file that is part of this package's documentation for more information. %package efi Summary: Boot-loader with support for EFI Group: System/Boot and Init Conflicts: %{name} Requires(post): efibootmgr Provides: bootloader Provides: grub2bootloader = %{version}-%{release} Requires: %{name}-common = %{version}-%{release} %description efi This is the second version of the GRUB (Grand Unified Boot-loader), a highly configurable and customizable boot-loader with modular architecture. It supports a wide range of kernel formats, file systems, computer architectures and hardware devices. ************************** WARNING ************************ Do not attempt to install this package on a system which is not already using UEFI mode to boot. You cannot switch to UEFI mode by installing this package, the system must be installed in UEFI mode to use it, when it will be installed by default. %package common Summary: Provides files common to both grub2 and grub2-efi Group: System/Boot and Init Conflicts: memtest86+ < 5.01-7 Conflicts: %{name} < 2.02-0.git9752.19.mga5 Conflicts: %{name}-efi < 2.02-0.git9752.19.mga5 Recommends: %{name}-mageia-theme = %{version}-%{release} Recommends: os-prober >= 1.53 Recommends: xorriso Recommends: memtest86+ >= 5.01-7 Requires: grub2bootloader = %{version}-%{release} %description common Common files used by both grub2 and grub2-efi. %package mageia-theme Summary: Provides a graphical theme with a custom Mageia background for grub2 Group: System/Boot and Init Requires: grub2bootloader = %{version}-%{release} Conflicts: grub2-mageia3-theme-dejavu BuildArch: noarch %description mageia-theme This package provides a custom Mageia graphical theme. It is provided as a separate package so it may be easily excluded from minimal installations where a graphical theme is not required. %prep %setup -q -n grub-%{tarver} cp %{SOURCE16} .gitignore %autopatch -p1 find . -name "*.0???" -delete # README.Mageia cp %{SOURCE3} . # README.efi cp %{SOURCE4} . cd .. rm -rf grub-efi-%{tarver} mv grub-%{tarver} grub-efi-%{tarver} %setup -q -n grub-%{tarver} cp %{SOURCE16} .gitignore %autopatch -p1 find . -name "*.0???" -delete # README.Mageia cp %{SOURCE3} . # README.efi cp %{SOURCE4} . %build cd .. pushd grub-%{tarver} ./autogen.sh %configure2_5x TARGET_LDFLAGS=-static \ --with-platform=pc \ --enable-grub-emu-usb \ --disable-werror \ --enable-grub-mkfont \ --program-transform-name=s,grub,%{name}, \ --with-bootdir=/boot \ --with-grubdir=/%{name} \ CFLAGS="" %make popd pushd grub-efi-%{tarver} ./autogen.sh %configure2_5x TARGET_LDFLAGS=-static \ --with-platform=efi \ %ifarch x86_64 --target=x86_64 \ %endif --enable-grub-emu-usb \ --disable-werror \ --enable-grub-mkfont \ --program-transform-name=s,grub,%{name}, \ --with-bootdir=/boot \ --with-grubdir=/%{name} \ CFLAGS="" %make popd %install cd .. pushd grub-efi-%{tarver} %makeinstall_std popd pushd grub-%{tarver} %makeinstall_std # (bor) grub.info is harcoded in sources mv %{buildroot}%{_infodir}/grub.info %{buildroot}%{_infodir}/%{name}.info # Script that makes part of grub.cfg persist across updates install -m 755 %{SOURCE1} %{buildroot}%{_sysconfdir}/grub.d # Font install -d %{buildroot}/boot/%{name}/fonts install -D %{SOURCE9} %{buildroot}/boot/%{name}/fonts # Theme install -d %{buildroot}/boot/%{name}/themes/maggy install -D %{SOURCE7} %{buildroot}/boot/%{name}/themes/maggy install -D %{SOURCE10} %{buildroot}/boot/%{name}/themes/maggy install -D %{SOURCE11} %{buildroot}/boot/%{name}/themes/maggy install -D %{SOURCE12} %{buildroot}/boot/%{name}/themes/maggy install -D %{SOURCE13} %{buildroot}/boot/%{name}/themes/maggy install -D %{SOURCE14} %{buildroot}/boot/%{name}/themes/maggy # Ghost config files install -d %{buildroot}/boot/%{name} # Workaround for RHL Bug 817187 install -d %{buildroot}%{_datadir}/locale/en/LC_MESSAGES ln -s %{_datadir}/locale/en@quot/LC_MESSAGES/grub.mo %{buildroot}%{_datadir}/locale/en/LC_MESSAGES/grub.mo cat > %{buildroot}/boot/%{name}/custom.cfg < %{buildroot}%{_bindir}/update-grub <> %{_sysconfdir}/default/grub # Add theme echo "GRUB_THEME=/boot/grub2/themes/maggy/theme.txt" >> %{_sysconfdir}/default/grub fi # If updating from below 2.02-0.git10101.4 then re-make grub.cfg once. # grub2 dropped ownership of grub.cfg to avoid rpmnew being created. # Remove rpmnew and after new grub.cfg is created remove rpmsave. %triggerpostun common -- %{name} < 2.02-0.git10101.4, %{name}-efi < 2.02-0.git10101.4 rm -f /boot/%{name}/grub.cfg.rpmnew %{name}-mkconfig -o /boot/%{name}/grub.cfg && rm -f /boot/%{name}/grub.cfg.rpmsave # Take this opportunity to remove some unwanted logs rm -f /var/log/%{name}_preun.log rm -f /var/log/%{name}_post.log rm -f /var/log/%{name}_theme_postun.log %preun # Only if uninstalling if [ $1 -eq 0 ]; then rm -rf /boot/%{name}/%{pc_arch} rm -rf /boot/%{name}/locale fi %preun efi # Only if uninstalling if [ $1 -eq 0 ]; then rm -rf /boot/%{name}/%{efi_arch} rm -rf /boot/%{name}/locale fi %postun mageia-theme # Only if uninstalling theme if [ $1 -eq 0 ]; then # Remove theme from config sed -i '/GRUB_THEME=\/boot\/grub2\/themes\/maggy\/theme.txt/d' %{_sysconfdir}/default/grub fi %files %dir %{_libdir}/grub %dir %{_libdir}/grub/i386-pc %{_libdir}/grub/i386-pc/* %files efi %doc README.efi %dir %{_libdir}/grub %dir %{_libdir}/grub/%{efi_arch} %{_libdir}/grub/%{efi_arch}/* %files common -f grub.lang %doc COPYING NEWS README THANKS TODO README.Mageia %dir /boot/%{name} %dir /boot/%{name}/fonts %dir /boot/%{name}/themes %{_infodir}/* %{_bindir}/%{name}-* %{_bindir}/update-grub %{_bindir}/update-grub2 %{_sbindir}/%{name}-* %{_sysconfdir}/bash_completion.d/grub %{_sysconfdir}/grub.d/README %{_sysconfdir}/grub.d/00_header %{_sysconfdir}/grub.d/01_users %{_sysconfdir}/grub.d/10_linux %{_sysconfdir}/grub.d/20_linux_xen %{_sysconfdir}/grub.d/20_ppc_terminfo %{_sysconfdir}/grub.d/30_os-prober %{_sysconfdir}/grub.d/90_persistent %config(noreplace) %{_sysconfdir}/grub.d/40_custom %config(noreplace) %{_sysconfdir}/grub.d/41_custom %config(noreplace) %{_sysconfdir}/default/grub %{_datadir}/grub %config(noreplace) /boot/%{name}/custom.cfg %{_mandir}/man1/%{name}-*.1* %{_mandir}/man8/%{name}-*.8* %files mageia-theme /boot/%{name}/fonts/unicode.pf2 %dir /boot/%{name}/themes/maggy /boot/%{name}/themes/maggy/*