###############################################################################
name = grub
-version = 2.00
-release = 5.1
+version = 2.02
+beta = beta3
+release = 0.%{beta}.1
sup_arches = x86_64 i686
+thisapp = %{name}-%{version}~%{beta}
groups = System/Boot
url = http://www.gnu.org/software/grub/
gettext
libdevmapper-devel
ncurses-devel
- paxctl
zlib-devel
%{unifont}
end
+ # Don't leak our CFLAGS to boot code
+ export HOST_CFLAGS = %{CFLAGS}
+ export HOST_LDFLAGS = %{LDFLAGS}
+
+ platforms = efi
+
+ if "%{DISTRO_PLATFORM}" == "x86"
+ platforms += pc
+ end
+
prepare_cmds
cp -vf %{unifont} unifont.pcf.gz
./autogen.sh
+
+ for platform in %{platforms}; do
+ cp -r %{DIR_APP} %{DIR_APP}-${platform}
+ done
end
# As the modules contain always 32 bit code, they
# should be living in /usr/lib.
libdir = %{prefix}/lib
- configure_options += \
- --target="i386" \
- --with-platform=pc \
- --program-transform-name=s,grub,grub, \
- --disable-werror \
- CFLAGS="$(echo %{CFLAGS} | sed \
- -e 's/-Wp,-D_FORTIFY_SOURCE=2//g' \
- -e 's/-fstack-protector-strong//g' \
- -e 's/-fstack-protector-all//g' \
- -e 's/-fstack-protector//g' \
- -e 's/-fPIC//g' \
- -e 's/--param=ssp-buffer-size=4//g' \
- -e 's/-mregparm=3/-mregparm=4/g' \
- -e 's/-fexceptions//g' \
- -e 's/-m64//g' \
- -e 's/-fasynchronous-unwind-tables//g' )"
-
- install_cmds
+ build
+ for platform in %{platforms}; do
+ pushd %{DIR_APP}-${platform}
+ ./configure \
+ %{configure_options} \
+ --with-platform=${platform} \
+ --disable-werror \
+ CFLAGS= LDFLAGS=
+
+ make %{PARALLELISMFLAGS}
+ popd
+ done
+ end
+
+ install
+ for platform in %{platforms}; do
+ pushd %{DIR_APP}-${platform}
+ make install DESTDIR=%{BUILDROOT}
+ popd
+ done
+
# Install empty configuration file.
mkdir -pv %{BUILDROOT}/boot/grub
touch %{BUILDROOT}/boot/grub/grub.cfg
%{BUILDROOT}%{bindir}/grub-mkfont -o DejaVuSans-Bold-14.pf2 \
-s 14 %{datadir}/fonts/dejavu/DejaVuSans-Bold.ttf
popd
-
- # Disable hardening.
- paxctl -mpes \
- %{BUILDROOT}%{sbindir}/grub-bios-setup \
- %{BUILDROOT}%{sbindir}/grub-probe
-
- paxctl -mpex \
- %{BUILDROOT}%{bindir}/grub-script-check
end
debuginfo_strict_build_id = false
end
-quality-agent
- whitelist_nx
- %{bindir}/*|%{sbindir}/*
- end
-end
-
packages
package %{name}
requires
--- /dev/null
+From ea8de5d2ee58178381e5809e4d5fe79861e61b04 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Sat, 5 Mar 2016 17:21:15 -0500
+Subject: [PATCH] [2.02] 10_linux: Fix grouping of tests for GRUB_DEVICE
+
+Commit 7290bb562 causes GRUB_DISABLE_LINUX_UUID to be ignored due to
+mixing of || and && operators. Add some parens to help with that.
+---
+ util/grub.d/10_linux.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 5a78513..de9044c 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -47,7 +47,7 @@ esac
+ # and mounting btrfs requires user space scanning, so force UUID in this case.
+ if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
+ || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
+- || test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm; then
++ || ( test -e "${GRUB_DEVICE}" && uses_abstraction "${GRUB_DEVICE}" lvm ); then
+ LINUX_ROOT_DEVICE=${GRUB_DEVICE}
+ else
+ LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+--
+2.7.2
+
--- /dev/null
+2016-05-21 Magnus Granberg <zorry@gentoo.org>
+
+ #583042 sys-boot/grub-2.02_beta3-r1: building w/gcc-6[pie]: error:
+ x86_64-pc-linux-gnu/bin/ld: -r and -shared may not be used together
+
+ * acinclude.m4: Add -no-pie check.
+ * configure.ac: Add -no-pie to TARGET_LDFLAGS if needed.
+
+--- a/acinclude.m4 2015-11-11 20:56:52.000000000 +0100
++++ b/acinclude.m4 2016-05-17 00:08:22.000000000 +0200
+@@ -390,6 +390,24 @@ else
+ [fi]
+ ])
+
++dnl Check if the Linker supports `-no-pie'.
++AC_DEFUN([grub_CHECK_NO_PIE],
++[AC_MSG_CHECKING([whether linker accepts -no-pie])
++AC_CACHE_VAL(grub_cv_cc_ld_nopie,
++[save_LDFLAGS="$LDFLAGS"
++LDFLAGS="$LDFLAGS -no-pie"
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
++ [grub_cv_cc_ld_no_pie=yes],
++ [grub_cv_cc_ld_no_pie=no])
++LDFLAGS="$save_LDFLAGS"
++])
++AC_MSG_RESULT([$grub_cv_cc_ld_no_pie])
++nopie_possible=no
++if test "x$grub_cv_cc_ld_no_pie" = xyes ; then
++ nopie_possible=yes
++fi
++])
++
+ dnl Check if the C compiler supports `-fPIC'.
+ AC_DEFUN([grub_CHECK_PIC],[
+ [# Position independent executable.
+--- a/configure.ac 2016-02-27 13:40:56.000000000 +0100
++++ b/configure.ac 2016-05-17 00:57:29.471000000 +0200
+@@ -1184,13 +1184,18 @@ CFLAGS="$TARGET_CFLAGS"
+
+ # Position independent executable.
+ grub_CHECK_PIE
++grub_CHECK_NO_PIE
+ [# Need that, because some distributions ship compilers that include
+-# `-fPIE' in the default specs.
++# `-fPIE' and '-pie' in the default specs.
+ if [ x"$pie_possible" = xyes ]; then
+ TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
++fi
++if [ x"$nopie_possible" = xyes ] && [ x"$pie_possible" = xyes ]; then
++ TARGET_LDFLAGS="$TARGET_LDFLAGS -no-pie"
+ fi]
+
+ CFLAGS="$TARGET_CFLAGS"
++LDFLAGS="$TARGET_LDFLAGS"
+
+ # Position independent executable.
+ grub_CHECK_PIC
+++ /dev/null
-From d4bd41f972c6e22b86c773cbba2a1e14f400a8be Mon Sep 17 00:00:00 2001
-From: Peter Jones <pjones@redhat.com>
-Date: Mon, 14 Mar 2011 14:27:42 -0400
-Subject: [PATCH] Don't say "GNU/Linux" in generated menus.
-
----
- util/grub.d/10_linux.in | 4 ++--
- util/grub.d/20_linux_xen.in | 4 ++--
- 2 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
-index a09c3e6..0b0df78 100644
---- a/util/grub.d/10_linux.in
-+++ b/util/grub.d/10_linux.in
-@@ -29,9 +29,9 @@ export TEXTDOMAINDIR=@localedir@
- CLASS="--class gnu-linux --class gnu --class os"
-
- if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
-- OS=GNU/Linux
-+ OS="$(sed 's, release .*$,,g' /etc/system-release)"
- else
-- OS="${GRUB_DISTRIBUTOR} GNU/Linux"
-+ OS="${GRUB_DISTRIBUTOR}"
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
- fi
-
-diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
-index ee49cd9..10422b0 100644
---- a/util/grub.d/20_linux_xen.in
-+++ b/util/grub.d/20_linux_xen.in
-@@ -29,9 +29,9 @@ export TEXTDOMAINDIR=@localedir@
- CLASS="--class gnu-linux --class gnu --class os --class xen"
-
- if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
-- OS=GNU/Linux
-+ OS="$(sed 's, release .*$,,g' /etc/system-release)"
- else
-- OS="${GRUB_DISTRIBUTOR} GNU/Linux"
-+ OS="${GRUB_DISTRIBUTOR}"
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
- fi
-
---
-1.7.4
-
+++ /dev/null
-From f66d54b934710f54999debb72e8b7c620edece1d Mon Sep 17 00:00:00 2001
-From: Peter Jones <pjones@redhat.com>
-Date: Fri, 25 May 2012 15:28:19 -0400
-Subject: [PATCH] gnulib accused in build breaking shocker.
-
----
- grub-core/gnulib/stdio.in.h | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/grub-core/gnulib/stdio.in.h b/grub-core/gnulib/stdio.in.h
-index 80b9dbf..69932d9 100644
---- a/grub-core/gnulib/stdio.in.h
-+++ b/grub-core/gnulib/stdio.in.h
-@@ -141,7 +141,9 @@ _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
- so any use of gets warrants an unconditional warning. Assume it is
- always declared, since it is required by C89. */
- #undef gets
-+#if 0
- _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
-+#endif
-
- #if @GNULIB_FOPEN@
- # if @REPLACE_FOPEN@
---
-1.7.10.1
-