build latest bzr snapshot, fixes gcc issues on efi boot

This commit is contained in:
Tobias Powalowski 2013-06-24 17:25:09 +00:00
parent 68a3db103f
commit 2c5f24c08b
4 changed files with 38 additions and 122 deletions

View File

@ -1,50 +0,0 @@
From d09689a5a2863043d007c1acb9bf0a8d1d3b776d Mon Sep 17 00:00:00 2001
From: Colin Watson <cjwatson@ubuntu.com>
Date: Fri, 28 Dec 2012 06:43:35 +0000
Subject: [PATCH 069/364] Backport gnulib fixes for C11. Fixes Savannah bug
#37738.
* grub-core/gnulib/stdio.in.h (gets): Warn on use only if
HAVE_RAW_DECL_GETS.
* m4/stdio_h.m4 (gl_STDIO_H): Check for gets.
---
ChangeLog | 8 ++++++++
grub-core/gnulib/stdio.in.h | 6 ++++--
m4/stdio_h.m4 | 2 +-
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/grub-core/gnulib/stdio.in.h b/grub-core/gnulib/stdio.in.h
index 80b9dbf..a8b00c6 100644
--- a/grub-core/gnulib/stdio.in.h
+++ b/grub-core/gnulib/stdio.in.h
@@ -138,10 +138,12 @@ _GL_WARN_ON_USE (fflush, "fflush is not always POSIX compliant - "
#endif
/* It is very rare that the developer ever has full control of stdin,
- so any use of gets warrants an unconditional warning. Assume it is
- always declared, since it is required by C89. */
+ so any use of gets warrants an unconditional warning; besides, C11
+ removed it. */
#undef gets
+#if HAVE_RAW_DECL_GETS
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+#endif
#if @GNULIB_FOPEN@
# if @REPLACE_FOPEN@
diff --git a/m4/stdio_h.m4 b/m4/stdio_h.m4
index f5650cd..8458bec 100644
--- a/m4/stdio_h.m4
+++ b/m4/stdio_h.m4
@@ -37,7 +37,7 @@ AC_DEFUN([gl_STDIO_H],
dnl corresponding gnulib module is not in use, and which is not
dnl guaranteed by C89.
gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
- ]], [dprintf fpurge fseeko ftello getdelim getline popen renameat
+ ]], [dprintf fpurge fseeko ftello getdelim getline gets popen renameat
snprintf tmpfile vdprintf vsnprintf])
])
--
1.8.1.4

View File

@ -2,14 +2,16 @@
# Maintainer : Ronald van Haren <ronald.archlinux.org> # Maintainer : Ronald van Haren <ronald.archlinux.org>
# Contributor: Keshav Padram (the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)> # Contributor: Keshav Padram (the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
## grub-extras lua and gpxe fail to build _GRUB_BZR_REV="5043"
## grub-extras lua and gpxe fail to build with grub bzr rev 5043
[[ "${CARCH}" == "x86_64" ]] && _EFI_ARCH="x86_64" [[ "${CARCH}" == "x86_64" ]] && _EFI_ARCH="x86_64"
[[ "${CARCH}" == "i686" ]] && _EFI_ARCH="i386" [[ "${CARCH}" == "i686" ]] && _EFI_ARCH="i386"
pkgname=grub pkgname=grub
pkgdesc="GNU GRand Unified Bootloader (2)" pkgdesc="GNU GRand Unified Bootloader (2)"
pkgver=2.00 pkgver=2.00.${_GRUB_BZR_REV}
pkgrel=1 pkgrel=1
url="https://www.gnu.org/software/grub/" url="https://www.gnu.org/software/grub/"
arch=('x86_64' 'i686') arch=('x86_64' 'i686')
@ -18,7 +20,7 @@ backup=('boot/grub/grub.cfg' 'etc/default/grub' 'etc/grub.d/40_custom')
install="${pkgname}.install" install="${pkgname}.install"
options=('!makeflags') options=('!makeflags')
conflicts=('grub-legacy' 'grub-common' 'grub-bios' "grub-efi-${_EFI_ARCH}") conflicts=('grub-common' 'grub-bios' "grub-efi-${_EFI_ARCH}" 'grub-legacy')
replaces=('grub-common' 'grub-bios' "grub-efi-${_EFI_ARCH}") replaces=('grub-common' 'grub-bios' "grub-efi-${_EFI_ARCH}")
provides=('grub-common' 'grub-bios' "grub-efi-${_EFI_ARCH}") provides=('grub-common' 'grub-bios' "grub-efi-${_EFI_ARCH}")
@ -27,51 +29,44 @@ makedepends=('xz' 'freetype2' 'bdf-unifont' 'ttf-dejavu' 'python' 'autogen'
depends=('sh' 'xz' 'gettext' 'device-mapper') depends=('sh' 'xz' 'gettext' 'device-mapper')
optdepends=('freetype2: For grub-mkfont usage' optdepends=('freetype2: For grub-mkfont usage'
'fuse: For grub-mount usage' 'fuse: For grub-mount usage'
'dosfstools: For EFI support' 'dosfstools: For grub-mkrescue FAT FS and EFI support'
'efibootmgr: For grub-install EFI support' 'efibootmgr: For grub-install EFI support'
'libisoburn: Provides xorriso for generating grub rescue iso using grub-mkrescue' 'libisoburn: Provides xorriso for generating grub rescue iso using grub-mkrescue'
'os-prober: To detect other OSes when generating grub.cfg in BIOS systems' 'os-prober: To detect other OSes when generating grub.cfg in BIOS systems'
'mtools: For grub-mkrescue FAT FS support') 'mtools: For grub-mkrescue FAT FS support')
source=("http://ftp.gnu.org/gnu/grub/grub-${pkgver}.tar.xz" # source=("http://ftp.gnu.org/gnu/grub/grub-${pkgver}.tar.xz"
'0069-Backport-gnulib-fixes-for-C11.-Fixes-Savannah-bug-37.patch' source=("grub-${pkgver}::bzr+bzr://bzr.savannah.gnu.org/grub/trunk/grub/#revision=${_GRUB_BZR_REV}"
'grub-2.00-fix-docs.patch'
'archlinux_grub_mkconfig_fixes.patch' 'archlinux_grub_mkconfig_fixes.patch'
'60_memtest86+' '60_memtest86+'
'grub.default' 'grub.default'
'grub.cfg') 'grub.cfg')
for _DIR_ in 915resolution ntldr-img ; do for _DIR_ in 915resolution ntldr-img ; do
source+=("grub-extras-${_DIR_}::bzr+bzr://bzr.savannah.gnu.org/grub-extras/${_DIR_}/") source+=("grub-extras-${_DIR_}::bzr+bzr://bzr.savannah.gnu.org/grub-extras/${_DIR_}/#revision=")
done done
source+=("grub-extras-lua::bzr+bzr://bzr.savannah.gnu.org/grub-extras/lua/#revision=24" # sha1sums=('274d91e96b56a5b9dd0a07accff69dbb6dfb596b'
"grub-extras-gpxe::bzr+bzr://bzr.savannah.gnu.org/grub-extras/gpxe/#revision=13") sha1sums=('SKIP'
'e7fd9161057411b1adc22977d4b3e7c06116239d'
sha1sums=('274d91e96b56a5b9dd0a07accff69dbb6dfb596b'
'b68565bc155094bade390c257c3f31bc55ae244b'
'1dc08391bb13f8e23faa21a76cc4cc4b25467702'
'26e4e946190bea1f03632658cf08ba90e11dec57'
'2aa2deeb7d7dc56f389aa1487b7a57b0d44ce559' '2aa2deeb7d7dc56f389aa1487b7a57b0d44ce559'
'dbf493dec4722feb11f0b5c71ad453a18daf0fc5' 'dbf493dec4722feb11f0b5c71ad453a18daf0fc5'
'5b7fcb0718a23035c039eb2fda9e088bb13ae611' '5b7fcb0718a23035c039eb2fda9e088bb13ae611'
'SKIP' 'SKIP'
'SKIP'
'SKIP'
'SKIP') 'SKIP')
_build_grub-common_and_bios() { _build_grub-common_and_bios() {
## Copy the source for building the common/bios package ## Copy the source for building the common/bios package
cp -r "${srcdir}/grub-${pkgver}" "${srcdir}/grub-bios-${pkgver}" cp -r "${srcdir}/grub-${pkgver}" "${srcdir}/grub-${pkgver}-bios"
cd "${srcdir}/grub-bios-${pkgver}/" cd "${srcdir}/grub-${pkgver}-bios/"
## Add the grub-extra sources ## Add the grub-extra sources
export GRUB_CONTRIB="${srcdir}/grub-bios-${pkgver}/grub-extras/" export GRUB_CONTRIB="${srcdir}/grub-${pkgver}-bios/grub-extras/"
install -d "${srcdir}/grub-bios-${pkgver}/grub-extras" install -d "${srcdir}/grub-${pkgver}-bios/grub-extras"
for _DIR_ in 915resolution ntldr-img lua gpxe ; do for _DIR_ in 915resolution ntldr-img ; do
cp -r "${srcdir}/grub-extras-${_DIR_}" "${srcdir}/grub-bios-${pkgver}/grub-extras/${_DIR_}" cp -r "${srcdir}/grub-extras-${_DIR_}" "${srcdir}/grub-${pkgver}-bios/grub-extras/${_DIR_}"
done done
## Unset all compiler FLAGS for bios build ## Unset all compiler FLAGS for bios build
@ -82,11 +77,11 @@ _build_grub-common_and_bios() {
unset MAKEFLAGS unset MAKEFLAGS
## Start the actual build process ## Start the actual build process
cd "${srcdir}/grub-bios-${pkgver}/" cd "${srcdir}/grub-${pkgver}-bios/"
./autogen.sh ./autogen.sh
echo echo
CFLAGS="-fno-stack-protector" ./configure \ ./configure \
--with-platform="pc" \ --with-platform="pc" \
--target="i386" \ --target="i386" \
"${_EFIEMU}" \ "${_EFIEMU}" \
@ -116,15 +111,15 @@ _build_grub-common_and_bios() {
_build_grub-efi() { _build_grub-efi() {
## Copy the source for building the efi package ## Copy the source for building the efi package
cp -r "${srcdir}/grub-${pkgver}" "${srcdir}/grub-efi-${pkgver}" cp -r "${srcdir}/grub-${pkgver}" "${srcdir}/grub-${pkgver}-efi"
cd "${srcdir}/grub-efi-${pkgver}/" cd "${srcdir}/grub-${pkgver}-efi/"
export GRUB_CONTRIB="${srcdir}/grub-efi-${pkgver}/grub-extras/" # export GRUB_CONTRIB="${srcdir}/grub-${pkgver}-efi/grub-extras/"
install -d "${srcdir}/grub-efi-${pkgver}/grub-extras/" # install -d "${srcdir}/grub-${pkgver}-efi/grub-extras/"
for _DIR_ in lua gpxe ; do # for _DIR_ in lua gpxe ; do
cp -r "${srcdir}/grub-extras-${_DIR_}" "${srcdir}/grub-bios-${pkgver}/grub-extras/${_DIR_}" # cp -r "${srcdir}/grub-extras-${_DIR_}" "${srcdir}/grub-${pkgver}-bios/grub-extras/${_DIR_}"
done # done
## Unset all compiler FLAGS for efi build ## Unset all compiler FLAGS for efi build
unset CFLAGS unset CFLAGS
@ -133,7 +128,7 @@ _build_grub-efi() {
unset LDFLAGS unset LDFLAGS
unset MAKEFLAGS unset MAKEFLAGS
cd "${srcdir}/grub-efi-${pkgver}/" cd "${srcdir}/grub-${pkgver}-efi/"
./autogen.sh ./autogen.sh
echo echo
@ -176,14 +171,6 @@ build() {
cd "${srcdir}/grub-${pkgver}/" cd "${srcdir}/grub-${pkgver}/"
## Fix compiling with gcc48
patch -Np1 -i "${srcdir}/0069-Backport-gnulib-fixes-for-C11.-Fixes-Savannah-bug-37.patch"
echo
## Fix docs compiling
patch -Np1 -i "${srcdir}/grub-2.00-fix-docs.patch"
echo
## Apply Archlinux specific fixes to enable grub-mkconfig detect Arch kernels and initramfs ## Apply Archlinux specific fixes to enable grub-mkconfig detect Arch kernels and initramfs
patch -Np1 -i "${srcdir}/archlinux_grub_mkconfig_fixes.patch" patch -Np1 -i "${srcdir}/archlinux_grub_mkconfig_fixes.patch"
echo echo
@ -207,7 +194,7 @@ build() {
_package_grub-common_and_bios() { _package_grub-common_and_bios() {
cd "${srcdir}/grub-bios-${pkgver}/" cd "${srcdir}/grub-${pkgver}-bios/"
make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
echo echo
@ -232,8 +219,8 @@ _package_grub-common_and_bios() {
_package_grub-efi() { _package_grub-efi() {
cd "${srcdir}/grub-efi-${pkgver}/" cd "${srcdir}/grub-${pkgver}-efi/"
make DESTDIR="${pkgdir}/" install make DESTDIR="${pkgdir}/" bashcompletiondir="/usr/share/bash-completion/completions" install
echo echo
## remove gdb debugging related files ## remove gdb debugging related files

View File

@ -1,8 +1,8 @@
diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in
index 516be86..5f37db2 100644 index 8decc1d..170047f 100644
--- a/util/grub-mkconfig.in --- a/util/grub-mkconfig.in
+++ b/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in
@@ -213,6 +213,8 @@ export GRUB_DEFAULT \ @@ -212,6 +212,8 @@ export GRUB_DEFAULT \
GRUB_THEME \ GRUB_THEME \
GRUB_GFXPAYLOAD_LINUX \ GRUB_GFXPAYLOAD_LINUX \
GRUB_DISABLE_OS_PROBER \ GRUB_DISABLE_OS_PROBER \
@ -12,10 +12,10 @@ index 516be86..5f37db2 100644
GRUB_SAVEDEFAULT \ GRUB_SAVEDEFAULT \
GRUB_ENABLE_CRYPTODISK \ GRUB_ENABLE_CRYPTODISK \
diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in
index 765bfdc..b148558 100644 index 2c4bb0a..c7120d2 100644
--- a/util/grub.d/00_header.in --- a/util/grub.d/00_header.in
+++ b/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in
@@ -115,6 +115,14 @@ cat <<EOF @@ -125,6 +125,14 @@ cat <<EOF
EOF EOF
@ -31,7 +31,7 @@ index 765bfdc..b148558 100644
gfxterm=0; gfxterm=0;
for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do for x in ${GRUB_TERMINAL_INPUT} ${GRUB_TERMINAL_OUTPUT}; do
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
index 14402e8..64c9bb5 100644 index 0724e16..a8119bd 100644
--- a/util/grub.d/10_linux.in --- a/util/grub.d/10_linux.in
+++ b/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in
@@ -87,6 +87,8 @@ linux_entry () @@ -87,6 +87,8 @@ linux_entry ()
@ -49,7 +49,7 @@ index 14402e8..64c9bb5 100644
fi fi
- if [ x$type != xrecovery ] ; then - if [ x$type != xrecovery ] ; then
+ if [ x$type != xrecovery ] && [ x$type != xfallback ] ; then + if [ x$type != xrecovery ] && [ x$type != xfallback ] ; then
save_default_entry | sed -e "s/^/\t/" save_default_entry | grub_add_tab
fi fi
@@ -132,7 +134,8 @@ linux_entry () @@ -132,7 +134,8 @@ linux_entry ()
@ -60,7 +60,7 @@ index 14402e8..64c9bb5 100644
+ +
+ message="$(gettext_printf "Loading Linux %s ..." "${version}")" + message="$(gettext_printf "Loading Linux %s ..." "${version}")"
sed "s/^/$submenu_indentation/" << EOF sed "s/^/$submenu_indentation/" << EOF
echo '$message' echo '$(echo "$message" | grub_quote)'
linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
@@ -190,7 +193,22 @@ while [ "x$list" != "x" ] ; do @@ -190,7 +193,22 @@ while [ "x$list" != "x" ] ; do
alt_version=`echo $version | sed -e "s,\.old$,,g"` alt_version=`echo $version | sed -e "s,\.old$,,g"`

View File

@ -1,21 +0,0 @@
From 40d6b00fa48ae9c1cecf143da5c6061f6ffcb719 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com
Date: Tue, 12 Mar 2013 15:23:02 -0400
Subject: [PATCH] Fix docs
I think the doc generation tools got stricter, so fix up the .texi file
to work.
diff --git a/docs/grub-dev.texi b/docs/grub-dev.texi
--- a/docs/grub-dev.texi
+++ b/docs/grub-dev.texi
@@ -1394,8 +1394,8 @@ grub_video_blit_glyph (&glyph, color, 0,
@node Bitmap API
@section Bitmap API
-@itemize
@subsection grub_video_bitmap_create
+@itemize
@item Prototype:
@example
grub_err_t grub_video_bitmap_create (struct grub_video_bitmap **bitmap, unsigned int width, unsigned int height, enum grub_video_blit_format blit_format)