SHA256
1
0
forked from pool/grub2

Accepting request 664316 from home:rwill:branches:Base:System

Build platform-packages 'noarch' for SUSE Manager.  (FATE#326960)
With spec-file cleanup and and attempt to fix SLE11SP4.

OBS-URL: https://build.opensuse.org/request/show/664316
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=320
This commit is contained in:
Michael Chang 2019-01-10 09:57:18 +00:00 committed by Git OBS Bridge
parent 992b86f38f
commit 0aca94611d
3 changed files with 67 additions and 42 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Jan 9 11:54:00 UTC 2019 - rw@suse.com
- Build platform-packages 'noarch' for SUSE Manager. (FATE#326960)
-------------------------------------------------------------------
Thu Dec 20 09:21:27 UTC 2018 - mchang@suse.com

View File

@ -7,3 +7,5 @@ addFilter("statically-linked-binary .*/grub2/*/kernel.img")
addFilter("unstripped-binary-or-object .*/grub2/*/.*.mod")
# TODO: s390 Experts: is this sensible?!
addFilter("s390x: W: executable-stack")
#
addFilter("suse-filelist-forbidden-noarch")

View File

@ -1,7 +1,7 @@
#
# spec file for package grub2
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -14,9 +14,11 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# needssslcertforbuild
# needssslcertforbuild
%define _binaries_in_noarch_package_terminate_build 0
Name: grub2
%ifarch x86_64 ppc64
BuildRequires: gcc-32bit
@ -28,13 +30,13 @@ BuildRequires: glibc-devel
%endif
BuildRequires: automake
BuildRequires: bison
BuildRequires: dejavu-fonts
BuildRequires: device-mapper-devel
BuildRequires: fdupes
BuildRequires: flex
BuildRequires: freetype2-devel
BuildRequires: fuse-devel
%if 0%{?suse_version} >= 1140
BuildRequires: dejavu-fonts
BuildRequires: gnu-unifont
%endif
BuildRequires: help2man
@ -44,7 +46,11 @@ BuildRequires: makeinfo
%else
BuildRequires: texinfo
%endif
BuildRequires: python3
%if %{defined pythons}
BuildRequires: %{pythons}
%else
BuildRequires: python
%endif
BuildRequires: xz-devel
%ifarch x86_64 aarch64
%if 0%{?suse_version} >= 1230 || 0%{?suse_version} == 1110
@ -127,7 +133,7 @@ BuildRequires: update-bootloader-rpm-macros
%endif
%if %{platform} == emu
# force %{emu} to 1, e.g. for s390
# force %%{emu} to 1, e.g. for s390
%define emu 1
%endif
@ -324,6 +330,17 @@ Requires(preun):/sbin/install-info
%if ! 0%{?only_efi:1}
Requires: grub2-%{grubarch} = %{version}-%{release}
%endif
%ifarch s390x
# required utilities by grub2-s390x-04-grub2-install.patch
# use 'showconsole' to determine console device. (bnc#876743)
Requires: /sbin/showconsole
Requires: kexec-tools
# for /sbin/zipl used by grub2-zipl-setup
Requires: s390-tools
%endif
%ifarch ppc64 ppc64le
Requires: powerpc-utils
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -356,7 +373,7 @@ Authors:
Summary: Upstream branding for GRUB2's graphical console
Group: System/Fhs
Requires: %{name} = %{version}-%{release}
Requires: %{name} = %{version}
%description branding-upstream
Upstream branding for GRUB2's graphical console
@ -366,25 +383,15 @@ Upstream branding for GRUB2's graphical console
Summary: Bootloader with support for Linux, Multiboot and more
Group: System/Boot
Requires: %{name} = %{version}-%{release}
Requires(post): %{name} = %{version}-%{release}
BuildArch: noarch
Requires: %{name} = %{version}
Requires(post): %{name} = %{version}
%if 0%{?update_bootloader_requires:1}
%update_bootloader_requires
%else
Requires: perl-Bootloader
Requires(post): perl-Bootloader
%endif
%ifarch s390x
# required utilities by grub2-s390x-04-grub2-install.patch
# use 'showconsole' to determine console device. (bnc#876743)
Requires: /sbin/showconsole
Requires: kexec-tools
# for /sbin/zipl used by grub2-zipl-setup
Requires: s390-tools
%endif
%ifarch ppc64 ppc64le
Requires: powerpc-utils
%endif
%description %{grubarch}
The GRand Unified Bootloader (GRUB) is a highly configurable and customizable
@ -399,13 +406,14 @@ provides support for %{platform} systems.
%package %{grubefiarch}
Summary: Bootloader with support for Linux, Multiboot and more
Group: System/Boot
# Require efibootmgr
# Without it grub-install is broken so break the package as well if unavailable
Group: System/Boot
BuildArch: noarch
Requires: efibootmgr
Requires(post): efibootmgr
Requires: %{name} = %{version}-%{release}
Requires(post): %{name} = %{version}-%{release}
Requires: %{name} = %{version}
Requires(post): %{name} = %{version}
%if 0%{?update_bootloader_requires:1}
%update_bootloader_requires
%else
@ -445,7 +453,7 @@ provides support for XEN systems.
Summary: Grub2's snapper plugin
Group: System/Fhs
Requires: %{name} = %{version}-%{release}
Requires: %{name} = %{version}
Requires: libxml2-tools
Supplements: packageand(snapper:grub2)
BuildArch: noarch
@ -635,6 +643,7 @@ mkdir build-emu
%endif
export PYTHON=%{_bindir}/python3
[ -x $PYTHON ] || unset PYTHON # try 'python', if 'python3' is unavailable
# autogen calls autoreconf -vi
./autogen.sh
# Not yet:
@ -701,7 +710,7 @@ make %{?_smp_mflags}
#TODO: add efifwsetup module
FS_MODULES="ext2 btrfs ext2 xfs jfs reiserfs"
FS_MODULES="btrfs ext2 xfs jfs reiserfs"
CD_MODULES=" all_video boot cat chain configfile echo true \
efinet font gfxmenu gfxterm gzio halt iso9660 \
jpeg minicmd normal part_apple part_msdos part_gpt \
@ -721,9 +730,6 @@ GRUB_MODULES="${CD_MODULES} ${FS_MODULES} ${PXE_MODULES} ${CRYPTO_MODULES} mdrai
-d grub-core ${GRUB_MODULES}
./grub-mkimage -O %{grubefiarch} -o grub-tpm.efi --prefix= \
-d grub-core ${GRUB_MODULES} tpm
#./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
%ifarch x86_64 aarch64
%if 0%{?suse_version} >= 1230 || 0%{?suse_version} == 1110
@ -799,12 +805,17 @@ install -m 644 grub.efi grub-tpm.efi $RPM_BUILD_ROOT%{_libdir}/%{name}/%{grubefi
# 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
%define sysefibasedir %{_exec_prefix}/lib64/efi
%else
%define sysefidir %{_libdir}/efi
%define sysefibasedir %{_libdir}/efi
%endif
%define sysefidir %{sysefibasedir}/%{_target_cpu}
install -d $RPM_BUILD_ROOT%{sysefidir}
ln -sf ../../../%{_libdir}/%{name}/%{grubefiarch}/grub.efi $RPM_BUILD_ROOT%{sysefidir}/grub.efi
ln -sf ../../../../%{_libdir}/%{name}/%{grubefiarch}/grub.efi $RPM_BUILD_ROOT%{sysefidir}/grub.efi
%ifarch x86_64
# provide compatibility sym-link for previous shim-install
ln -sf %{_target_cpu}/grub.efi $RPM_BUILD_ROOT%{sysefibasedir}/grub.efi
%endif
%ifarch x86_64 aarch64
%if 0%{?suse_version} >= 1230 || 0%{?suse_version} == 1110
@ -1019,8 +1030,8 @@ if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
# We did not add core.img to grub1 menu.lst in new update-bootloader macro as what
# the old %post ever did, then the %preun counterpart which removed the added core.img
# entry from old %post can be skipped entirely if having new macro in use.
# the old %%post ever did, then the %%preun counterpart which removed the added core.img
# entry from old %%post can be skipped entirely if having new macro in use.
%if ! 0%{?update_bootloader_posttrans:1}%{?only_efi:1}
# To check by current loader settings
if [ -f %{_sysconfdir}/sysconfig/bootloader ]; then
@ -1077,6 +1088,17 @@ fi
%config(noreplace) %{_sysconfdir}/grub.d/41_custom
%config(noreplace) %{_sysconfdir}/grub.d/90_persistent
%config(noreplace) %{_sysconfdir}/grub.d/95_textmode
%ifarch %{ix86} x86_64
%config(noreplace) %{_sysconfdir}/grub.d/20_memtest86+
%endif
%ifarch ppc ppc64 ppc64le
%config(noreplace) %{_sysconfdir}/grub.d/20_ppc_terminfo
%endif
%ifarch s390x
%config(noreplace) %{_sysconfdir}/default/zipl2grub.conf.in
%{dracutlibdir}
%{_sbindir}/%{name}-zipl-setup
%endif
%{_sbindir}/%{name}-install
%{_sbindir}/%{name}-mkconfig
%{_sbindir}/%{name}-once
@ -1161,13 +1183,9 @@ fi
%files %{grubarch}
%defattr(-,root,root,-)
%ifarch %{ix86} x86_64
%config(noreplace) %{_sysconfdir}/grub.d/20_memtest86+
%endif
%dir %{_libdir}/%{name}/%{grubarch}
%ifarch ppc ppc64 ppc64le
%config(noreplace) %{_sysconfdir}/grub.d/20_ppc_terminfo
# This is intentionally "grub.chrp" and not "%{name}.chrp"
# This is intentionally "grub.chrp" and not "%%{name}.chrp"
%{_libdir}/%{name}/%{grubarch}/grub.chrp
%{_libdir}/%{name}/%{grubarch}/bootinfo.txt
%endif
@ -1186,11 +1204,6 @@ fi
%{_libdir}/%{name}/%{grubarch}/kernel.exec
%{_libdir}/%{name}/%{grubarch}/modinfo.sh
%endif
%ifarch s390x
%{_sbindir}/%{name}-zipl-setup
%config(noreplace) %{_sysconfdir}/default/zipl2grub.conf.in
%{dracutlibdir}
%endif
%ifarch %{efi}
@ -1207,8 +1220,13 @@ fi
%{_libdir}/%{name}/%{grubefiarch}/gmodule.pl
%{_libdir}/%{name}/%{grubefiarch}/kernel.exec
%{_libdir}/%{name}/%{grubefiarch}/modinfo.sh
%dir %{sysefibasedir}
%dir %{sysefidir}
%{sysefidir}/grub.efi
%ifarch x86_64
# provide compatibility sym-link for previous shim-install
%{sysefibasedir}/grub.efi
%endif
%ifarch x86_64 aarch64
%if 0%{?suse_version} >= 1230 || 0%{?suse_version} == 1110