# --enable-grub-emu-usb conflicts with --enable-grub-emu-pci, emu-pci seems experimental
# - to build and install the `grub-emu' debugging utility we need to re-run build with --target=emu
# - put grub-emu to subpackage if it is fixed
-# - warning: Installed (but unpackaged) file(s) found:
-# /sbin/grub-sparc64-setup
-# /usr/share/man/man8/grub-sparc64-setup.8.gz
-
-# /boot/grub/config.h
-# /etc/bash_completion.d/grub
-# /sbin/grub-sparc64-setup
-# /boot/grub/gdb_grub
-# /boot/grub/gmodule.pl
-# /sbin/grub-sparc64-setup
#
# Conditional build:
%bcond_with grubemu # build grub-emu debugging utility
%bcond_without pc # do not build for PC BIOS platform
%bcond_without efi # do not build for EFI platform
-%if "%{cc_version}" < "3.4"
-# cc does not support:
-# cc1: sorry, unimplemented: code model `large' not supported yet
-%undefine with_efiemu
+%ifnarch %{ix86} %{x8664} x32
+%undefine with_pc
+%endif
+%ifnarch %{ix86} %{x8664} x32 ia64
+%undefine with_efi
%endif
-%ifnarch %{x8664}
+%ifnarch %{x8664} x32
# non-x86_64 arch doesn't support this
%undefine with_efiemu
%endif
# the 'most natural' platform should go last
+%ifarch %{ix86} %{x8664} x32 ia64
%define platforms %{?with_efi:efi} %{?with_pc:pc}
+%endif
+%ifarch ppc ppc64 sparc64
+%define platforms ieee1275
+%endif
+%ifarch mips
+%define platforms arc
+%endif
+%ifarch mipsel
+%define platforms loongson
+%endif
+%define rel 1
Summary: GRand Unified Bootloader
Summary(de.UTF-8): GRUB2 - ein Bootloader für x86 und ppc
Summary(hu.UTF-8): GRUB2 - rendszerbetöltő x86 és ppc gépekhez
Summary(pl.UTF-8): GRUB2 - bootloader dla x86 i ppc
Summary(pt_BR.UTF-8): Gerenciador de inicialização GRUB2
Name: grub2
-Version: 2.00
-Release: 0.3
+Version: 2.02
+Release: 5
License: GPL v2
Group: Base
-Source0: http://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz
-# Source0-md5: a1043102fbc7bcedbf53e7ee3d17ab91
+Source0: ftp://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz
+# Source0-md5: 8a4a2a95aac551fb0fba860ceabfa1d3
Source1: update-grub
Source2: update-grub.8
Source3: grub.sysconfig
Source4: grub-custom.cfg
-URL: http://www.gnu.org/software/grub/
-Patch0: pld-initrd.patch
Patch1: pld-sysconfdir.patch
Patch2: grub-garbage.patch
Patch3: grub-lvmdevice.patch
Patch4: pld-mkconfigdir.patch
Patch5: grub-mkconfig-diagnostics.patch
-Patch6: ppc.patch
-Patch7: %{name}-awk.patch
-Patch8: posix.patch
-Patch9: %{name}-gets.patch
-Patch10: %{name}-fonts_path.patch
-Patch11: %{name}-tftp_fix.patch
+Patch6: posix.patch
+Patch7: %{name}-fonts_path.patch
+Patch8: add-vlan-tag-support.patch
+Patch9: just-say-linux.patch
+Patch10: ignore-kernel-symlinks.patch
+Patch11: choose-preferred-initrd.patch
+Patch12: %{name}-cfg.patch
+Patch13: efi-net-fix.patch
+Patch14: blscfg.patch
+# https://git.archlinux.org/svntogit/packages.git/plain/trunk/0002-intel-ucode.patch?h=packages/grub
+Patch15: intel-ucode.patch
+Patch16: xfs.patch
+Patch17: gcc8.patch
+Patch18: grub2-binutils.patch
+URL: http://www.gnu.org/software/grub/
BuildRequires: autoconf >= 2.53
BuildRequires: automake >= 1:1.11.1-1
BuildRequires: bison
BuildRequires: device-mapper-devel
+BuildRequires: flex >= 2.5.35
BuildRequires: fonts-TTF-DejaVu
-BuildRequires: freetype-devel
+BuildRequires: freetype-devel >= 2
BuildRequires: gawk
-BuildRequires: gettext-devel
+BuildRequires: gcc >= 5:3.4
+BuildRequires: gettext-tools
+BuildRequires: glibc-localedb-all
+BuildRequires: glibc-static
BuildRequires: help2man
+BuildRequires: libfuse-devel
BuildRequires: libtool
+BuildRequires: ncurses-devel
+BuildRequires: python
+BuildRequires: python-modules
+BuildRequires: rpm >= 4.4.9-56
+BuildRequires: rpmbuild(macros) >= 1.213
+BuildRequires: sed >= 4.0
+BuildRequires: tar >= 1:1.22
BuildRequires: texinfo
+BuildRequires: xz
+BuildRequires: xz-devel
%ifarch %{x8664}
BuildRequires: /usr/lib/libc.so
%if "%{pld_release}" == "ac"
BuildRequires: libgcc32
%else
-BuildRequires: gcc-multilib
+BuildRequires: gcc-multilib-32
%endif
%endif
-BuildRequires: glibc-static
-BuildRequires: ncurses-devel
-BuildRequires: rpm >= 4.4.9-56
-BuildRequires: rpmbuild(macros) >= 1.213
-BuildRequires: sed >= 4.0
+Requires: %{name}-platform = %{version}-%{release}
+Requires: pld-release
Requires: which
+%ifarch %{ix86} %{x8664}
+Suggests: %{name}-platform-pc
+%endif
Suggests: cdrkit-mkisofs
Suggests: os-prober
Provides: bootloader
Conflicts: grub
-Requires: %{name}-platform = %{version}-%{release}
-ExclusiveArch: %{ix86} %{x8664} ppc sparc64
+ExclusiveArch: %{ix86} %{x8664} x32 ia64 mips mipsel ppc ppc64 sparc64
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _sbindir /sbin
# part of grub code is not relocable (these are not Linux libs)
# stack protector also breaks non-Linux binaries
-%define filterout_c -fPIC
+# any kind of forced optimizations makes grub2 unreliable (random
+# reboots and hangs on boot menu screen)
+%define filterout_c -fPIC -O.
%undefine _ssp_cflags
+%undefine _fortify_cflags
%description
GRUB is a GPLed bootloader intended to unify bootloading across x86
cargador de inicialización (boot loader).
%description -l pl.UTF-8
-GRUB jest bootloaderem na licencji GNU, mającym na celu unifikację
+GRUB jest bootloaderem na licencji GNU GPL, mającym na celu unifikację
procesu bootowania na systemach x86. Potrafi nie tylko ładować jądra
-Linuksa i *BSD: posiada również implementacje standardu Multiboot,
+Linuksa i *BSD: posiada również implementację standardu Multiboot,
który pozwala na elastyczne ładowanie wielu obrazów bootowalnych
(czego wymagają modułowe jądra, takie jak GNU Hurd).
%package -n bash-completion-%{name}
Summary: bash-completion for GRUB
-Summary(pl.UTF-8): bashowe uzupełnianie nazw dla GRUB
+Summary(pl.UTF-8): Bashowe uzupełnianie nazw dla GRUB-a
Group: Applications/Shells
Requires: bash-completion
+%if "%{_rpmversion}" >= "5"
+BuildArch: noarch
+%endif
%description -n bash-completion-%{name}
This package provides bash-completion for GRUB.
%description -n bash-completion-%{name} -l pl.UTF-8
-Pakiet ten dostarcza bashowe uzupełnianie nazw dla GRUB.
+Pakiet ten dostarcza bashowe uzupełnianie nazw dla GRUB-a.
%package platform-pc
Summary: PC BIOS platform support for GRUB
+Summary(pl.UTF-8): Obsługa platformy PC BIOS dla GRUB-a
Group: Base
Provides: %{name}-platform = %{version}-%{release}
%description platform-pc
PC BIOS platform support for GRUB.
+%description platform-pc -l pl.UTF-8
+Obsługa platformy PC BIOS dla GRUB-a.
+
%package platform-efi
Summary: (U)EFI platform support for GRUB
+Summary(pl.UTF-8): Obsługa platformy (U)EFI dla GRUB-a
Group: Base
+Suggests: efibootmgr
Provides: %{name}-platform = %{version}-%{release}
%description platform-efi
(U)EFI platform support for GRUB.
+%description platform-efi -l pl.UTF-8
+Obsługa platformy (U)EFI dla GRUB-a.
+
%package mkfont
Summary: GRUB font files converter
+Summary(pl.UTF-8): Konwerter plików fontów GRUB-a
Group: Base
%description mkfont
Converts common font file formats into PF2.
+%description mkfont -l pl.UTF-8
+Program do konwersji popularnych formatów plików fontów do PF2.
+
%package theme-starfield
Summary: starfield theme for GRUB
+Summary(pl.UTF-8): Motyw starfield dla GRUB-a
Group: Base
%description theme-starfield
starfield theme for GRUB.
+%description theme-starfield -l pl.UTF-8
+Motyw starfield dla GRUB-a.
+
%prep
%setup -q -n grub-%{version}
-%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
+%patch12 -p0
+%patch13 -p1
+%patch14 -p1
+%patch15 -p1
+%patch16 -p1
+%patch17 -p1
+%patch18 -p1
-%if "%{cc_version}" < "3.4"
-grep -rl -- -Wno-missing-field-initializers . | xargs %{__sed} -i -e 's,-Wno-missing-field-initializers,,'
-%{__sed} -i -e '/video_mod_CFLAGS/s/$/ -Wno-error/' conf/common.rmk
-%endif
+# 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*
%build
# if gold is used then grub doesn't even boot
+# https://savannah.gnu.org/bugs/?34539
+# http://sourceware.org/bugzilla/show_bug.cgi?id=14196
install -d our-ld
-ln -s /usr/bin/ld.bfd our-ld/ld
+ln -f -s /usr/bin/ld.bfd our-ld/ld
export PATH=$(pwd)/our-ld:$PATH
-cp -f /usr/share/automake/config.sub .
-%{__libtoolize}
+## not only the typicall autotools stuff
+#./autogen.sh
+
+#{__gettextize}
%{__aclocal} -I m4
-%{__autoheader}
-echo timestamp > stamp-h.in
%{__autoconf}
-export CFLAGS="%{rpmcflags} -Os %{?debug:-g}"
+%{__autoheader}
+%{__automake}
for platform in %{platforms} ; do
install -d build-${platform}
cd build-${platform}
if [ "$platform" != "efi" ] ; then
- platform_opts="--%{!?with_efiemu:dis}%{?with_efiemu:en}able-efiemu"
+ platform_opts="--enable-efiemu%{!?with_efiemu:=no}"
else
platform_opts=""
fi
- ln -s ../configure .
+ ln -f -s ../configure .
# mawk stalls at ./genmoddep.awk, so force gawk
AWK=gawk \
%configure \
--with-platform=${platform} \
--disable-werror \
+ --enable-grub-themes \
%if %{with grubemu}
--enable-grub-emu-usb \
--enable-grub-emu-sdl \
$platform_opts \
TARGET_LDFLAGS=-static
+ %{__make} -j1 -C po update-gmo
%{__make}
cd ..
done
# rm -f, because it sometimes exists, sometimes not, depending which texlive you have installed
rm -f $RPM_BUILD_ROOT%{_infodir}/dir
+# platform specific, unnecessarily always installed
+%ifnarch %{ix86} %{x8664} x32
+%{__rm} $RPM_BUILD_ROOT{%{_sbindir}/grub-bios-setup,%{_mandir}/man8/grub-bios-setup.8}
+%endif
+%ifnarch sparc64
+%{__rm} $RPM_BUILD_ROOT{%{_sbindir}/grub-sparc64-setup,%{_mandir}/man8/grub-sparc64-setup.8}
+%endif
+
# core.img - bootable image generated by grub-mkimage(1) via grub-install(1)
touch $RPM_BUILD_ROOT%{_grubdir}/core.img
touch $RPM_BUILD_ROOT%{_grubdir}/device.map
%postun -p %{_sbindir}/postshell
-/usr/sbin/fix-info-dir -c %{_infodir}
-%triggerpostun -- %{name} < %{version}-0
-# Note this trigger on version upgrade
+%triggerpostun -- %{name} < 2.00-2
+# Note this trigger on version upgrade needed only for upgrade from
+# old grub2 packages which contained modules in /boot/grub
+# or were built with optimizations enabled
# don't do anything on --downgrade
if [ $1 -le 1 ]; then
exit 0
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog NEWS README THANKS TODO
%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/grub
-%attr(755,root,root) %{_sbindir}/grub-bios-setup
%attr(755,root,root) %{_sbindir}/grub-editenv
%attr(755,root,root) %{_sbindir}/grub-fstest
+%attr(755,root,root) %{_sbindir}/grub-file
+%attr(755,root,root) %{_sbindir}/grub-glue-efi
%attr(755,root,root) %{_sbindir}/grub-kbdcomp
%attr(755,root,root) %{_sbindir}/grub-install
+%attr(755,root,root) %{_sbindir}/grub-macbless
%attr(755,root,root) %{_sbindir}/grub-menulst2cfg
%attr(755,root,root) %{_sbindir}/grub-mkconfig
%attr(755,root,root) %{_sbindir}/grub-mklayout
%attr(755,root,root) %{_sbindir}/grub-mount
%attr(755,root,root) %{_sbindir}/grub-ofpathname
%attr(755,root,root) %{_sbindir}/grub-reboot
+%attr(755,root,root) %{_sbindir}/grub-render-label
%attr(755,root,root) %{_sbindir}/grub-script-check
%attr(755,root,root) %{_sbindir}/grub-set-default
+%attr(755,root,root) %{_sbindir}/grub-syslinux2cfg
%attr(755,root,root) %{_sbindir}/update-grub
-%ifarch %{ix86} %{x8664}
+%ifarch %{ix86} %{x8664} x32
+%attr(755,root,root) %{_sbindir}/grub-bios-setup
+%{_mandir}/man8/grub-bios-setup.8*
+%endif
+%ifarch %{ix86} %{x8664} x32
%attr(755,root,root) %{_sbindir}/grub-mkimage
%{_mandir}/man1/grub-mkimage.1*
%else
%attr(755,root,root) %{_sbindir}/grub-probe
%{_mandir}/man8/grub-probe.8*
%endif
+%ifarch sparc64
+%attr(755,root,root) %{_sbindir}/grub-sparc64-setup
+%{_mandir}/man8/grub-sparc64-setup.8*
+%endif
%{_mandir}/man1/grub-editenv.1*
+%{_mandir}/man1/grub-file.1*
%{_mandir}/man1/grub-fstest.1*
+%{_mandir}/man1/grub-glue-efi.1*
%{_mandir}/man1/grub-kbdcomp.1*
%{_mandir}/man1/grub-menulst2cfg.1*
%{_mandir}/man1/grub-mklayout.1*
+%{_mandir}/man1/grub-mknetdir.1*
%{_mandir}/man1/grub-mkpasswd-pbkdf2.1*
%{_mandir}/man1/grub-mkrelpath.1*
%{_mandir}/man1/grub-mkrescue.1*
%{_mandir}/man1/grub-mkstandalone.1*
%{_mandir}/man1/grub-mount.1*
+%{_mandir}/man1/grub-render-label.1*
%{_mandir}/man1/grub-script-check.1*
-%{_mandir}/man8/grub-bios-setup.8*
+%{_mandir}/man1/grub-syslinux2cfg.1*
%{_mandir}/man8/grub-install.8*
+%{_mandir}/man8/grub-macbless.8*
%{_mandir}/man8/grub-mkconfig.8*
-%{_mandir}/man8/grub-mknetdir.8*
%{_mandir}/man8/grub-ofpathname.8*
%{_mandir}/man8/grub-reboot.8*
%{_mandir}/man8/grub-set-default.8*
%attr(755,root,root) /lib/grub.d/30_os-prober
%attr(755,root,root) /lib/grub.d/41_custom
-%ifarch %{ix86} %{x8664}
+# these are now installed only on matching hosts
+#%attr(755,root,root) /lib/grub.d/10_hurd
+#%attr(755,root,root) /lib/grub.d/10_illumos
+#%attr(755,root,root) /lib/grub.d/10_kfreebsd
+#%attr(755,root,root) /lib/grub.d/10_netbsd
+#%attr(755,root,root) /lib/grub.d/10_xnu
+
+%ifarch %{ix86} %{x8664} x32
%attr(755,root,root) %{_sbindir}/grub-probe
%{_mandir}/man8/grub-probe.8*
%endif
%{_libexecdir}/*-pc/gdb_grub
%{_libexecdir}/*-pc/gmodule.pl
%if %{with efiemu}
-%ifarch %{x8664}
%{_libexecdir}/*-pc/efiemu*.o
%endif
-%endif
%{_libexecdir}/*-pc/kernel.img
-%ifarch %{ix86} %{x8664} sparc sparc64
+%ifarch %{ix86} %{x8664} x32 sparc sparc64
%{_libexecdir}/*-pc/boot.img
+%{_libexecdir}/*-pc/boot_hybrid.img
%{_libexecdir}/*-pc/cdboot.img
%{_libexecdir}/*-pc/diskboot.img
%{_libexecdir}/*-pc/lnxboot.img
%files mkfont
%defattr(644,root,root,755)
-%{_mandir}/man1/grub-mkfont.1*
%attr(755,root,root) %{_sbindir}/grub-mkfont
+%{_mandir}/man1/grub-mkfont.1*
%files theme-starfield
%defattr(644,root,root,755)