SHA256
1
0
forked from pool/grub2

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
This commit is contained in:
OBS User autobuild 2010-02-18 14:10:48 +00:00 committed by Git OBS Bridge
commit a32a645bb8
12 changed files with 364 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -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

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

36
90_persistent Normal file
View File

@ -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 <http://www.gnu.org/licenses/>.
# 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}

48
README.openSUSE Normal file
View File

@ -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/

17
grub-1.95-grubdir.patch Normal file
View File

@ -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 <lkundrak@v3.sk>
--- 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"

3
grub-1.97.2.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:98c1d2623ce809ec25ba9136ea59c15a4580c71478d122be765e819cb06a1c49
size 1249181

2
grub.default Normal file
View File

@ -0,0 +1,2 @@
GRUB_CMDLINE_LINUX="quiet"
GRUB_DISTRIBUTOR="openSUSE"

30
grub2-dlsym-v4.patch Normal file
View File

@ -0,0 +1,30 @@
2008-05-07: Lubomir Rintel <lkundrak@fedoraproject.org>
* 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,

13
grub2-linux.patch Normal file
View File

@ -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

28
grub2.changes Normal file
View File

@ -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.

163
grub2.spec Normal file
View File

@ -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

0
ready Normal file
View File