Accepting request 155546 from home:duwe:branches:Base:System
- merge internal+external BS changes into superset spec file, remove obsolete dependencies - merge SLES+openSUSE patches, restrict "grub2-efi" to 12.2 and 12.3 - add efidisk-ahci-workaround (bnc#794674) - fix unquoted-string-in-class.patch (bnc#788322) - switch to out of source / subdir build OBS-URL: https://build.opensuse.org/request/show/155546 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=16
This commit is contained in:
parent
ab7eaab2d6
commit
b71db834cc
60
efidisk-ahci-workaround
Normal file
60
efidisk-ahci-workaround
Normal file
@ -0,0 +1,60 @@
|
||||
From 61474615b8e177881caa89fc04cae16019cf01b9 Mon Sep 17 00:00:00 2001
|
||||
From: Matthew Garrett <mjg@redhat.com>
|
||||
Date: Wed, 15 Aug 2012 14:37:07 -0400
|
||||
Subject: [PATCH] efidisk: Read chunks in smaller blocks
|
||||
|
||||
---
|
||||
grub-core/disk/efi/efidisk.c | 26 ++++++++++++++++++++++----
|
||||
1 file changed, 22 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/grub-core/disk/efi/efidisk.c b/grub-core/disk/efi/efidisk.c
|
||||
index a432b44..77ab5b0 100644
|
||||
--- a/grub-core/disk/efi/efidisk.c
|
||||
+++ b/grub-core/disk/efi/efidisk.c
|
||||
@@ -546,6 +546,9 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector,
|
||||
struct grub_efidisk_data *d;
|
||||
grub_efi_block_io_t *bio;
|
||||
grub_efi_status_t status;
|
||||
+ grub_size_t remaining = size;
|
||||
+ grub_size_t read = 0;
|
||||
+ grub_size_t chunk = 0x500;
|
||||
|
||||
d = disk->data;
|
||||
bio = d->block_io;
|
||||
@@ -554,14 +557,29 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector,
|
||||
"reading 0x%lx sectors at the sector 0x%llx from %s\n",
|
||||
(unsigned long) size, (unsigned long long) sector, disk->name);
|
||||
|
||||
+ while (remaining > chunk) {
|
||||
+ status = efi_call_5 (bio->read_blocks, bio, bio->media->media_id,
|
||||
+ (grub_efi_uint64_t) sector + read,
|
||||
+ (grub_efi_uintn_t) chunk << disk->log_sector_size,
|
||||
+ buf + (read << disk->log_sector_size));
|
||||
+ if (status != GRUB_EFI_SUCCESS)
|
||||
+ return grub_error (GRUB_ERR_READ_ERROR,
|
||||
+ N_("failure reading sector 0x%llx from `%s'"),
|
||||
+ (unsigned long long) sector + read,
|
||||
+ disk->name);
|
||||
+ read += chunk;
|
||||
+ remaining -= chunk;
|
||||
+ }
|
||||
+
|
||||
status = efi_call_5 (bio->read_blocks, bio, bio->media->media_id,
|
||||
- (grub_efi_uint64_t) sector,
|
||||
- (grub_efi_uintn_t) size << disk->log_sector_size,
|
||||
- buf);
|
||||
+ (grub_efi_uint64_t) sector + read,
|
||||
+ (grub_efi_uintn_t) remaining << disk->log_sector_size,
|
||||
+ buf + (read << disk->log_sector_size));
|
||||
+
|
||||
if (status != GRUB_EFI_SUCCESS)
|
||||
return grub_error (GRUB_ERR_READ_ERROR,
|
||||
N_("failure reading sector 0x%llx from `%s'"),
|
||||
- (unsigned long long) sector,
|
||||
+ (unsigned long long) sector + read,
|
||||
disk->name);
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
--
|
||||
1.7.11.2
|
||||
|
@ -20,58 +20,55 @@ script parser. The fix is to add single quote to the string.
|
||||
util/grub.d/20_linux_xen.in | 2 +-
|
||||
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in
|
||||
index 45f0ad3..5afc079 100644
|
||||
--- a/util/grub.d/10_hurd.in
|
||||
+++ b/util/grub.d/10_hurd.in
|
||||
@@ -32,7 +32,7 @@ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
|
||||
Index: grub-2.00/util/grub.d/10_hurd.in
|
||||
===================================================================
|
||||
--- grub-2.00.orig/util/grub.d/10_hurd.in
|
||||
+++ grub-2.00/util/grub.d/10_hurd.in
|
||||
@@ -32,7 +32,7 @@ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; th
|
||||
OS=GNU
|
||||
else
|
||||
OS="${GRUB_DISTRIBUTOR} GNU/Hurd"
|
||||
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
|
||||
+ CLASS="--class '$(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1)' ${CLASS}"
|
||||
+ CLASS="--class '$(echo -n "${GRUB_DISTRIBUTOR}" | sed -r 's/[^[:alnum:]]+/-/g; s/(^-|-$)//g' | tr 'A-Z' 'a-z')' ${CLASS}"
|
||||
fi
|
||||
|
||||
at_least_one=false
|
||||
diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in
|
||||
index b0e84e2..4ec8d96 100644
|
||||
--- a/util/grub.d/10_kfreebsd.in
|
||||
+++ b/util/grub.d/10_kfreebsd.in
|
||||
Index: grub-2.00/util/grub.d/10_kfreebsd.in
|
||||
===================================================================
|
||||
--- grub-2.00.orig/util/grub.d/10_kfreebsd.in
|
||||
+++ grub-2.00/util/grub.d/10_kfreebsd.in
|
||||
@@ -30,7 +30,7 @@ CLASS="--class os"
|
||||
case "${GRUB_DISTRIBUTOR}" in
|
||||
Debian)
|
||||
OS="${GRUB_DISTRIBUTOR} GNU/kFreeBSD"
|
||||
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) --class gnu-kfreebsd --class gnu ${CLASS}"
|
||||
+ CLASS="--class '$(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1)' --class gnu-kfreebsd --class gnu ${CLASS}"
|
||||
+ CLASS="--class '$(echo -n "${GRUB_DISTRIBUTOR}" | sed -r 's/[^[:alnum:]]+/-/g; s/(^-|-$)//g' | tr 'A-Z' 'a-z')' --class gnu-kfreebsd --class gnu ${CLASS}"
|
||||
;;
|
||||
*)
|
||||
OS="FreeBSD"
|
||||
diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
|
||||
index b2f65c0..40f8651 100644
|
||||
--- a/util/grub.d/10_linux.in
|
||||
+++ b/util/grub.d/10_linux.in
|
||||
@@ -32,7 +32,7 @@ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
|
||||
Index: grub-2.00/util/grub.d/10_linux.in
|
||||
===================================================================
|
||||
--- grub-2.00.orig/util/grub.d/10_linux.in
|
||||
+++ grub-2.00/util/grub.d/10_linux.in
|
||||
@@ -32,7 +32,7 @@ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; th
|
||||
OS=GNU/Linux
|
||||
else
|
||||
OS="${GRUB_DISTRIBUTOR}"
|
||||
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
|
||||
+ CLASS="--class '$(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1)' ${CLASS}"
|
||||
+ CLASS="--class '$(echo -n "${GRUB_DISTRIBUTOR}" | sed -r 's/[^[:alnum:]]+/-/g; s/(^-|-$)//g' | tr 'A-Z' 'a-z')' ${CLASS}"
|
||||
fi
|
||||
|
||||
# loop-AES arranges things so that /dev/loop/X can be our root device, but
|
||||
diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
|
||||
index 29184c2..f1ce61e 100644
|
||||
--- a/util/grub.d/20_linux_xen.in
|
||||
+++ b/util/grub.d/20_linux_xen.in
|
||||
@@ -32,7 +32,7 @@ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then
|
||||
Index: grub-2.00/util/grub.d/20_linux_xen.in
|
||||
===================================================================
|
||||
--- grub-2.00.orig/util/grub.d/20_linux_xen.in
|
||||
+++ grub-2.00/util/grub.d/20_linux_xen.in
|
||||
@@ -32,7 +32,7 @@ if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; th
|
||||
OS=GNU/Linux
|
||||
else
|
||||
OS="${GRUB_DISTRIBUTOR} GNU/Linux"
|
||||
- CLASS="--class $(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1) ${CLASS}"
|
||||
+ CLASS="--class '$(echo ${GRUB_DISTRIBUTOR} | tr 'A-Z' 'a-z' | cut -d' ' -f1)' ${CLASS}"
|
||||
+ CLASS="--class '$(echo -n "${GRUB_DISTRIBUTOR}" | sed -r 's/[^[:alnum:]]+/-/g; s/(^-|-$)//g' | tr 'A-Z' 'a-z')' ${CLASS}"
|
||||
fi
|
||||
|
||||
# loop-AES arranges things so that /dev/loop/X can be our root device, but
|
||||
--
|
||||
1.7.3.4
|
||||
|
||||
|
@ -1,8 +1,27 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 14 11:42:40 UTC 2013 - duwe@suse.com
|
||||
|
||||
- merge internal+external BS changes into superset spec file,
|
||||
remove obsolete dependencies
|
||||
- merge SLES+openSUSE patches, restrict "grub-efi" to 12.2
|
||||
- add efidisk-ahci-workaround (bnc#794674)
|
||||
- fix unquoted-string-in-class.patch (bnc#788322)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 8 01:58:22 UTC 2013 - mchang@suse.com
|
||||
|
||||
- adapt to pesign-obs-integration changes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 7 10:38:42 UTC 2013 - mchang@suse.com
|
||||
|
||||
- grub.efi signing on build server.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 31 16:18:56 UTC 2013 - duwe@suse.com
|
||||
|
||||
- switch to out of source / subdir build
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 30 07:29:29 UTC 2013 - mchang@suse.com
|
||||
|
||||
@ -21,6 +40,19 @@ Wed Jan 30 04:36:45 UTC 2013 - arvidjaar@gmail.com
|
||||
from grub2-once
|
||||
- add GRUB_SAVEDFAULT description to /etc/default/grub
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jan 29 02:42:28 UTC 2013 - mchang@suse.com
|
||||
|
||||
- set empty prefix to grub.efi for looking up in current directory
|
||||
- remove grubcd.efi, as grub.efi can now be used for cdrom booting
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jan 28 08:05:52 CET 2013 - snwint@suse.de
|
||||
|
||||
- add fat module to grubcd
|
||||
- explicitly set empty prefix to get grub to set $prefix to the currrent
|
||||
directory
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 18 07:39:18 UTC 2013 - mchang@suse.com
|
||||
|
||||
@ -28,6 +60,16 @@ Fri Jan 18 07:39:18 UTC 2013 - mchang@suse.com
|
||||
- add grub2-secureboot-chainloader.patch, which expands the efi
|
||||
chainloader to be able to verify images via shim lock protocol.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 18 06:24:57 UTC 2013 - mchang@suse.com
|
||||
|
||||
- ship a Secure Boot UEFI compatible bootloader (fate#314485).
|
||||
- update for cdrom boot support.
|
||||
- grub2-cdpath.patch: fix the grub.cfg not found when booting from
|
||||
optical disk.
|
||||
- grubcd.efi: the efi image used for optial disk booting, with
|
||||
reduced size and $prefix set to /EFI/BOOT.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jan 8 08:09:01 UTC 2013 - mchang@suse.com
|
||||
|
||||
@ -50,6 +92,26 @@ Fri Jan 4 10:29:58 UTC 2013 - arvidjaar@gmail.com
|
||||
- add support for chainloading another UEFI bootloader to
|
||||
30_os-prober (bnc#775610)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 21 04:18:06 UTC 2012 - mchang@suse.com
|
||||
|
||||
- put 32-bit grub2 modules to /usr/lib/grub2
|
||||
- put 64-bit grub2 modules to /usr/lib64/grub2 (x86_64-efi)
|
||||
- put grub.efi to /usr/lib64/efi(x86_64) or /usr/lib/efi(i586)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Dec 18 03:43:38 UTC 2012 - mchang@suse.com
|
||||
|
||||
- ship a Secure Boot UEFI compatible bootloader (fate#314485)
|
||||
- add grub2-secureboot-chainloader.patch, which expands the efi
|
||||
chainloader to be able to verify images via shim lock protocol.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Nov 30 06:39:15 UTC 2012 - mchang@suse.com
|
||||
|
||||
- replace %{sles_version} by %{suse_version}
|
||||
- use correct product name
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 26 08:26:10 UTC 2012 - mchang@suse.com
|
||||
|
||||
|
203
grub2.spec
203
grub2.spec
@ -15,6 +15,7 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
# needssslcertforbuild
|
||||
|
||||
Name: grub2
|
||||
@ -43,13 +44,9 @@ BuildRequires: makeinfo
|
||||
BuildRequires: texinfo
|
||||
%endif
|
||||
BuildRequires: python
|
||||
BuildRequires: ruby
|
||||
BuildRequires: xz-devel
|
||||
%if 0%{?suse_version} == 1210
|
||||
BuildRequires: guile
|
||||
%endif
|
||||
%ifarch x86_64
|
||||
%if 0%{?suse_version} >= 1230
|
||||
%if 0%{?suse_version} >= 1230 || 0%{?sles_version} >= 11
|
||||
BuildRequires: pesign-obs-integration
|
||||
%endif
|
||||
%endif
|
||||
@ -57,6 +54,13 @@ BuildRequires: pesign-obs-integration
|
||||
# Modules always contain just 32-bit code
|
||||
%define _libdir %{_exec_prefix}/lib
|
||||
|
||||
%ifarch x86_64
|
||||
# x86_64-efi is 64-bit code, though ..
|
||||
%define efi_libdir %{_exec_prefix}/lib64
|
||||
%else
|
||||
%define efi_libdir %{_libdir}
|
||||
%endif
|
||||
|
||||
%ifarch ppc ppc64
|
||||
%define grubcpu powerpc
|
||||
%define platform ieee1275
|
||||
@ -82,7 +86,7 @@ BuildRequires: pesign-obs-integration
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if 0%{?sles_version} == 11
|
||||
%if 0%{?suse_version} == 1110 || 0%{?sles_version} == 11
|
||||
%define only_efi %{nil}
|
||||
%define only_x86_64 %{nil}
|
||||
%endif
|
||||
@ -135,6 +139,7 @@ Patch27: grub2-add-device-to-os_prober-linux-menuentry.patch
|
||||
Patch28: grub2-fix-unquoted-string-in-class.patch
|
||||
Patch29: grub2-secureboot-chainloader.patch
|
||||
Patch30: grub2-cdpath.patch
|
||||
Patch31: efidisk-ahci-workaround
|
||||
PreReq: perl-Bootloader
|
||||
Requires: gettext-runtime
|
||||
%if 0%{?suse_version} >= 1140
|
||||
@ -155,20 +160,26 @@ ExclusiveArch: %{ix86} x86_64 ppc ppc64
|
||||
%endif
|
||||
|
||||
%description
|
||||
This is the second version of the GRUB (Grand Unified Bootloader),
|
||||
a highly configurable and customizable bootloader with modular
|
||||
architecture. It supports rich scale of kernel formats, file systems,
|
||||
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.
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Gordon Matzigkeit
|
||||
Yoshinori K. Okuji
|
||||
Colin Watson
|
||||
Colin D. Bennett
|
||||
Vesa Jääskeläinen
|
||||
Robert Millan
|
||||
Carles Pina
|
||||
|
||||
%package %{grubarch}
|
||||
|
||||
Summary: GRUB2 for %{platform} systems
|
||||
Summary: Bootloader with support for Linux, Multiboot and more
|
||||
Group: System/Boot
|
||||
|
||||
%description %{grubarch}
|
||||
@ -178,23 +189,36 @@ file systems, computer architectures and hardware devices. This subpackage
|
||||
provides support for %{platform} systems.
|
||||
|
||||
%ifarch %{efi}
|
||||
|
||||
%if 0%{?suse_version} == 1220 || 0%{?suse_version} == 1230
|
||||
%package efi
|
||||
|
||||
Summary: GRUB2 for EFI systems
|
||||
Summary: Bootloader with support for Linux, Multiboot and more
|
||||
Group: System/Boot
|
||||
PreReq: %{name} = %{version}-%{release}
|
||||
PreReq: %{name}-%{grubefiarch} = %{version}-%{release}
|
||||
|
||||
%description efi
|
||||
The GRand Unified Bootloader (GRUB) is a highly configurable and customizable
|
||||
bootloader with modular architecture. It supports rich variety of kernel formats,
|
||||
file systems, computer architectures and hardware devices. This subpackage
|
||||
provides compatibility to old package and install new required one.
|
||||
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.
|
||||
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Gordon Matzigkeit
|
||||
Yoshinori K. Okuji
|
||||
Colin Watson
|
||||
Colin D. Bennett
|
||||
Vesa Jääskeläinen
|
||||
Robert Millan
|
||||
Carles Pina
|
||||
%endif
|
||||
|
||||
%package %{grubefiarch}
|
||||
|
||||
Summary: GRUB2 for EFI systems
|
||||
Summary: Bootloader with support for Linux, Multiboot and more
|
||||
Group: System/Boot
|
||||
%ifarch ia64 x86_64
|
||||
#Package is available on ia64 and x86_64 only and not necessarily needed
|
||||
@ -211,14 +235,12 @@ provides support for EFI systems.
|
||||
|
||||
%prep
|
||||
# We create (if we build for efi) two copies of the sources in the Builddir
|
||||
%setup -q -T -c -n grub-%{version} -a 0 -a 5
|
||||
cp -r po grub-%{version}/
|
||||
cd grub-%{version}
|
||||
%setup -q -n grub-%{version} -a 5
|
||||
(cd po && ls *.po | cut -d. -f1 | xargs) >po/LINGUAS
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
# Workaround SLE11's patch utility did not rename the file for us
|
||||
%if 0%{?sles_version} == 11
|
||||
%if 0%{?suse_version} == 1110 || 0%{?sles_version} == 11
|
||||
mv docs/grub.texi docs/grub2.texi
|
||||
%endif
|
||||
%patch2 -p1
|
||||
@ -252,28 +274,38 @@ mv docs/grub.texi docs/grub2.texi
|
||||
%patch28 -p1
|
||||
%patch29 -p1
|
||||
%patch30 -p1
|
||||
cd ..
|
||||
%patch31 -p1
|
||||
|
||||
# README.openSUSE
|
||||
cp %{SOURCE3} grub-%{version}/
|
||||
cp %{SOURCE8} grub-%{version}/
|
||||
cp %{SOURCE9} grub-%{version}/grub-core/
|
||||
cp %{SOURCE3} .
|
||||
cp %{SOURCE8} .
|
||||
cp %{SOURCE9} grub-core/.
|
||||
mkdir build
|
||||
%ifarch %{efi}
|
||||
(cp -a grub-%{version} grub-efi-%{version})
|
||||
mkdir build-efi
|
||||
%endif
|
||||
|
||||
%build
|
||||
%ifarch %{efi}
|
||||
cd grub-efi-%{version}
|
||||
autoreconf -vi
|
||||
# we don't want to let rpm to override *FLAGS by bogus ones
|
||||
# Not yet:
|
||||
%define common_conf_options TARGET_LDFLAGS=-static --program-transform-name=s,grub,%{name},
|
||||
# This does NOT work on SLE11:
|
||||
%define _configure ../configure
|
||||
|
||||
# We don't want to let rpm override *FLAGS with default a.k.a bogus values.
|
||||
CFLAGS="-fno-strict-aliasing -fno-inline-functions-called-once "
|
||||
CXXFLAGS=" "
|
||||
FFLAGS=" "
|
||||
export CFLAGS CXXFLAGS FFLAGS
|
||||
%configure \
|
||||
|
||||
%ifarch %{efi}
|
||||
cd build-efi
|
||||
../configure \
|
||||
TARGET_LDFLAGS=-static \
|
||||
--prefix=%{_prefix} \
|
||||
--sysconfdir=%{_sysconfdir} \
|
||||
--target=%{_target_platform} \
|
||||
--libdir=%{efi_libdir} \
|
||||
--with-platform=efi \
|
||||
--program-transform-name=s,grub,%{name},
|
||||
make %{?_smp_mflags}
|
||||
@ -282,10 +314,10 @@ make %{?_smp_mflags}
|
||||
|
||||
FS_MODULES="ext2 btrfs ext2 xfs jfs reiserfs"
|
||||
CD_MODULES=" all_video boot cat chain configfile echo \
|
||||
efinet fat font gfxmenu gfxterm gzio halt iso9660 \
|
||||
efinet font gfxmenu gfxterm gzio halt iso9660 \
|
||||
jpeg minicmd normal part_apple part_msdos part_gpt \
|
||||
password_pbkdf2 png reboot search search_fs_uuid \
|
||||
search_fs_file search_label sleep test video"
|
||||
search_fs_file search_label sleep test video fat"
|
||||
|
||||
%ifarch x86_64
|
||||
CD_MODULES="${CD_MODULES} linuxefi"
|
||||
@ -303,14 +335,7 @@ cd ..
|
||||
%endif
|
||||
|
||||
%if ! 0%{?only_efi:1}
|
||||
cd grub-%{version}
|
||||
autoreconf -vi
|
||||
|
||||
# we don't want to let rpm to override *FLAGS by bogus ones
|
||||
CFLAGS="-fno-strict-aliasing -fno-inline-functions-called-once "
|
||||
CXXFLAGS=" "
|
||||
FFLAGS=" "
|
||||
export CFLAGS CXXFLAGS FFLAGS
|
||||
cd build
|
||||
|
||||
# 64-bit x86-64 machines use 32-bit boot loader
|
||||
# (We cannot just redefine _target_cpu, as we'd get i386.rpm packages then)
|
||||
@ -324,45 +349,36 @@ 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 \
|
||||
../configure TARGET_LDFLAGS=-static \
|
||||
--prefix=%{_prefix} \
|
||||
--sysconfdir=%{_sysconfdir} \
|
||||
--target=%{_target_platform} \
|
||||
--with-platform=%{platform} \
|
||||
%{extraconfigure} \
|
||||
--program-transform-name=s,grub,%{name},
|
||||
|
||||
make %{?_smp_mflags}
|
||||
%endif
|
||||
|
||||
%install
|
||||
%ifarch %{efi}
|
||||
cd grub-efi-%{version}
|
||||
%ifarch x86_64
|
||||
%if 0%{?suse_version} >= 1230 || 0%{?sles_version} >= 11
|
||||
export BRP_PESIGN_FILES="%{efi_libdir}/efi/grub.efi"
|
||||
%endif
|
||||
%endif
|
||||
cd build-efi
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
|
||||
install -m 644 grub.efi $RPM_BUILD_ROOT%{_libdir}/%{name}/%{grubefiarch}/grub.efi
|
||||
%ifarch x86_64
|
||||
%if 0%{?suse_version} >= 1230
|
||||
export BRP_PESIGN_FILES="%{_libdir}/%{name}/%{grubefiarch}/grub.efi"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# Create grub.efi link to system efi directory
|
||||
# This is for tools like kiwi not fiddling with the path
|
||||
%if "%{grubefiarch}" == "x86_64-efi"
|
||||
%define sysefidir %{_exec_prefix}/lib64/efi
|
||||
%else
|
||||
%define sysefidir %{_libdir}/efi
|
||||
%endif
|
||||
install -d $RPM_BUILD_ROOT%{sysefidir}
|
||||
ln -sf ../../../%{_libdir}/%{name}/%{grubefiarch}/grub.efi $RPM_BUILD_ROOT%{sysefidir}/grub.efi
|
||||
|
||||
install -m 755 -d $RPM_BUILD_ROOT%{efi_libdir}/efi
|
||||
install -m 644 grub.efi $RPM_BUILD_ROOT%{efi_libdir}/efi/grub.efi
|
||||
cd ..
|
||||
%endif
|
||||
|
||||
%if ! 0%{?only_efi:1}
|
||||
cd grub-%{version}
|
||||
cd build
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
%else
|
||||
cd grub-efi-%{version}
|
||||
cd build-efi
|
||||
%endif
|
||||
|
||||
# Script that makes part of grub.cfg persist across updates
|
||||
@ -376,12 +392,20 @@ install -d $RPM_BUILD_ROOT/boot/%{name}
|
||||
touch $RPM_BUILD_ROOT/boot/%{name}/grub.cfg
|
||||
|
||||
# Remove devel files
|
||||
%ifarch x86_64
|
||||
%if ! 0%{?only_efi:1}
|
||||
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/*/*.h
|
||||
%endif
|
||||
rm $RPM_BUILD_ROOT/%{efi_libdir}/%{name}/*/*.h
|
||||
%else
|
||||
rm $RPM_BUILD_ROOT/%{_libdir}/%{name}/*/*.h
|
||||
%endif
|
||||
%if 0%{?suse_version} >= 1140
|
||||
rm $RPM_BUILD_ROOT%{_datadir}/%{name}/*.h
|
||||
%endif
|
||||
|
||||
%ifarch %{efi}
|
||||
%if 0%{?suse_version} == 1220 || 0%{?suse_version} == 1230
|
||||
# grub2-efi compatibility links until other packages are fixed
|
||||
ln -sf %{name}-editenv $RPM_BUILD_ROOT%{_bindir}/%{name}-efi-editenv
|
||||
ln -sf %{name}-set-default $RPM_BUILD_ROOT%{_sbindir}/%{name}-efi-set-default
|
||||
@ -389,6 +413,7 @@ ln -sf %{name}-mkconfig $RPM_BUILD_ROOT%{_sbindir}/%{name}-efi-mkconfig
|
||||
ln -sf %{name}-install $RPM_BUILD_ROOT%{_sbindir}/%{name}-efi-install
|
||||
ln -sf %{name} $RPM_BUILD_ROOT/boot/%{name}-efi
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# Defaults
|
||||
install -m 644 -D %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/default/grub
|
||||
@ -441,6 +466,7 @@ fi
|
||||
%endif
|
||||
|
||||
%ifarch %{efi}
|
||||
%if 0%{?suse_version} == 1220 || 0%{?suse_version} == 1230
|
||||
|
||||
%triggerpostun -- %{name}-efi
|
||||
|
||||
@ -506,6 +532,7 @@ else
|
||||
fi
|
||||
exit 0
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%preun
|
||||
if [ $1 = 0 ]; then
|
||||
@ -543,16 +570,16 @@ if [ $1 = 0 ]; then
|
||||
%endif
|
||||
fi
|
||||
%if 0%{?only_efi:1}
|
||||
%define source_dir grub-efi-%{version}
|
||||
%define source_dir build-efi
|
||||
%else
|
||||
%define source_dir grub-%{version}
|
||||
%define source_dir build
|
||||
%endif
|
||||
|
||||
%files -f %{source_dir}/%{name}.lang
|
||||
%defattr(-,root,root,-)
|
||||
%doc %{source_dir}/COPYING %{source_dir}/NEWS %{source_dir}/README
|
||||
%doc %{source_dir}/THANKS %{source_dir}/TODO %{source_dir}/ChangeLog
|
||||
%doc %{source_dir}/README.openSUSE
|
||||
%doc COPYING NEWS README
|
||||
%doc THANKS TODO ChangeLog
|
||||
%doc README.openSUSE
|
||||
%dir /boot/%{name}
|
||||
%ghost /boot/%{name}/grub.cfg
|
||||
%{_sysconfdir}/bash_completion.d/grub
|
||||
@ -583,7 +610,6 @@ fi
|
||||
%{_bindir}/%{name}-mkstandalone
|
||||
%{_bindir}/%{name}-mount
|
||||
%{_bindir}/%{name}-script-check
|
||||
%dir %{_libdir}/%{name}
|
||||
%dir %{_datadir}/%{name}
|
||||
%if 0%{?suse_version} >= 1140
|
||||
%{_datadir}/%{name}/*.pf2
|
||||
@ -593,8 +619,10 @@ fi
|
||||
%{_infodir}/%{name}.info*
|
||||
|
||||
%if ! 0%{?only_efi:1}
|
||||
|
||||
%files %{grubarch}
|
||||
%defattr(-,root,root,-)
|
||||
%dir %{_libdir}/%{name}
|
||||
%dir %{_libdir}/%{name}/%{grubarch}
|
||||
%ifnarch ppc ppc64
|
||||
%{_libdir}/%{name}/%{grubarch}/*.image
|
||||
@ -613,29 +641,32 @@ fi
|
||||
%endif
|
||||
|
||||
%ifarch %{efi}
|
||||
|
||||
%if 0%{?suse_version} == 1220 || 0%{?suse_version} == 1230
|
||||
%files efi
|
||||
%defattr(-,root,root,-)
|
||||
%doc %{source_dir}/README
|
||||
%doc README
|
||||
%ghost /boot/grub2-efi
|
||||
%{_sbindir}/grub2-efi-install
|
||||
%{_sbindir}/grub2-efi-mkconfig
|
||||
%{_sbindir}/grub2-efi-set-default
|
||||
%{_bindir}/grub2-efi-editenv
|
||||
%endif
|
||||
|
||||
%files %{grubefiarch}
|
||||
%defattr(-,root,root,-)
|
||||
%dir %{_libdir}/%{name}/%{grubefiarch}
|
||||
%{_libdir}/%{name}/%{grubefiarch}/grub.efi
|
||||
%{_libdir}/%{name}/%{grubefiarch}/*.img
|
||||
%{_libdir}/%{name}/%{grubefiarch}/*.lst
|
||||
%{_libdir}/%{name}/%{grubefiarch}/*.mod
|
||||
%{_libdir}/%{name}/%{grubefiarch}/*.module
|
||||
%{_libdir}/%{name}/%{grubefiarch}/gdb_grub2
|
||||
%{_libdir}/%{name}/%{grubefiarch}/gmodule.pl
|
||||
%{_libdir}/%{name}/%{grubefiarch}/kernel.exec
|
||||
%{_libdir}/%{name}/%{grubefiarch}/modinfo.sh
|
||||
%dir %{sysefidir}
|
||||
%{sysefidir}/grub.efi
|
||||
%dir %{efi_libdir}/efi
|
||||
%dir %{efi_libdir}/%{name}
|
||||
%dir %{efi_libdir}/%{name}/%{grubefiarch}
|
||||
%{efi_libdir}/efi/grub.efi
|
||||
%{efi_libdir}/%{name}/%{grubefiarch}/*.img
|
||||
%{efi_libdir}/%{name}/%{grubefiarch}/*.lst
|
||||
%{efi_libdir}/%{name}/%{grubefiarch}/*.mod
|
||||
%{efi_libdir}/%{name}/%{grubefiarch}/*.module
|
||||
%{efi_libdir}/%{name}/%{grubefiarch}/gdb_grub2
|
||||
%{efi_libdir}/%{name}/%{grubefiarch}/gmodule.pl
|
||||
%{efi_libdir}/%{name}/%{grubefiarch}/kernel.exec
|
||||
%{efi_libdir}/%{name}/%{grubefiarch}/modinfo.sh
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
Loading…
Reference in New Issue
Block a user