Accepting request 69887 from devel:openSUSE:Factory

update to 1.99-rc2 and support gcc46 builds. Cleanup specfile. (forwarded request 69842 from jirislaby)

OBS-URL: https://build.opensuse.org/request/show/69887
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=13
This commit is contained in:
Sascha Peilicke 2011-05-09 08:48:37 +00:00 committed by Git OBS Bridge
parent 43f08b28cb
commit 36330b3c25
11 changed files with 118 additions and 167 deletions

16
gcc46-fixes.patch Normal file
View File

@ -0,0 +1,16 @@
---
include/grub/test.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/include/grub/test.h
+++ b/include/grub/test.h
@@ -49,8 +49,7 @@ int grub_test_run (grub_test_t test);
/* Test `cond' for nonzero; log failure otherwise. */
void grub_test_nonzero (int cond, const char *file,
const char *func, grub_uint32_t line,
- const char *fmt, ...)
- __attribute__ ((format (printf, 5, 6)));
+ const char *fmt, ...);
/* Macro to fill in location details and an optional error message. */
#define grub_test_assert(cond, ...) \

View File

@ -1,12 +1,27 @@
Index: lib/libgcrypt-grub/cipher/camellia.c
===================================================================
--- lib/libgcrypt-grub/cipher/camellia.c.orig
+++ lib/libgcrypt-grub/cipher/camellia.c
@@ -25,11 +25,9 @@
* http://info.isl.ntt.co.jp/crypt/eng/camellia/specifications.html
*/
---
grub-core/lib/libgcrypt-grub/cipher/camellia.c | 3 +--
grub-core/lib/libgcrypt/cipher/camellia.c | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
--- a/grub-core/lib/libgcrypt-grub/cipher/camellia.c
+++ b/grub-core/lib/libgcrypt-grub/cipher/camellia.c
@@ -29,9 +29,8 @@ GRUB_MOD_LICENSE ("GPLv3+");
#include "camellia.h"
+#include "memory.h"
-/* u32 must be 32bit word */
-typedef unsigned int u32;
typedef unsigned char u8;
/* key constants */
--- a/grub-core/lib/libgcrypt/cipher/camellia.c
+++ b/grub-core/lib/libgcrypt/cipher/camellia.c
@@ -26,10 +26,9 @@
#include <string.h>
#include <stdlib.h>
-
+#include "memory.h"
#include "camellia.h"

View File

@ -1,19 +0,0 @@
This should ideally be done using transformations.
Alternatively, /boot/grub may be used, no grub's files there should conflict
with grub2 and they both can share the same device.map.
Lubomir Rintel <lkundrak@v3.sk>
Index: include/grub/util/misc.h
===================================================================
--- include/grub/util/misc.h.orig
+++ include/grub/util/misc.h
@@ -32,7 +32,7 @@
/* NetBSD uses /boot for its boot block. */
# define DEFAULT_DIRECTORY "/grub"
#else
-# define DEFAULT_DIRECTORY "/boot/grub"
+# define DEFAULT_DIRECTORY "/boot/grub2"
#endif
#define DEFAULT_DEVICE_MAP DEFAULT_DIRECTORY "/device.map"

View File

@ -1,60 +0,0 @@
--- a/util/getroot.c 2010-03-06 20:51:37.000000000 +0000
+++ b/util/getroot.c 2010-05-28 18:23:19.892788564 +0100
@@ -180,7 +180,8 @@ grub_get_prefix (const char *dir)
static char *
find_root_device (const char *dir __attribute__ ((unused)),
- dev_t dev __attribute__ ((unused)))
+ dev_t dev __attribute__ ((unused))
+ int depth __attribute__ ((unused)))
{
return 0;
}
@@ -188,7 +189,7 @@ find_root_device (const char *dir __attr
#elif ! defined(__CYGWIN__)
static char *
-find_root_device (const char *dir, dev_t dev)
+find_root_device (const char *dir, dev_t dev, int depth)
{
DIR *dp;
char *saved_cwd;
@@ -222,16 +223,27 @@ find_root_device (const char *dir, dev_t
/* Ignore any error. */
continue;
- if (S_ISLNK (st.st_mode))
+ if (S_ISLNK (st.st_mode)) {
+#ifdef __linux__
+ /* If we're in /dev/mapper, follow symbolic links. */
+ if (depth == 1 && strcmp(dir, "mapper") == 0) {
+ if (stat(ent->d_name, &st) == -1)
+ continue;
+ if (S_ISDIR (st.st_mode))
+ continue;
+ }
+#else
/* Don't follow symbolic links. */
continue;
+#endif
+ }
if (S_ISDIR (st.st_mode))
{
/* Find it recursively. */
char *res;
- res = find_root_device (ent->d_name, dev);
+ res = find_root_device (ent->d_name, dev, depth + 1);
if (res)
{
@@ -454,7 +466,7 @@ grub_guess_root_device (const char *dir)
#else
/* This might be truly slow, but is there any better way? */
- os_dev = find_root_device ("/dev", st.st_dev);
+ os_dev = find_root_device ("/dev", st.st_dev, 0);
#endif
#endif /* !__GNU__ */

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8e96e824b4c53ee8c0efca360789f0531b625369e648760eab4829726ec3a82b
size 1858208

3
grub-1.99~rc2.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:533a3a6b4cc227632365f09fda91069cfd49f779f00ddf2448a0f9bad07a6e31
size 2507644

View File

@ -8,39 +8,15 @@ Index: util/grub.d/10_linux.in
else
- OS="${GRUB_DISTRIBUTOR} GNU/Linux"
+ OS="${GRUB_DISTRIBUTOR}"
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr '[A-Z]' '[a-z]') ${CLASS}"
CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
fi
@@ -84,7 +84,7 @@ EOF
printf '%s\n' "${prepare_boot_cache}"
message="$(gettext_printf "Loading Linux %s ..." ${version})"
cat << EOF
echo $(printf "$(gettext "Loading Linux %s ...")" ${version})
echo '$message'
- linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
+ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ${args}
EOF
if test -n "${initrd}" ; then
cat << EOF
@@ -97,9 +97,21 @@ EOF
EOF
}
+# do not output vmlinux if vmlinuz of same version exists
list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do
- if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
- done`
+ if grub_file_is_not_garbage "$i" ; then
+ case $i in
+ */vmlinux*)
+ j=${i/vmlinux/vmlinuz}
+ k=${j/.gz/}
+ if test ! -e $k ; then echo -n "$i "; fi
+ ;;
+ *)
+ echo -n "$i "
+ ;;
+ esac
+ fi
+ done`
prepare_boot_cache=
while [ "x$list" != "x" ] ; do
message="$(gettext_printf "Loading initial ramdisk ...")"

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Sat May 7 12:33:43 CEST 2011 - jslaby@suse.de
- fix build with gcc 4.6
- build in parallel (fixed finally in 1.99)
- add translations from translations project
- update to 1.99-rc2
* See NEWS file for changes
-------------------------------------------------------------------
Wed Oct 27 16:57:13 CEST 2010 - jslaby@suse.de

View File

@ -1,2 +1,7 @@
addFilter("zero-length /boot/grub2/grub.cfg")
addFilter("non-etc-or-var-file-marked-as-conffile /boot/grub2/grub.cfg")
addFilter("non-conffile-in-etc /etc/bash_completion.d/grub")
addFilter("non-conffile-in-etc /etc/grub.d/README")
addFilter("statically-linked-binary .*/grub2/i386-pc/kernel.img")
# We need to supply unstripped files for grub
addFilter("unstripped-binary-or-object .*")
addFilter("unstripped-binary-or-object .*/grub2/i386-pc/.*.mod")

View File

@ -1,7 +1,7 @@
#
# spec file for package grub2 (Version 1.98)
# spec file for package grub2
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -19,11 +19,13 @@
Name: grub2
%ifarch x86_64
BuildRequires: freetype2-devel-32bit gcc-32bit glibc-devel-32bit libncurses5-32bit libusb-1_0-devel-32bit ncurses-devel-32bit
BuildRequires: freetype2-devel-32bit gcc-32bit glibc-32bit glibc-devel-32bit
BuildRequires: libncurses5-32bit libusb-1_0-devel-32bit ncurses-devel-32bit
%else
BuildRequires: freetype2-devel gcc glibc-devel libncurses5 libusb-1_0-devel ncurses-devel
BuildRequires: freetype2-devel gcc glibc-devel libncurses5 libusb-1_0-devel
BuildRequires: ncurses-devel
%endif
BuildRequires: bison flex ruby
BuildRequires: bison device-mapper-devel flex lzma ruby xz
# Modules always contain just 32-bit code
%define _libdir %{_exec_prefix}/lib
@ -33,23 +35,27 @@ BuildRequires: bison flex ruby
%ifarch x86_64
%define _target_platform i386-%{_vendor}-%{_target_os}%{?_gnu}
%endif
Version: 1.98
Version: 1.98.99.rc2
%define tar_version 1.99~rc2
Release: 9
Summary: Bootloader with support for Linux, Multiboot and more
Group: System/Boot
License: GPLv3+
Url: http://www.gnu.org/software/grub/
Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{version}.tar.bz2
Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{tar_version}.tar.xz
Source1: 90_persistent
Source2: grub.default
Source3: README.openSUSE
Source4: grub2.rpmlintrc
Patch0: grub-1.95-grubdir.patch
# rsync -Lrtvz translationproject.org::tp/latest/grub/ po
Source5: translations-20110507.tar.bz2
Patch0: gcc46-fixes.patch
Patch2: grub2-linux.patch
Patch3: gccwarn.patch
Patch4: grub-1.98-follow-dev-mapper-symlinks.patch
PreReq: perl-Bootloader
Requires: gettext-runtime
Requires(post): /sbin/install-info
Requires(preun):/sbin/install-info
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -70,17 +76,26 @@ file that is part of this package's documentation for more information.
%prep
%setup -q -n grub-%{version}
%patch0 -p0 -b .grubdir
%patch2 -p0 -b .linux
%patch3 -p0 -b .gccwarn
%patch4 -p1 -b .dev-mapper
%setup -q -n grub-%{tar_version} -a 5
(cd po && ls *.po | cut -d. -f1 | xargs) >po/LINGUAS
sed 's,@setfilename grub.info,@setfilename grub2.info,' docs/grub.texi >docs/grub2.texi
sed -i 's,grub.texi,grub2.texi,' docs/Makefile.am
%patch0 -p1
%patch2 -p0
%patch3 -p1
# README.openSUSE
cp %{SOURCE3} .
%build
#sh autogen.sh
#./autogen.sh
# we don't want to let rpm to override *FLAGS by bogus ones
CFLAGS=" "
CXXFLAGS=" "
FFLAGS=" "
export CFLAGS CXXFLAGS FFLAGS
# -static is needed so that autoconf script is able to link
# test that looks for _start symbol on 64 bit platforms
%configure TARGET_LDFLAGS=-static \
@ -88,7 +103,7 @@ cp %{SOURCE3} .
--enable-grub-emu-usb \
--program-transform-name=s,grub,%{name},
make
make %{?_smp_mflags}
%install
make DESTDIR=$RPM_BUILD_ROOT install
@ -101,8 +116,6 @@ install -d $RPM_BUILD_ROOT/boot/%{name}
touch $RPM_BUILD_ROOT/boot/%{name}/grub.cfg
ln -s ../boot/%{name}/grub.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.cfg
# XXX: Remove for now, should be renamed to grub2.info
rm $RPM_BUILD_ROOT/%{_infodir}/grub.info*
# Remove devel files
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/*/*.h
@ -111,6 +124,9 @@ install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub
%find_lang grub
%post
/sbin/install-info %{_infodir}/grub-dev.info %{_infodir}/dir || :
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
mkdir -p /boot/%{name}/ 2>/dev/null || true
# Create device.map or reuse one from GRUB Legacy
if [ ! -e /boot/%{name}/device.map ] ; then
@ -131,10 +147,15 @@ if [ -e /boot/%{name}/device.map ]; then
fi
%preun
if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/grub-dev.info %{_infodir}/dir || :
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
fi
exec >/dev/null
if [ -e /boot/%{name}/core.img ] ; then
/sbin/update-bootloader --remove --image /boot/%{name}/core.img --name="GNU GRUB 2"
/sbin/update-bootloader --refresh
/sbin/update-bootloader --remove --image /boot/%{name}/core.img --name="GNU GRUB 2" || :
/sbin/update-bootloader --refresh || :
## XXX Ugly
rm -f /boot/%{name}/*.mod
rm -f /boot/%{name}/*.img
@ -142,50 +163,35 @@ if [ -e /boot/%{name}/core.img ] ; then
rm -f /boot/%{name}/device.map
fi
#%triggerin -- kernel, kernel-PAE
#%%triggerin -- kernel, kernel-PAE
#exec >/dev/null 2>&1
## Generate grub.cfg
#%{name}-mkconfig
#%%{name}-mkconfig
#
#
#%triggerun -- kernel, kernel-PAE
#%%triggerun -- kernel, kernel-PAE
#exec >/dev/null 2>&1
## Generate grub.cfg
#%{name}-mkconfig
#%%{name}-mkconfig
%files -f grub.lang
%defattr(-,root,root,-)
%{_libdir}/%{name}
%{_libdir}/grub/
%{_sbindir}/%{name}-mkdevicemap
%{_sbindir}/%{name}-install
%{_sbindir}/%{name}-probe
%{_sbindir}/%{name}-setup
%{_sbindir}/%{name}-mkconfig
%{_sbindir}/%{name}-reboot
%{_sbindir}/%{name}-set-default
%{_bindir}/%{name}-bin2h
%{_bindir}/%{name}-mkisofs
%{_bindir}/%{name}-mkrelpath
%{_bindir}/%{name}-script-check
%{_bindir}/%{name}-mkimage
%{_bindir}/%{name}-mkelfimage
%{_bindir}/%{name}-editenv
%{_bindir}/%{name}-fstest
%{_bindir}/%{name}-mkfont
%{_bindir}/%{name}-mkrescue
%{_bindir}/%{name}-mkpasswd-pbkdf2
%dir %{_sysconfdir}/grub.d
%config %{_sysconfdir}/grub.d/??_*
%{_sysconfdir}/grub.d/README
%{_sysconfdir}/%{name}.cfg
%{_sbindir}/%{name}-*
%{_bindir}/%{name}-*
%{_sysconfdir}/bash_completion.d/grub
%config %{_sysconfdir}/default/grub
%dir %{_sysconfdir}/grub.d
%{_sysconfdir}/grub.d/README
%config %{_sysconfdir}/grub.d/??_*
%{_sysconfdir}/%{name}.cfg
%dir /boot/%{name}
# Actually, this is replaced by update-grub from scriptlets,
# but it takes care of modified persistent part
%config(noreplace) /boot/%{name}/grub.cfg
%doc COPYING INSTALL NEWS README THANKS TODO ChangeLog README.openSUSE
#%exclude %{_mandir}
#%{_infodir}/%{name}.info*
%{_infodir}/grub-dev.info*
%{_infodir}/%{name}.info*
%changelog

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4b78742eedf41d22c410b77d31ac9744202c81472dd211f5c4a9f801e660cab8
size 157473