2010-02-18 15:10:48 +01:00
|
|
|
#
|
2011-05-09 10:48:37 +02:00
|
|
|
# spec file for package grub2
|
2010-02-18 15:10:48 +01:00
|
|
|
#
|
2011-05-09 10:48:37 +02:00
|
|
|
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2010-02-18 15:10:48 +01:00
|
|
|
#
|
|
|
|
# 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
|
2011-08-02 16:45:10 +02:00
|
|
|
%ifarch x86_64 ppc64
|
2011-05-09 10:48:37 +02:00
|
|
|
BuildRequires: freetype2-devel-32bit gcc-32bit glibc-32bit glibc-devel-32bit
|
|
|
|
BuildRequires: libncurses5-32bit libusb-1_0-devel-32bit ncurses-devel-32bit
|
2010-02-18 15:10:48 +01:00
|
|
|
%else
|
2011-05-09 10:48:37 +02:00
|
|
|
BuildRequires: freetype2-devel gcc glibc-devel libncurses5 libusb-1_0-devel
|
|
|
|
BuildRequires: ncurses-devel
|
2010-02-18 15:10:48 +01:00
|
|
|
%endif
|
2011-05-09 10:48:37 +02:00
|
|
|
BuildRequires: bison device-mapper-devel flex lzma ruby xz
|
2010-03-15 00:45:00 +01:00
|
|
|
|
2010-02-18 15:10:48 +01:00
|
|
|
# Modules always contain just 32-bit code
|
|
|
|
%define _libdir %{_exec_prefix}/lib
|
2010-03-15 00:45:00 +01:00
|
|
|
|
2010-02-18 15:10:48 +01:00
|
|
|
# 64-bit x86-64 machines use 32-bit boot loader
|
|
|
|
# (We cannot just redefine _target_cpu, as we'd get i386.rpm packages then)
|
2011-08-02 16:45:10 +02:00
|
|
|
%ifarch x86_64
|
2010-02-18 15:10:48 +01:00
|
|
|
%define _target_platform i386-%{_vendor}-%{_target_os}%{?_gnu}
|
|
|
|
%endif
|
2011-08-02 16:45:10 +02:00
|
|
|
%ifarch ppc ppc64
|
|
|
|
%define platform ieee1275
|
|
|
|
%else
|
|
|
|
%define platform pc
|
|
|
|
%endif
|
2011-08-26 10:01:42 +02:00
|
|
|
# build efi bootloader on some platforms only:
|
|
|
|
%if ! 0%{?efi}
|
|
|
|
%global efi %{ix86} x86_64 ia64
|
|
|
|
%endif
|
|
|
|
|
2011-06-01 12:39:13 +02:00
|
|
|
Version: 1.99
|
2011-08-26 10:01:51 +02:00
|
|
|
Release: 6
|
2010-02-18 15:10:48 +01:00
|
|
|
Summary: Bootloader with support for Linux, Multiboot and more
|
|
|
|
Group: System/Boot
|
|
|
|
License: GPLv3+
|
|
|
|
Url: http://www.gnu.org/software/grub/
|
2011-06-01 12:39:13 +02:00
|
|
|
Source0: ftp://ftp.gnu.org/gnu/grub/grub-%{version}.tar.xz
|
2010-02-18 15:10:48 +01:00
|
|
|
Source1: 90_persistent
|
|
|
|
Source2: grub.default
|
|
|
|
Source3: README.openSUSE
|
2010-03-15 00:45:00 +01:00
|
|
|
Source4: grub2.rpmlintrc
|
2011-05-09 10:48:37 +02:00
|
|
|
# rsync -Lrtvz translationproject.org::tp/latest/grub/ po
|
2011-10-25 16:00:45 +02:00
|
|
|
Source5: translations-20111024.tar.bz2
|
2011-05-09 10:48:37 +02:00
|
|
|
Patch0: gcc46-fixes.patch
|
2010-02-18 15:10:48 +01:00
|
|
|
Patch2: grub2-linux.patch
|
2010-03-15 00:45:00 +01:00
|
|
|
Patch3: gccwarn.patch
|
2011-07-13 15:58:47 +02:00
|
|
|
Patch4: grub2-linux-submenu.patch
|
2011-08-02 16:45:10 +02:00
|
|
|
Patch5: grub2-unused.patch
|
2010-02-18 15:10:48 +01:00
|
|
|
PreReq: perl-Bootloader
|
2010-09-13 18:50:45 +02:00
|
|
|
Requires: gettext-runtime
|
2011-05-09 10:48:37 +02:00
|
|
|
Requires(post): /sbin/install-info
|
|
|
|
Requires(preun):/sbin/install-info
|
2010-03-15 00:45:00 +01:00
|
|
|
|
2010-02-18 15:10:48 +01:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2010-03-15 00:45:00 +01:00
|
|
|
|
2011-08-02 16:45:10 +02:00
|
|
|
ExclusiveArch: %{ix86} x86_64 ppc ppc64
|
|
|
|
|
2010-02-18 15:10:48 +01:00
|
|
|
%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.
|
|
|
|
|
2011-08-26 10:01:42 +02:00
|
|
|
%ifarch %{efi}
|
|
|
|
|
|
|
|
%package efi
|
2011-08-26 10:01:51 +02:00
|
|
|
|
2011-08-26 10:01:42 +02:00
|
|
|
Summary: GRUB2 for EFI systems
|
|
|
|
Group: System/Boot
|
2011-10-27 13:49:04 +02:00
|
|
|
%ifarch ia64 x86_64
|
|
|
|
#Package is available on ia64 and x86_64 only and not necessarily needed
|
2011-10-25 16:00:45 +02:00
|
|
|
Requires: efibootmgr
|
2011-10-27 13:49:04 +02:00
|
|
|
%endif
|
2011-10-25 16:00:45 +02:00
|
|
|
Requires: grub2
|
2011-08-26 10:01:42 +02:00
|
|
|
|
|
|
|
%description efi
|
|
|
|
The GRand Unified Bootloader (GRUB) is a highly configurable and customizable
|
|
|
|
bootloader with modular architecture. It support rich variety of kernel formats,
|
|
|
|
file systems, computer architectures and hardware devices. This subpackage
|
|
|
|
provides support for EFI systems.
|
|
|
|
%endif
|
|
|
|
|
2010-02-18 15:10:48 +01:00
|
|
|
%prep
|
2011-08-26 10:01:42 +02:00
|
|
|
# We create (if we build for efi) two copies of the sources
|
|
|
|
# in the Builddir
|
|
|
|
%setup -T -c -n grub-%{version}
|
|
|
|
%setup -D -T -q -n grub-%{version} -a 0
|
|
|
|
(cd grub-%{version};tar xaf %{SOURCE5})
|
|
|
|
(cd grub-%{version}/po && ls *.po | cut -d. -f1 | xargs) >grub-%{version}/po/LINGUAS
|
|
|
|
sed 's,@setfilename grub.info,@setfilename grub2.info,' grub-%{version}/docs/grub.texi >grub-%{version}/docs/grub2.texi
|
|
|
|
sed -i 's,grub.texi,grub2.texi,' grub-%{version}/docs/Makefile.am
|
|
|
|
cd grub-%{version}
|
2011-05-09 10:48:37 +02:00
|
|
|
%patch0 -p1
|
|
|
|
%patch2 -p0
|
|
|
|
%patch3 -p1
|
2011-07-13 15:58:47 +02:00
|
|
|
%patch4 -p1
|
2011-08-02 16:45:10 +02:00
|
|
|
%patch5 -p1
|
2011-08-26 10:01:42 +02:00
|
|
|
cd ..
|
2010-03-15 00:45:00 +01:00
|
|
|
|
2010-02-18 15:10:48 +01:00
|
|
|
# README.openSUSE
|
2011-08-26 10:01:42 +02:00
|
|
|
cp %{SOURCE3} grub-%{version}/
|
|
|
|
%ifarch %{efi}
|
|
|
|
cp -a grub-%{version} grub-efi-%{version}
|
|
|
|
%endif
|
2010-02-18 15:10:48 +01:00
|
|
|
|
|
|
|
%build
|
2011-08-26 10:01:42 +02:00
|
|
|
%ifarch %{efi}
|
|
|
|
cd grub-efi-%{version}
|
|
|
|
# we don't want to let rpm to override *FLAGS by bogus ones
|
|
|
|
CFLAGS=" "
|
|
|
|
CXXFLAGS=" "
|
|
|
|
FFLAGS=" "
|
|
|
|
export CFLAGS CXXFLAGS FFLAGS
|
|
|
|
%configure \
|
|
|
|
TARGET_LDFLAGS=-static \
|
|
|
|
--with-platform=efi \
|
|
|
|
--program-transform-name=s,grub,%{name}-efi,
|
|
|
|
make %{?_smp_mflags}
|
|
|
|
%ifarch %{ix86}
|
|
|
|
%define grubefiarch i386-efi
|
|
|
|
%else
|
|
|
|
%define grubefiarch %{_arch}-efi
|
|
|
|
%endif
|
|
|
|
./grub-mkimage -O %{grubefiarch} -o grub.efi -d grub-core part_gpt hfsplus fat \
|
|
|
|
ext2 btrfs normal chain boot configfile linux appleldr minicmd \
|
|
|
|
loadbios reboot halt search font gfxterm
|
|
|
|
cd ..
|
|
|
|
%endif
|
|
|
|
cd grub-%{version}
|
2011-05-09 10:48:37 +02:00
|
|
|
#./autogen.sh
|
|
|
|
|
|
|
|
# we don't want to let rpm to override *FLAGS by bogus ones
|
|
|
|
CFLAGS=" "
|
|
|
|
CXXFLAGS=" "
|
|
|
|
FFLAGS=" "
|
|
|
|
export CFLAGS CXXFLAGS FFLAGS
|
|
|
|
|
2010-02-18 15:10:48 +01:00
|
|
|
# -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 \
|
2011-08-02 16:45:10 +02:00
|
|
|
--with-platform=%{platform} \
|
2010-03-15 00:45:00 +01:00
|
|
|
--enable-grub-emu-usb \
|
2010-02-18 15:10:48 +01:00
|
|
|
--program-transform-name=s,grub,%{name},
|
2010-03-15 00:45:00 +01:00
|
|
|
|
2011-05-09 10:48:37 +02:00
|
|
|
make %{?_smp_mflags}
|
2010-02-18 15:10:48 +01:00
|
|
|
|
|
|
|
%install
|
2011-08-26 10:01:42 +02:00
|
|
|
%ifarch %{efi}
|
|
|
|
cd grub-efi-%{version}
|
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
|
|
|
|
|
|
|
# Ghost config file
|
|
|
|
install -d $RPM_BUILD_ROOT/boot/%{name}-efi
|
|
|
|
touch $RPM_BUILD_ROOT/boot/%{name}-efi/grub.cfg
|
|
|
|
ln -s ../boot/%{name}-efi/grub.cfg $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-efi.cfg
|
|
|
|
|
|
|
|
install -m 755 -d $RPM_BUILD_ROOT/boot/efi/EFI/opensuse/
|
|
|
|
install -m 755 grub.efi $RPM_BUILD_ROOT/boot/efi/EFI/opensuse/grub.efi
|
|
|
|
# Remove devel files
|
|
|
|
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}-efi/*/*.h
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
%endif
|
|
|
|
|
|
|
|
cd grub-%{version}
|
2010-02-18 15:10:48 +01:00
|
|
|
make DESTDIR=$RPM_BUILD_ROOT install
|
2010-03-15 00:45:00 +01:00
|
|
|
|
2010-02-18 15:10:48 +01:00
|
|
|
# Script that makes part of grub.cfg persist across updates
|
|
|
|
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/grub.d/
|
2010-03-15 00:45:00 +01:00
|
|
|
|
2010-02-18 15:10:48 +01:00
|
|
|
# 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
|
2010-03-15 00:45:00 +01:00
|
|
|
|
|
|
|
# Remove devel files
|
|
|
|
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/*/*.h
|
|
|
|
|
2010-02-18 15:10:48 +01:00
|
|
|
# Defaults
|
|
|
|
install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub
|
2010-03-15 00:45:00 +01:00
|
|
|
%find_lang grub
|
|
|
|
|
|
|
|
%post
|
2011-05-09 10:48:37 +02:00
|
|
|
/sbin/install-info %{_infodir}/grub-dev.info %{_infodir}/dir || :
|
|
|
|
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
|
|
|
|
|
2010-10-28 15:16:28 +02:00
|
|
|
mkdir -p /boot/%{name}/ 2>/dev/null || true
|
2010-02-18 15:10:48 +01:00
|
|
|
# Create device.map or reuse one from GRUB Legacy
|
2010-10-28 15:16:28 +02:00
|
|
|
if [ ! -e /boot/%{name}/device.map ] ; then
|
2010-02-18 15:10:48 +01:00
|
|
|
cp -u /boot/grub/device.map /boot/%{name}/device.map 2>/dev/null ||
|
|
|
|
%{name}-mkdevicemap
|
2010-10-28 15:16:28 +02:00
|
|
|
fi
|
|
|
|
if [ -e /boot/%{name}/device.map ]; then
|
2010-02-18 15:10:48 +01:00
|
|
|
# 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
|
2010-10-28 15:16:28 +02:00
|
|
|
%{name}-install --grub-setup=/bin/true $BOOT_PARTITION || true
|
|
|
|
exec >/dev/null 2>&1
|
2010-02-18 15:10:48 +01:00
|
|
|
# Remove stale menu.lst entries
|
2010-10-28 15:16:28 +02:00
|
|
|
/sbin/update-bootloader --remove --image /boot/%{name}/core.img --name="GNU GRUB 2" || true
|
2010-02-18 15:10:48 +01:00
|
|
|
# Add core.img as multiboot kernel to GRUB Legacy menu
|
2010-10-28 15:16:28 +02:00
|
|
|
/sbin/update-bootloader --add --image /boot/%{name}/core.img --name="GNU GRUB 2" || true
|
|
|
|
/sbin/update-bootloader --refresh || true
|
2010-02-18 15:10:48 +01:00
|
|
|
fi
|
|
|
|
|
2011-08-26 10:01:42 +02:00
|
|
|
%post efi
|
|
|
|
/sbin/install-info %{_infodir}/grub-dev.info %{_infodir}/dir || :
|
|
|
|
/sbin/install-info %{_infodir}/%{name}.info %{_infodir}/dir || :
|
|
|
|
|
2010-02-18 15:10:48 +01:00
|
|
|
%preun
|
2011-05-09 10:48:37 +02:00
|
|
|
if [ $1 = 0 ]; then
|
|
|
|
/sbin/install-info --delete %{_infodir}/grub-dev.info %{_infodir}/dir || :
|
|
|
|
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
|
2011-07-13 15:58:47 +02:00
|
|
|
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 || :
|
|
|
|
fi
|
|
|
|
# Cleanup installed files
|
|
|
|
rm -f /boot/%{name}/*.mod
|
|
|
|
rm -f /boot/%{name}/*.img
|
|
|
|
rm -f /boot/%{name}/*.lst
|
|
|
|
rm -f /boot/%{name}/device.map
|
2011-05-09 10:48:37 +02:00
|
|
|
fi
|
|
|
|
|
2011-08-26 10:01:42 +02:00
|
|
|
%preun efi
|
|
|
|
if [ $1 = 0 ]; then
|
|
|
|
/sbin/install-info --delete %{_infodir}/grub-dev.info %{_infodir}/dir || :
|
|
|
|
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
|
|
|
|
fi
|
|
|
|
|
|
|
|
%files -f grub-%{version}/grub.lang
|
2010-02-18 15:10:48 +01:00
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%{_libdir}/%{name}
|
|
|
|
%{_libdir}/grub/
|
2011-05-09 10:48:37 +02:00
|
|
|
%{_sbindir}/%{name}-*
|
2011-10-25 16:00:45 +02:00
|
|
|
%exclude %{_sbindir}/grub2-efi-*
|
2011-05-09 10:48:37 +02:00
|
|
|
%{_bindir}/%{name}-*
|
2011-10-25 16:00:45 +02:00
|
|
|
%exclude %{_bindir}/%{name}-efi-*
|
2011-05-09 10:48:37 +02:00
|
|
|
%{_sysconfdir}/bash_completion.d/grub
|
|
|
|
%config %{_sysconfdir}/default/grub
|
2010-02-18 15:10:48 +01:00
|
|
|
%dir %{_sysconfdir}/grub.d
|
|
|
|
%{_sysconfdir}/grub.d/README
|
2011-05-09 10:48:37 +02:00
|
|
|
%config %{_sysconfdir}/grub.d/??_*
|
2010-02-18 15:10:48 +01:00
|
|
|
%{_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
|
2011-08-26 10:01:42 +02:00
|
|
|
%doc grub-%{version}/COPYING grub-%{version}/INSTALL grub-%{version}/NEWS
|
|
|
|
%doc grub-%{version}/README grub-%{version}/THANKS grub-%{version}/TODO
|
|
|
|
%doc grub-%{version}/ChangeLog grub-%{version}/README.openSUSE
|
2011-05-09 10:48:37 +02:00
|
|
|
%{_infodir}/grub-dev.info*
|
|
|
|
%{_infodir}/%{name}.info*
|
2010-02-18 15:10:48 +01:00
|
|
|
|
2011-08-26 10:01:42 +02:00
|
|
|
%ifarch %{efi}
|
|
|
|
|
|
|
|
%files efi -f grub-%{version}/grub.lang
|
|
|
|
%defattr(-,root,root,-)
|
|
|
|
%dir /boot/efi
|
|
|
|
%dir /boot/efi/EFI
|
|
|
|
%attr(0755,root,root)/boot/efi/EFI/opensuse
|
|
|
|
/etc/bash_completion.d/grub
|
|
|
|
%{_libdir}/grub2-efi
|
|
|
|
%{_libdir}/grub/
|
|
|
|
%{_sbindir}/grub2-efi-mkconfig
|
|
|
|
%{_sbindir}/grub2-efi-mkdevicemap
|
|
|
|
%{_sbindir}/grub2-efi-mknetdir
|
|
|
|
%{_sbindir}/grub2-efi-install
|
|
|
|
%{_sbindir}/grub2-efi-probe
|
|
|
|
%{_sbindir}/grub2-efi-reboot
|
|
|
|
%{_sbindir}/grub2-efi-set-default
|
2011-10-25 16:00:45 +02:00
|
|
|
#%%{_sbindir}/grub2-efi-setup
|
2011-08-26 10:01:42 +02:00
|
|
|
%{_bindir}/grub2-efi-bin2h
|
|
|
|
%{_bindir}/grub2-efi-editenv
|
|
|
|
%{_bindir}/grub2-efi-fstest
|
|
|
|
%{_bindir}/grub2-efi-kbdcomp
|
|
|
|
%{_bindir}/grub2-efi-menulst2cfg
|
2011-10-25 16:00:45 +02:00
|
|
|
# %%{_bindir}/grub2-efi-mkelfimage
|
2011-08-26 10:01:42 +02:00
|
|
|
%{_bindir}/grub2-efi-mkfont
|
|
|
|
%{_bindir}/grub2-efi-mklayout
|
|
|
|
%{_bindir}/grub2-efi-mkimage
|
2011-10-25 16:00:45 +02:00
|
|
|
# %%{_bindir}/grub2-efi-mkisofs
|
2011-08-26 10:01:42 +02:00
|
|
|
%{_bindir}/grub2-efi-mkpasswd-pbkdf2
|
|
|
|
%{_bindir}/grub2-efi-mkrelpath
|
|
|
|
%ifnarch %{sparc} ppc ppc64
|
|
|
|
%{_bindir}/grub2-efi-mkrescue
|
|
|
|
%endif
|
|
|
|
%ifarch %{sparc} ppc ppc64
|
|
|
|
%{_sbindir}/grub2-efi-ofpathname
|
|
|
|
%endif
|
|
|
|
%{_bindir}/grub2-efi-script-check
|
|
|
|
%dir %{_sysconfdir}/grub.d
|
|
|
|
%config %{_sysconfdir}/grub.d/??_*
|
|
|
|
%{_sysconfdir}/grub.d/README
|
|
|
|
%{_sysconfdir}/grub2-efi.cfg
|
2011-10-25 16:00:45 +02:00
|
|
|
%config %{_sysconfdir}/default/grub
|
2011-08-26 10:01:42 +02:00
|
|
|
%dir /boot/grub2-efi
|
|
|
|
# Actually, this is replaced by update-grub from scriptlets,
|
|
|
|
# but it takes care of modified persistent part
|
|
|
|
%config(noreplace) /boot/grub2-efi/grub.cfg
|
|
|
|
%doc grub-%{version}/COPYING grub-%{version}/INSTALL grub-%{version}/NEWS
|
|
|
|
%doc grub-%{version}/README grub-%{version}/THANKS grub-%{version}/TODO
|
|
|
|
%doc grub-%{version}/ChangeLog grub-%{version}/README.openSUSE
|
|
|
|
%exclude %{_mandir}
|
|
|
|
%{_infodir}/grub2*
|
|
|
|
%endif
|
|
|
|
|
2010-02-18 15:10:48 +01:00
|
|
|
%changelog
|