%define Werror_cflags %nil # Modules always contain just 32-bit code %define _libdir %{_exec_prefix}/lib # 64bit intel machines use 32bit boot loader # (We cannot just redefine _target_cpu, as we'd get i386.rpm packages then) %ifarch x86_64 %define _target_platform i386-%{_vendor}-%{_target_os}%{?_gnu} %global efi_arch x86_64-efi %endif %ifarch %arm %global efi_arch arm-uboot %endif %ifarch %ix86 %global efi_arch i386-efi %endif %global tarversion 2.02~beta2 %global pc_arch i386-pc %define git 10270 %define rel 3 Name: grub2 Version: 2.02 Release: %mkrel -c git%{git} %{rel} Summary: Bootloader 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://alpha.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz #Source0: ftp://ftp.gnu.org/gnu/grub/grub-%{tarversion}.tar.xz Source1: 90_persistent Source2: grub.default Source3: README.Mageia Source4: README.efi Source6: gitignore 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 # # Fedora patches: # # generate with: # git diff grub-2.02-beta2..origin/master Patch0000: grub-2.02-beta2-to-origin-master.patch # generate all the patches after this with: # git format-patch fedora-diff-from-here..fedora-23 Patch0001: 0001-Migrate-PPC-from-Yaboot-to-Grub2.patch Patch0002: 0002-Add-fw_path-variable-revised.patch Patch0003: 0003-Add-support-for-linuxefi.patch Patch0004: 0004-Use-linuxefi-and-initrdefi-where-appropriate.patch Patch0005: 0005-Don-t-allow-insmod-when-secure-boot-is-enabled.patch Patch0006: 0006-Pass-x-hex-hex-straight-through-unmolested.patch Patch0007: 0007-Fix-crash-on-http.patch Patch0008: 0008-IBM-client-architecture-CAS-reboot-support.patch Patch0009: 0009-Add-vlan-tag-support.patch Patch0010: 0010-Add-X-option-to-printf-functions.patch Patch0011: 0011-DHCP-client-ID-and-UUID-options-added.patch Patch0012: 0012-Search-for-specific-config-file-for-netboot.patch Patch0013: 0013-blscfg-add-blscfg-module-to-parse-Boot-Loader-Specif.patch Patch0014: 0014-Move-bash-completion-script-922997.patch Patch0015: 0015-for-ppc-reset-console-display-attr-when-clear-screen.patch Patch0016: 0016-Don-t-write-messages-to-the-screen.patch Patch0017: 0017-Don-t-print-GNU-GRUB-header.patch Patch0018: 0018-Don-t-add-to-highlighted-row.patch Patch0019: 0019-Message-string-cleanups.patch Patch0020: 0020-Fix-border-spacing-now-that-we-aren-t-displaying-it.patch Patch0021: 0021-Use-the-correct-indentation-for-the-term-help-text.patch Patch0022: 0022-Indent-menu-entries.patch Patch0023: 0023-Fix-margins.patch Patch0024: 0024-Add-support-for-UEFI-operating-systems-returned-by-o.patch Patch0025: 0025-Disable-GRUB-video-support-for-IBM-power-machines.patch Patch0026: 0026-Use-2-instead-of-1-for-our-right-hand-margin-so-line.patch Patch0027: 0027-Use-linux16-when-appropriate-880840.patch Patch0028: 0028-Enable-pager-by-default.-985860.patch Patch0029: 0029-F10-doesn-t-work-on-serial-so-don-t-tell-the-user-to.patch Patch0030: 0030-Don-t-say-GNU-Linux-in-generated-menus.patch Patch0031: 0031-Don-t-draw-a-border-around-the-menu.patch Patch0032: 0032-Use-the-standard-margin-for-the-timeout-string.patch Patch0033: 0033-Fix-grub_script_execute_sourcecode-usage-on-ppc.patch Patch0034: 0034-Add-.eh_frame-to-list-of-relocations-stripped.patch Patch0035: 0035-Make-10_linux-work-with-our-changes-for-linux16-and-.patch Patch0036: 0036-Don-t-print-during-fdt-loading-method.patch Patch0037: 0037-Honor-a-symlink-when-generating-configuration-by-gru.patch Patch0038: 0038-Don-t-munge-raw-spaces-when-we-re-doing-our-cmdline-.patch Patch0039: 0039-Don-t-require-a-password-to-boot-entries-generated-b.patch Patch0040: 0040-Don-t-emit-Booting-.-message.patch Patch0041: 0041-Make-CTRL-and-ALT-keys-work-as-expected-on-EFI-syste.patch Patch0042: 0042-May-as-well-try-it.patch Patch0043: 0043-use-fw_path-prefix-when-fallback-searching-for-grub-.patch Patch0044: 0044-Try-mac-guid-etc-before-grub.cfg-on-tftp-config-file.patch Patch0045: 0045-trim-arp-packets-with-abnormal-size.patch Patch0046: 0046-Fix-convert-function-to-support-NVMe-devices.patch Patch0047: 0047-Fix-bad-test-on-GRUB_DISABLE_SUBMENU.patch Patch0048: 0048-Switch-to-use-APM-Mustang-device-tree-for-hardware-t.patch Patch0049: 0049-Use-the-default-device-tree-from-the-grub-default-fi.patch Patch0050: 0050-reopen-SNP-protocol-for-exclusive-use-by-grub.patch Patch0051: 0051-Reduce-timer-event-frequency-by-10.patch Patch0052: 0052-always-return-error-to-UEFI.patch Patch0053: 0053-Suport-for-bi-endianess-in-elf-file.patch Patch0054: 0054-Add-grub_util_readlink.patch Patch0055: 0055-Make-editenv-chase-symlinks-including-those-across-d.patch Patch0056: 0056-Generate-OS-and-CLASS-in-10_linux-from-etc-os-releas.patch Patch0057: 0057-Fix-GRUB_DISABLE_SUBMENU-one-more-time.patch Patch0058: 0058-Minimize-the-sort-ordering-for-.debug-and-rescue-ker.patch Patch0059: 0059-Add-GRUB_DISABLE_UUID.patch Patch0060: 0060-Allow-fallback-to-include-entries-by-title-not-just-.patch Patch0061: 0061-Load-arm-with-SB-enabled.patch Patch0062: 0062-Try-prefix-if-fw_path-doesn-t-work.patch Patch0063: 0063-Try-to-emit-linux16-initrd16-and-linuxefi-initrdefi-.patch Patch0064: 0064-Update-to-minilzo-2.08.patch Patch0065: 0065-Make-grub2-mkconfig-construct-titles-that-look-like-.patch Patch0066: 0066-Make-rescue-and-debug-entries-sort-right-again-in-gr.patch Patch0067: 0067-Make-.gitignore-suck-way-less.patch Patch0068: 0068-Update-info-with-grub.cfg-netboot-selection-order-11.patch Patch0069: 0069-Use-Distribution-Package-Sort-for-grub2-mkconfig-112.patch Patch0070: 0070-Add-friendly-grub2-password-config-tool-985962.patch Patch0071: 0071-Make-exit-take-a-return-code.patch Patch0072: 0072-Add-some-__unused__-where-gcc-5.x-is-more-picky-abou.patch Patch0073: 0073-Fix-race-in-EFI-validation.patch Patch0074: 0074-Mark-po-exclude.pot-as-binary-so-git-won-t-try-to-di.patch Patch0075: 0075-Fix-security-issue-when-reading-username-and-passwor.patch Patch0076: 0076-01_users-Handle-GRUB_PASSWORD-better.patch # And these are: # git checkout debuginfo # git format-patch fedora-23.. Patch10001: 10001-Put-the-correct-.file-directives-in-our-.S-files.patch Patch10002: 10002-Make-efi-machines-load-an-env-block-from-a-variable.patch Patch10003: 10003-Make-it-possible-to-enabled-build-id-sha1.patch #Patch10004: 10004-Don-t-tell-the-compiler-to-do-annoying-things-with-f.patch Patch10005: 10005-Add-grub_qdprintf-grub_dprintf-without-the-file-line.patch Patch10006: 10006-Make-a-gdb-dprintf-that-tells-us-load-addresses.patch # # Mga patches: # Patch20001: grub2-2.00-mga-add_failsafe-10_linux.in.patch BuildRequires: flex bison binutils python BuildRequires: ncurses-devel bzip2-devel BuildRequires: freetype-devel libusb-devel BuildRequires: ruby BuildRequires: glibc-static-devel BuildRequires: liblzo-devel BuildRequires: rpm-devel BuildRequires: autoconf automake autogen device-mapper-devel BuildRequires: freetype-devel gettext-devel git BuildRequires: texinfo BuildRequires: help2man BuildRequires: fuse-devel 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. %ifnarch %arm %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. %endif %ifarch %arm %package uboot Summary: Boot-loader with support for UBOOT Group: System/Boot and Init Provides: bootloader Provides: grub2bootloader = %{version}-%{release} Requires: %{name}-common = %{version}-%{release} %description uboot configurable and customizable boot-loader with modular architecture. It supports a wide range of kernel formats, file systems, computer architectures and hardware devices. %endif %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-%{tarversion} cp %{SOURCE6} .gitignore git init echo '![[:digit:]][[:digit:]]_*.in' > util/grub.d/.gitignore echo '!*.[[:digit:]]' > util/.gitignore git config user.email "%{name}-owner@fedoraproject.org" git config user.name "Fedora Ninjas" git config gc.auto 0 git add . git commit -a -q -m "%{tarversion} baseline." git am %{patches} util/grub.d/.gitignore echo '!*.[[:digit:]]' > util/.gitignore git config user.email "%{name}-owner@fedoraproject.org" git config user.name "Fedora Ninjas" git config gc.auto 0 git add . git commit -a -q -m "%{tarversion} baseline." git am %{patches} %{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 %ifnarch %arm %preun efi # Only if uninstalling if [ $1 -eq 0 ]; then rm -rf /boot/%{name}/%{efi_arch} rm -rf /boot/%{name}/locale fi %endif %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 %ifnarch %arm %files %dir %{_libdir}/grub %dir %{_libdir}/grub/i386-pc %{_libdir}/grub/i386-pc/* %endif %ifnarch %arm %files efi %doc README.efi %dir %{_libdir}/grub %dir %{_libdir}/grub/%{efi_arch} %{_libdir}/grub/%{efi_arch}/* %endif %ifarch %arm %files uboot %dir %{_libdir}/grub %dir %{_libdir}/grub/%{efi_arch} %{_libdir}/grub/%{efi_arch}/* %endif %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}-* %{_datarootdir}/bash-completion/completions/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/*