%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 %global pc_arch i386-pc Name: grub2 Version: 2.00 Release: %mkrel 41 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-%{version}.tar.xz Source1: 90_persistent Source2: grub.default Source3: README.Mageia Source4: README.efi Source5: grub2.filter Source6: grub2.script 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: Mageia3-grub2-1024x768.png Source15: MageiaLogoFonts-bdf.tar.xz # Fix build against glibc-2.16 Patch0: grub2-2.0.0-mga-fix_gets-stdio.in.h.patch # Fedora patches: # https://bugzilla.redhat.com/show_bug.cgi?id=857936 Patch1: grub2-2.00-fda-add-fw_path-search_v2.patch # Add support for entering the firmware setup screen. Patch2: grub2-2.00-fda-Add-fwsetup.patch # Don't decrease efi memory map size Patch3: grub2-2.00-fda-dont-decrease-mmap-size.patch # IBM client architecture (CAS) reboot support Patch4: grub2-2.00-fda-cas-reboot-support.patch # Read chunks in smaller blocks Patch5: grub2-2.00-fda-efidisk-ahci-workaround.patch # Fix crash on http: https://bugzilla.redhat.com/show_bug.cgi?id=860834 Patch6: grub2-2.00-fda-fix-http-crash.patch # Issue separate DNS queries for ipv4 and ipv6 Patch7: grub2-2.00-fda-Issue-separate-DNS-queries-for-ipv4-and-ipv6.patch # Don't allow insmod when secure boot is enabled Patch8: grub2-2.00-fda-no-insmod-on-sb.patch # Add support for crappy cd craparino Patch9: grub2-2.00-fda-cdpath.patch # Add support for linuxefi Patch10: grub2-2.00-fda-linuxefi.patch # Use "linuxefi" and "initrdefi" where appropriate Patch11: grub2-2.00-fda-use-linuxefi.patch # Fix parallel build Patch12: grub2-2.00-parallel-build.patch # Fix autoreconf warnings Patch13: grub2-2.00-mga-fix_AM_PROG_MKDIR_P-configure.ac.patch BuildRequires: flex BuildRequires: bison BuildRequires: ruby BuildRequires: binutils BuildRequires: glibc-static-devel BuildRequires: ncurses-devel BuildRequires: liblzo-devel BuildRequires: freetype2-devel BuildRequires: libusb-devel BuildRequires: help2man BuildRequires: texinfo BuildRequires: libdevmapper-devel BuildRequires: fuse-devel # For updating Makefile template after patch 12 BuildRequires: autogen Conflicts: %{name}-efi Suggests: os-prober >= 1.53 Suggests: %{name}-mageia-theme = %{version}-%{release} Provides: bootloader Provides: grub2bootloader = %{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. It may be safely installed alongside legacy grub. 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} Suggests: os-prober >= 1.53 Suggests: efibootmgr Suggests: %{name}-mageia-theme = %{version}-%{release} Provides: bootloader Provides: grub2bootloader = %{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. It may be safely installed alongside legacy grub. Refer to the README.Mageia and README.efi files that are part of this package's documentation for more information. %package mageia-theme Summary: Provides a graphical theme with a custom Mageia background for grub2 Group: System/Boot and Init Requires: grub2bootloader = %{version}-%{release} Requires: mageia-theme %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-%{version} %patch0 -p0 -b .grub2-2.0.0-mga-fix_gets-stdio.in.h.patch %patch1 -p1 -b .grub2-2.00-fda-add-fw_path-search_v2.patch %patch2 -p1 -b .grub2-2.00-fda-Add-fwsetup.patch %patch3 -p1 -b .grub2-2.00-fda-dont-decrease-mmap-size.patch %patch4 -p1 -b .grub2-2.00-fda-cas-reboot-support.patch %patch5 -p1 -b .grub2-2.00-fda-efidisk-ahci-workaround.patch %patch6 -p1 -b .grub2-2.00-fda-fix-http-crash.patch %patch7 -p1 -b .grub2-2.00-fda-Issue-separate-DNS-queries-for-ipv4-and-ipv6.patch %patch8 -p1 -b .grub2-2.00-fda-no-insmod-on-sb.patch %patch9 -p1 -b .grub2-2.00-fda-cdpath.patch %patch10 -p1 -b .grub2-2.00-fda-linuxefi.patch %patch11 -p1 -b .grub2-2.00-fda-use-linuxefi.patch %patch12 -p1 -b .grub2-2.00-parallel-build.patch %patch13 -p1 -b .grub2-2.00-mga-fix_AM_PROG_MKDIR_P-configure.ac.patch # README.Mageia cp %{SOURCE3} . # README.efi cp %{SOURCE4} . cd .. rm -rf grub-efi-%{version} mv grub-%{version} grub-efi-%{version} %setup -q -n grub-%{version} %patch0 -p0 -b .grub2-2.0.0-mga-fix_gets-stdio.in.h.patch %patch1 -p1 -b .grub2-2.00-fda-add-fw_path-search_v2.patch %patch2 -p1 -b .grub2-2.00-fda-Add-fwsetup.patch %patch3 -p1 -b .grub2-2.00-fda-dont-decrease-mmap-size.patch %patch4 -p1 -b .grub2-2.00-fda-cas-reboot-support.patch %patch5 -p1 -b .grub2-2.00-fda-efidisk-ahci-workaround.patch %patch6 -p1 -b .grub2-2.00-fda-fix-http-crash.patch %patch7 -p1 -b .grub2-2.00-fda-Issue-separate-DNS-queries-for-ipv4-and-ipv6.patch %patch8 -p1 -b .grub2-2.00-fda-no-insmod-on-sb.patch %patch9 -p1 -b .grub2-2.00-fda-cdpath.patch %patch10 -p1 -b .grub2-2.00-fda-linuxefi.patch %patch11 -p1 -b .grub2-2.00-fda-use-linuxefi.patch %patch12 -p1 -b .grub2-2.00-parallel-build.patch %patch13 -p1 -b .grub2-2.00-mga-fix_AM_PROG_MKDIR_P-configure.ac.patch # README.Mageia cp %{SOURCE3} . # README.efi cp %{SOURCE4} . %build cd .. pushd grub-%{version} # Because of patch 12 ./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-%{version} # Because of patch 12 ./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-%{version} %makeinstall_std popd pushd grub-%{version} %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} touch %{buildroot}/boot/%{name}/grub.cfg # 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 <<EOF # Add any extra custom menu entries in here EOF # Provide 'update-grub' and update-grub2 symlink for *buntu exiles ;) cat > %{buildroot}%{_bindir}/update-grub <<EOF #!/bin/sh su --login root -c "/usr/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg" EOF chmod +x %{buildroot}%{_bindir}/update-grub ln -s %{_bindir}/update-grub %{buildroot}%{_bindir}/update-grub2 # Filetriggers install -d %{buildroot}/%{_filetriggers_dir} install -D %{SOURCE5} %{buildroot}/%{_filetriggers_dir}/%{name}.filter install -D %{SOURCE6} %{buildroot}/%{_filetriggers_dir}/%{name}.script # Defaults install -m 644 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/default/grub # Change "GNU/Linux" in menu selections to "Linux" sed -i 's/GNU\/Linux/Linux/g' %{buildroot}%{_sysconfdir}/grub.d/10_linux %find_lang grub popd %post exec > /var/log/%{name}_post.log 2>&1 # Determine the partition with /boot BOOT_PARTITION=$(df -h /boot |(read; awk '{print $1; exit}')) # Generate core.img, but don't let it be installed in boot sector %{name}-install --directory=%{_libdir}/grub/%{pc_arch} --grub-setup=/bin/true $BOOT_PARTITION # Generate grub.cfg only on install if [ $1 -eq 1 ]; then %{name}-mkconfig -o /boot/%{name}/grub.cfg fi %post efi exec > /var/log/%{name}_post.log 2>&1 # Determine the partition with /boot BOOT_PARTITION=$(df -h /boot |(read; awk '{print $1; exit}')) # Generate core.img, but don't let it be installed in boot sector %{name}-install --directory=%{_libdir}/grub/%{efi_arch} --grub-setup=/bin/true $BOOT_PARTITION # Generate grub.cfg only on install if [ $1 -eq 1 ]; then %{name}-mkconfig -o /boot/%{name}/grub.cfg fi %post mageia-theme # Don't install if updating if [ $1 -eq 1 ] ; then # Remove trailing blank lines from /etc/default/grub sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' %{_sysconfdir}/default/grub # Check that /etc/default/grub ends in a linefeed [ "$(tail -n 1 %{_sysconfdir}/default/grub | wc --lines)" = "1" ] || echo >> %{_sysconfdir}/default/grub # Add theme echo "GRUB_THEME=/boot/grub2/themes/maggy/theme.txt" >> %{_sysconfdir}/default/grub fi %preun exec > /var/log/%{name}_preun.log 2>&1 # Only if uninstalling if [ $1 -eq 0 ]; then rm -rf /boot/%{name}/%{pc_arch} rm -rf /boot/%{name}/locale fi %preun efi exec > /var/log/%{name}_preun.log 2>&1 # Only if uninstalling if [ $1 -eq 0 ]; then rm -rf /boot/%{name}/%{efi_arch} rm -rf /boot/%{name}/locale fi %postun mageia-theme exec > /var/log/%{name}_theme_postun.log 2>&1 # Only if uninstalling theme if [ $1 -eq 0 ]; then # Remove theme from config if not commented sed -i '/^[[:space:]]*#/!s/GRUB_THEME=\/boot\/grub2\/themes\/maggy\/theme.txt//g' %{_sysconfdir}/default/grub # Remove maggy dir rm -rf /boot/%{name}/themes/maggy fi %files -f grub.lang %doc COPYING NEWS README THANKS TODO README.Mageia %{_infodir}/%{name}.info* %dir %{_libdir}/grub %dir %{_libdir}/grub/i386-pc %dir /boot/%{name} %dir /boot/%{name}/fonts %dir /boot/%{name}/themes %{_libdir}/grub/i386-pc/* %{_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/10_linux %{_sysconfdir}/grub.d/20_linux_xen %{_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}/grub.cfg %config(noreplace) /boot/%{name}/custom.cfg %{_infodir}/grub-dev.info.xz %{_mandir}/man1/%{name}-*.1* %{_mandir}/man8/%{name}-*.8* %{_filetriggers_dir}/%{name}.filter %{_filetriggers_dir}/%{name}.script %files efi -f grub.lang %doc COPYING NEWS README THANKS TODO README.Mageia README.efi %{_infodir}/%{name}.info* %dir %{_libdir}/grub %dir %{_libdir}/grub/%{efi_arch} %dir /boot/%{name} %dir /boot/%{name}/fonts %dir /boot/%{name}/themes %{_libdir}/grub/%{efi_arch}/* %{_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/10_linux %{_sysconfdir}/grub.d/20_linux_xen %{_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}/grub.cfg %config(noreplace) /boot/%{name}/custom.cfg %{_infodir}/grub-dev.info.xz %{_mandir}/man1/%{name}-*.1* %{_mandir}/man8/%{name}-*.8* %{_filetriggers_dir}/%{name}.filter %{_filetriggers_dir}/%{name}.script %files mageia-theme /boot/%{name}/fonts/unicode.pf2 /boot/%{name}/themes/maggy %changelog * Sun Mar 24 2013 barjac <barjac> 2.00-41.mga3 + Revision: 404821 - include tarball of master bdf fonts - update mkfonts script to make needed pf2 fonts from bdf tarball - updated theme fonts to fix some glyphs - thanks to diogenese for work on unofficial MageiaLogo font - update fonts * Fri Mar 22 2013 barjac <barjac> 2.00-40.mga3 + Revision: 404429 - fix update-grub env so os-prober can find blkid * Mon Mar 18 2013 barjac <barjac> 2.00-39.mga3 + Revision: 403927 - switch to mageia 3 theme background * Mon Mar 11 2013 barjac <barjac> 2.00-38.mga3 + Revision: 402075 - change theme font to MageiaLogo - corrections and improvements to README.Mageia * Thu Mar 07 2013 barjac <barjac> 2.00-37.mga3 + Revision: 401594 - move theme background image into package as it will be for mga3 release * Tue Mar 05 2013 tv <tv> 2.00-36.mga3 + Revision: 401431 - only update grub2.cfg if already existing - no need for bash * Mon Mar 04 2013 barjac <barjac> 2.00-35.mga3 + Revision: 401408 - correct path * Wed Feb 27 2013 barjac <barjac> 2.00-34.mga3 + Revision: 400520 - set default timeout to 10 seconds * Mon Feb 25 2013 barjac <barjac> 2.00-33.mga3 + Revision: 400332 - add update-grub & update-grub2 (symlink) - update README.Mageia for above - add note in /etc/default/grub - no need to patch aclocal.m4 - patch13 to fix autoreconf AM_PROG_MKDIR_P warnings * Sat Feb 23 2013 barjac <barjac> 2.00-32.mga3 + Revision: 400190 - revert to using unicode font for terminal - remove make tarball script - remove 7x13.pf2 font file - modify mkfonts script to not make 7x13.pf2 - re-enumerate sources * Sat Feb 23 2013 barjac <barjac> 2.00-31.mga3 + Revision: 400102 - improved workaround for RHL Bug 817187, removing it from %%post * Fri Feb 22 2013 barjac <barjac> 2.00-30.mga3 + Revision: 400001 - suppress error message on minimal install with --no-suggests #9148 * Wed Feb 20 2013 tv <tv> 2.00-29.mga3 + Revision: 399495 - do not package huge ChangeLog * Mon Feb 18 2013 barjac <barjac> 2.00-28.mga3 + Revision: 399253 - clean up files - add -n (no-clobber) to prevoius cp workaround for when this is fixed upstream * Sat Feb 16 2013 barjac <barjac> 2.00-27.mga3 + Revision: 398620 - Workaround for RHL Bug 817187 * Sun Feb 10 2013 barjac <barjac> 2.00-26.mga3 + Revision: 397694 - run autogen.sh in both build trees * Sun Feb 10 2013 pterjan <pterjan> 2.00-25.mga3 + Revision: 397685 - Fix parallel build * Sun Feb 10 2013 barjac <barjac> 2.00-24.mga3 + Revision: 397678 - try non-parallel build - forgot to apply all patches to both builds * Sat Feb 09 2013 barjac <barjac> 2.00-23.mga3 + Revision: 397663 - cherry picked patches from Fedora * Sat Feb 09 2013 barjac <barjac> 2.00-22.mga3 + Revision: 397534 - improved handling of theme addition/removal from /etc/default/grub - fixes bug where someone has removed linefeed from file end or has commented the THEME= line * Fri Feb 08 2013 barjac <barjac> 2.00-21.mga3 + Revision: 397190 - update theme with new font - add custom.cfg - new mkfonts script - re-enumerated sources - cleaned GNU/Linux from cluttering menus - matched font colours to Mageia logo - make grub2-efi also own /boot/grub2 ;) * Fri Feb 08 2013 tmb <tmb> 2.00-20.mga3 + Revision: 397106 - own /boot/grub2 dir too * Thu Feb 07 2013 barjac <barjac> 2.00-19.mga3 + Revision: 395043 - added warning note inside /etc/default/grub * Wed Feb 06 2013 barjac <barjac> 2.00-18.mga3 + Revision: 394991 - split out theme into separate package - theme now Suggested - os-prober and theme addition/removal handled by filetriggers - updated README.Mageia to reflect above changes - added option for disabling os-prober to /etc/default/grub * Mon Feb 04 2013 barjac <barjac> 2.00-17.mga3 + Revision: 394533 - os-prober should be Suggests * Mon Jan 28 2013 barjac <barjac> 2.00-16.mga3 + Revision: 392864 - edited help text in boot screen * Fri Jan 25 2013 barjac <barjac> 2.00-15.mga3 + Revision: 392262 - force copy of theme b/g for updates * Thu Jan 24 2013 barjac <barjac> 2.00-14.mga3 + Revision: 391754 - copy theme b/g to /boot when /boot is on separate partition in case / is encrypted * Sun Jan 20 2013 barjac <barjac> 2.00-13.mga3 + Revision: 390289 - update group * Wed Jan 16 2013 barjac <barjac> 2.00-12.mga3 + Revision: 388457 - add provides bootloader to both packages - add suggests mageia-theme to -efi package * Sat Jan 12 2013 umeabot <umeabot> 2.00-11.mga3 + Revision: 352682 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Mon Dec 24 2012 barjac <barjac> 2.00-10.mga3 + Revision: 334731 - updated description and README.Mageia * Mon Dec 17 2012 tv <tv> 2.00-9.mga3 + Revision: 331864 - fix build with official version - use official tarball (which includes translations) * Sat Dec 15 2012 tv <tv> 2.0-8.mga3 + Revision: 331059 - suggests instead of requiring mageia-theme * Sat Dec 15 2012 tv <tv> 2.0-7.mga3 + Revision: 331055 - requires mageia-theme (else image symlink is broken for graphical grub) * Thu Nov 15 2012 barjac <barjac> 2.0-6.mga3 + Revision: 318311 - corrected url - minor edits in desription and README.Mageia * Wed Oct 10 2012 barjac <barjac> 2.0-5.mga3 + Revision: 304517 - Fix i586 build with configure2_5x * Sun Sep 30 2012 barjac <barjac> 2.0-4.mga3 + Revision: 300624 - Changed group in line with new policy * Mon Sep 17 2012 barjac <barjac> 2.0-3.mga3 + Revision: 295597 - patch to fix build against glibc-2.16 - improved description * Fri Jun 29 2012 barjac <barjac> 2.0-2.mga3 + Revision: 265181 - New version final release of v2.0 - Removed revision from filename as this is a release - Added Suggests on efibootmgr - Moved files efi to end of spec - Removed README.efi from grub2 rpm - Added explanation about -efi rpm to README.Mageia - Changed var name in grub.default as changed upstream * Sun Jun 03 2012 barjac <barjac> 2.0-1.4412.mga3 + Revision: 253509 - Updated README.efi - Updated revision - Fixed updates deleting files in preun - Removed redundant code in install section - Corrected minor scripting error in mk_tar_from_grub_trunk * Tue May 29 2012 barjac <barjac> 2.0-1.4379.mga3 + Revision: 248863 - Removed dot from one summary - imported package grub2