From a32a645bb8371a564ccda5387223ba427dd408688c541edbbcf8a96cba388cf5 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Thu, 18 Feb 2010 14:10:48 +0000 Subject: [PATCH] Accepting request 32673 from devel:openSUSE:Factory Copy from devel:openSUSE:Factory/grub2 based on submit request 32673 from user a_jaeger OBS-URL: https://build.opensuse.org/request/show/32673 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/grub2?expand=0&rev=1 --- .gitattributes | 23 ++++++ .gitignore | 1 + 90_persistent | 36 +++++++++ README.openSUSE | 48 ++++++++++++ grub-1.95-grubdir.patch | 17 +++++ grub-1.97.2.tar.gz | 3 + grub.default | 2 + grub2-dlsym-v4.patch | 30 ++++++++ grub2-linux.patch | 13 ++++ grub2.changes | 28 +++++++ grub2.spec | 163 ++++++++++++++++++++++++++++++++++++++++ ready | 0 12 files changed, 364 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 90_persistent create mode 100644 README.openSUSE create mode 100644 grub-1.95-grubdir.patch create mode 100644 grub-1.97.2.tar.gz create mode 100644 grub.default create mode 100644 grub2-dlsym-v4.patch create mode 100644 grub2-linux.patch create mode 100644 grub2.changes create mode 100644 grub2.spec create mode 100644 ready diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/90_persistent b/90_persistent new file mode 100644 index 0000000..e15b1bc --- /dev/null +++ b/90_persistent @@ -0,0 +1,36 @@ +#! /bin/sh -e + +# update-grub helper script. +# Copyright (C) 2008 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +# The output of this script is copied from part of grub.cfg +# that correspond to itself. The achievement is that user can +# modify that part of grub.cfg directly, and it will be persistent +# across update-grub runs. + +transform="s&^&&;s,grub,grub2," +ME=$(echo $0 |sed 's,/,\\/,g') +GRUBCFG=/boot/`echo grub | sed ${transform}`/grub.cfg + +# Exit gracefully if there's no configuration file yet +[ -f ${GRUBCFG} ] || exit 0 + +awk " + BEGIN {echo = 0} + /### BEGIN $ME ###/ {echo = 1; next} + /### END $ME ###/ {echo = 0; next} + {if (echo) print} +" ${GRUBCFG} diff --git a/README.openSUSE b/README.openSUSE new file mode 100644 index 0000000..d0a86cc --- /dev/null +++ b/README.openSUSE @@ -0,0 +1,48 @@ +Using GNU GRUB 2 in openSUSE +============================ + +Though GRUB 2 provides various feature enhancements over previous GRUB +version (referred to as "GRUB", or "GRUB Legacy"), it did not reach its +stability and feature completness yet, and thus is not ready to replace +it for the whole user base. This package is primarily intended to +encourage testing and accelerate distribution integration. + +It is generally safe to install the package. It is able to co-exist with +existing GRUB installation and adds itself to the GRUB menu upon +installation, so you'll able to select GRUB 2 from GRUB menu during +the boot. + +Utilities +--------- + +The GRUB 2 utilities are prefixed (or postfixed) with 'grub2': + +grub2-editenv +grub2-mkimage +grub2-mkelfimage +grub2-mkrescue +grub2-emu +grub2-install +grub2-mkdevicemap +grub2-probe +grub2-setup +update-grub2 + +Documentation +------------- + +The GRUB 2 lacks documentation. While you are encouraged to contribute +the documentation, you can use the GRUB 2 Wiki [1] as primary source of +information pertaining to this development snapshot. + +[1] http://grub.enbug.org/ + +If you intend to install grub2 as your primary boot loader refer to +the GRUB 2 Wiki for information on how to set it up. + +Support channels +---------------- + +If you find a bug in this package, report them to the openSUSE Bugzilla [2]. + +[2] http://bugzilla.novell.com/ diff --git a/grub-1.95-grubdir.patch b/grub-1.95-grubdir.patch new file mode 100644 index 0000000..c0753fb --- /dev/null +++ b/grub-1.95-grubdir.patch @@ -0,0 +1,17 @@ +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 + +--- 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 @@ + /* 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" diff --git a/grub-1.97.2.tar.gz b/grub-1.97.2.tar.gz new file mode 100644 index 0000000..a5fdcb7 --- /dev/null +++ b/grub-1.97.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98c1d2623ce809ec25ba9136ea59c15a4580c71478d122be765e819cb06a1c49 +size 1249181 diff --git a/grub.default b/grub.default new file mode 100644 index 0000000..638d4e5 --- /dev/null +++ b/grub.default @@ -0,0 +1,2 @@ +GRUB_CMDLINE_LINUX="quiet" +GRUB_DISTRIBUTOR="openSUSE" diff --git a/grub2-dlsym-v4.patch b/grub2-dlsym-v4.patch new file mode 100644 index 0000000..100c210 --- /dev/null +++ b/grub2-dlsym-v4.patch @@ -0,0 +1,30 @@ +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 new file mode 100644 index 0000000..09eedc1 --- /dev/null +++ b/grub2-linux.patch @@ -0,0 +1,13 @@ +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/" + cat << EOF +- linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro $2 ++ linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} $2 + EOF + if test -n "${initrd}" ; then + cat << EOF diff --git a/grub2.changes b/grub2.changes new file mode 100644 index 0000000..a731191 --- /dev/null +++ b/grub2.changes @@ -0,0 +1,28 @@ +------------------------------------------------------------------- +Fri Feb 12 08:21:10 UTC 2010 - aj@suse.de + +- Update to grub 1.97.2: + * Fix a few 4 GiB limits. + * Fix license problems with a few BSD headers. + * Lots of misc bugfixes. + +------------------------------------------------------------------- +Wed Dec 9 12:37:18 UTC 2009 - aj@suse.de + +- Fix requires. + +------------------------------------------------------------------- +Wed Dec 9 11:45:57 UTC 2009 - aj@suse.de + +- Mark /etc/default/grub as config file. + +------------------------------------------------------------------- +Wed Dec 9 10:45:33 UTC 2009 - aj@suse.de + +- Mark root partition rw + +------------------------------------------------------------------- +Wed Dec 9 09:11:33 UTC 2009 - aj@suse.de + +- New package grub2. + diff --git a/grub2.spec b/grub2.spec new file mode 100644 index 0000000..9e165f8 --- /dev/null +++ b/grub2.spec @@ -0,0 +1,163 @@ +# +# spec file for package grub2 (Version 1.97.2) +# +# Copyright (c) 2010 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 +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# + + + +Name: grub2 +%ifarch x86_64 +BuildRequires: freetype2-devel-32bit gcc-32bit glibc-devel-32bit libncurses5-32bit libusb-1_0-devel-32bit ncurses-devel-32bit +%else +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 +Release: 1 +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.gz +Source1: 90_persistent +Source2: grub.default +Source3: README.openSUSE +Patch0: grub-1.95-grubdir.patch +Patch1: grub2-dlsym-v4.patch +Patch2: grub2-linux.patch +PreReq: perl-Bootloader +BuildRoot: %{_tmppath}/%{name}-%{version}-build +# TODO: ppc +ExclusiveArch: %{ix86} x86_64 + +%description +This is the second version of the GRUB (Grand Unified Bootloader), +a highly configurable and customizable bootloader with modular +architecture. It support rich scale of kernel formats, file systems, +computer architectures and hardware devices. + +PLEASE NOTE: This is a development snapshot, and as such will not +replace grub if you install it, but will be merely added as another +kernel to your existing GRUB menu. Do not replace GRUB (grub package) +with it unless you know what are you doing. Refer to README.openSUSE +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 +%patch2 -p0 -b .linux +# README.openSUSE +cp %{SOURCE3} . + +%build +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 \ + --program-transform-name=s,grub,%{name}, +%__make %{?jobs:-j%jobs} + +%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* +# Defaults +install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub +#%post +exec >/dev/null 2>&1 +# Create device.map or reuse one from GRUB Legacy +if [ -e /boot/grub/device.map ] ; then + cp -u /boot/grub/device.map /boot/%{name}/device.map 2>/dev/null || + %{name}-mkdevicemap + # Determine the partition with /boot + BOOT_PARTITION=$(df -h /boot |(read; awk '{print $1; exit}')) + # Generate core.img, but don't let it be installed in boot sector + %{name}-install --grub-setup=/bin/true $BOOT_PARTITION + # Remove stale menu.lst entries + /sbin/update-bootloader --remove --image /boot/%{name}/core.img --name="GNU GRUB 2" + # Add core.img as multiboot kernel to GRUB Legacy menu + /sbin/update-bootloader --add --image /boot/%{name}/core.img --name="GNU GRUB 2" + /sbin/update-bootloader --refresh +fi + +%preun +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 + ## XXX Ugly + rm -f /boot/%{name}/*.mod + rm -f /boot/%{name}/*.img + rm -f /boot/%{name}/*.lst + rm -f /boot/%{name}/device.map +fi +#%triggerin -- kernel, kernel-PAE +#exec >/dev/null 2>&1 +## Generate grub.cfg +#%{name}-mkconfig +# +# +#%triggerun -- kernel, kernel-PAE +#exec >/dev/null 2>&1 +## Generate grub.cfg +#%{name}-mkconfig + +%files +%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 +%{_bindir}/%{name}-mkimage +%{_bindir}/%{name}-mkelfimage +%{_bindir}/%{name}-editenv +%{_bindir}/%{name}-fstest +%{_bindir}/%{name}-mkfont +%{_bindir}/%{name}-mkrescue +%dir %{_sysconfdir}/grub.d +%config %{_sysconfdir}/grub.d/??_* +%{_sysconfdir}/grub.d/README +%{_sysconfdir}/%{name}.cfg +%config %{_sysconfdir}/default/grub +%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* + +%changelog diff --git a/ready b/ready new file mode 100644 index 0000000..473a0f4