diff --git a/gccwarn.patch b/gccwarn.patch new file mode 100644 index 0000000..c928a45 --- /dev/null +++ b/gccwarn.patch @@ -0,0 +1,17 @@ +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 + */ + +- ++#include "memory.h" + #include "camellia.h" + +-/* u32 must be 32bit word */ +-typedef unsigned int u32; + typedef unsigned char u8; + + /* key constants */ diff --git a/grub-1.95-grubdir.patch b/grub-1.95-grubdir.patch index c0753fb..2e72533 100644 --- a/grub-1.95-grubdir.patch +++ b/grub-1.95-grubdir.patch @@ -4,9 +4,11 @@ with grub2 and they both can share the same device.map. Lubomir Rintel ---- grub2.orig/include/grub/util/misc.h 2007-11-28 14:10:01.000000000 +0100 -+++ grub2/include/grub/util/misc.h 2007-11-28 14:10:20.000000000 +0100 -@@ -28,7 +28,7 @@ +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 diff --git a/grub-1.97.2.tar.gz b/grub-1.97.2.tar.gz deleted file mode 100644 index a5fdcb7..0000000 --- a/grub-1.97.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:98c1d2623ce809ec25ba9136ea59c15a4580c71478d122be765e819cb06a1c49 -size 1249181 diff --git a/grub-1.98.tar.gz b/grub-1.98.tar.gz new file mode 100644 index 0000000..b49d91d --- /dev/null +++ b/grub-1.98.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bef2c1892e052967b65aab6aa62ac702c0e50ef8848506eacf3c0b2f5007c614 +size 2449386 diff --git a/grub2-dlsym-v4.patch b/grub2-dlsym-v4.patch deleted file mode 100644 index 100c210..0000000 --- a/grub2-dlsym-v4.patch +++ /dev/null @@ -1,30 +0,0 @@ -2008-05-07: Lubomir Rintel - - * kern/dl.c (grub_dl_resolve_symbols): Let the - grub_gdb_trapvec symbol be resolved correctly (instead of 0). - ---- grub2/kern/dl.c 2008-01-26 21:34:58.000000000 +0100 -+++ grub2-gdb/kern/dl.c 2008-05-07 09:27:08.000000000 +0200 -@@ -352,16 +352,18 @@ grub_dl_resolve_symbols (grub_dl_t mod, - { - case STT_NOTYPE: - /* Resolve a global symbol. */ -- if (sym->st_name != 0 && sym->st_shndx == 0) -+ if (sym->st_name == 0) -+ break; -+ -+ if (sym->st_shndx == 0) /* external */ - { - sym->st_value = (Elf_Addr) grub_dl_resolve_symbol (name); - if (! sym->st_value) - return grub_error (GRUB_ERR_BAD_MODULE, - "the symbol `%s' not found", name); -- } -- else -- sym->st_value = 0; - break; -+ } -+ /* nonexternal, same as STT_OBJECT */ - - case STT_OBJECT: - sym->st_value += (Elf_Addr) grub_dl_get_section_addr (mod, diff --git a/grub2-linux.patch b/grub2-linux.patch index 09eedc1..bbec0b2 100644 --- a/grub2-linux.patch +++ b/grub2-linux.patch @@ -2,12 +2,12 @@ Index: util/grub.d/10_linux.in =================================================================== --- util/grub.d/10_linux.in.orig +++ util/grub.d/10_linux.in -@@ -49,7 +49,7 @@ menuentry "$1" { - EOF - prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" +@@ -84,7 +84,7 @@ EOF + printf '%s\n' "${prepare_boot_cache}" cat << EOF -- linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro $2 -+ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} $2 + echo $(printf "$(gettext "Loading Linux %s ...")" ${version}) +- 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 diff --git a/grub2.changes b/grub2.changes index a731191..3143182 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Sun Mar 14 12:11:53 UTC 2010 - aj@suse.de + +- Fix build on x86-64. + +------------------------------------------------------------------- +Fri Mar 12 20:39:25 UTC 2010 - aj@suse.de + +- Don't build parallel. +- Update to grub 1.98 including: + * Multiboot on EFI support. + * Saved default menu entry support, with new utilities `grub-reboot' and + `grub-set-default'. + * Encrypted password support, with a new utility `grub-mkpasswd-pbkdf2'. + * `grub-mkfloppy' removed; use `grub-mkrescue' to create floppy images. + ------------------------------------------------------------------- Fri Feb 12 08:21:10 UTC 2010 - aj@suse.de diff --git a/grub2.rpmlintrc b/grub2.rpmlintrc new file mode 100644 index 0000000..8e30d5b --- /dev/null +++ b/grub2.rpmlintrc @@ -0,0 +1,2 @@ +# We need to supply unstripped files for grub +addFilter("unstripped-binary-or-object .*") diff --git a/grub2.spec b/grub2.spec index 9e165f8..294bf1b 100644 --- a/grub2.spec +++ b/grub2.spec @@ -1,5 +1,5 @@ # -# spec file for package grub2 (Version 1.97.2) +# spec file for package grub2 (Version 1.98) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -24,14 +24,16 @@ BuildRequires: freetype2-devel-32bit gcc-32bit glibc-devel-32bit libncurses5-32 BuildRequires: freetype2-devel gcc glibc-devel libncurses5 libusb-1_0-devel ncurses-devel %endif BuildRequires: bison flex ruby + # Modules always contain just 32-bit code %define _libdir %{_exec_prefix}/lib + # 64-bit x86-64 machines use 32-bit boot loader # (We cannot just redefine _target_cpu, as we'd get i386.rpm packages then) %ifarch x86_64 %define _target_platform i386-%{_vendor}-%{_target_os}%{?_gnu} %endif -Version: 1.97.2 +Version: 1.98 Release: 1 Summary: Bootloader with support for Linux, Multiboot and more Group: System/Boot @@ -41,11 +43,14 @@ Source0: ftp://alpha.gnu.org/gnu/grub/grub-%{version}.tar.gz Source1: 90_persistent Source2: grub.default Source3: README.openSUSE +Source4: grub2.rpmlintrc Patch0: grub-1.95-grubdir.patch -Patch1: grub2-dlsym-v4.patch Patch2: grub2-linux.patch +Patch3: gccwarn.patch PreReq: perl-Bootloader + BuildRoot: %{_tmppath}/%{name}-%{version}-build + # TODO: ppc ExclusiveArch: %{ix86} x86_64 @@ -64,35 +69,45 @@ file that is part of this package's documentation for more information. %prep %setup -q -n grub-%{version} -%patch0 -p1 -b .grubdir -%patch1 -p1 -b .dlsym +%patch0 -p0 -b .grubdir %patch2 -p0 -b .linux +%patch3 -p0 -b .gccwarn + # README.openSUSE cp %{SOURCE3} . %build -sh autogen.sh +#sh autogen.sh # -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 \ --with-platform=pc \ - --enable-grub-emu \ + --enable-grub-emu-usb \ --program-transform-name=s,grub,%{name}, -%__make %{?jobs:-j%jobs} + +make %install make DESTDIR=$RPM_BUILD_ROOT install + # Script that makes part of grub.cfg persist across updates install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/ + # Ghost config file 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 + # Defaults install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub -#%post +%find_lang grub + +%post exec >/dev/null 2>&1 # Create device.map or reuse one from GRUB Legacy if [ -e /boot/grub/device.map ] ; then @@ -120,6 +135,7 @@ if [ -e /boot/%{name}/core.img ] ; then rm -f /boot/%{name}/*.lst rm -f /boot/%{name}/device.map fi + #%triggerin -- kernel, kernel-PAE #exec >/dev/null 2>&1 ## Generate grub.cfg @@ -131,22 +147,28 @@ fi ## Generate grub.cfg #%{name}-mkconfig -%files +%files -f grub.lang %defattr(-,root,root,-) %{_libdir}/%{name} %{_libdir}/grub/ %{_sbindir}/%{name}-mkdevicemap %{_sbindir}/%{name}-install -%{_sbindir}/%{name}-emu %{_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