SHA256
1
0
forked from pool/grub2

Accepting request 449994 from home:michael-chang:bsc:997317

- Support %posttrans with marcos provided by update-bootloader-rpm-macros
  package (bsc#997317)

OBS-URL: https://build.opensuse.org/request/show/449994
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=243
This commit is contained in:
Andrei Borzenkov 2017-01-13 14:51:18 +00:00 committed by Git OBS Bridge
parent c2373a2196
commit 78250a3d58
2 changed files with 37 additions and 2 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jan 11 06:58:56 UTC 2017 - mchang@suse.com
- Support %posttrans with marcos provided by update-bootloader-rpm-macros
package (bsc#997317)
-------------------------------------------------------------------
Wed Jan 4 08:48:56 UTC 2017 - mchang@suse.com

View File

@ -57,6 +57,9 @@ BuildRequires: pesign-obs-integration
BuildRequires: systemd-rpm-macros
%define has_systemd 1
%endif
%if 0%{?suse_version} > 1320
BuildRequires: update-bootloader-rpm-macros
%endif
# Modules code is dynamically loaded and collected from a _fixed_ path.
%define _libdir %{_exec_prefix}/lib
@ -298,8 +301,12 @@ Summary: Bootloader with support for Linux, Multiboot and more
Group: System/Boot
Requires: %{name} = %{version}-%{release}
Requires(post): %{name} = %{version}-%{release}
%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)
@ -337,8 +344,12 @@ Requires(post): efibootmgr
%endif
Requires: %{name} = %{version}-%{release}
Requires(post): %{name} = %{version}-%{release}
%if 0%{?update_bootloader_requires:1}
%update_bootloader_requires
%else
Requires: perl-Bootloader >= 0.706
Requires(post): perl-Bootloader >= 0.706
%endif
Provides: %{name}-efi = %{version}-%{release}
Obsoletes: %{name}-efi < %{version}-%{release}
@ -765,6 +776,9 @@ perl -ni -e '
%if ! 0%{?only_efi:1}
%post %{grubarch}
%if 0%{?update_bootloader_check_type_reinit_post:1}
%update_bootloader_check_type_reinit_post grub2
%else
# To check by current loader settings
if [ -f %{_sysconfdir}/sysconfig/bootloader ]; then
. %{_sysconfdir}/sysconfig/bootloader
@ -808,10 +822,17 @@ elif [ "x${LOADER_TYPE}" = "xgrub2" ]; then
fi
%endif
%posttrans %{grubarch}
%{?update_bootloader_posttrans}
%endif
%ifarch %{efi}
%post %{grubefiarch}
%if 0%{?update_bootloader_check_type_reinit_post:1}
%update_bootloader_check_type_reinit_post grub2-efi
%else
# To check by current loader settings
if [ -f %{_sysconfdir}/sysconfig/bootloader ]; then
. %{_sysconfdir}/sysconfig/bootloader
@ -842,13 +863,21 @@ fi
exit 0
%endif
%posttrans %{grubefiarch}
%{?update_bootloader_posttrans}
%endif
%preun
%service_del_preun grub2-once.service
if [ $1 = 0 ]; then
/sbin/install-info --delete %{_infodir}/grub-dev.info %{_infodir}/dir || :
/sbin/install-info --delete %{_infodir}/%{name}.info %{_infodir}/dir || :
%if ! 0%{?only_efi:1}
# 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.
%if ! 0%{?update_bootloader_posttrans:1}%{?only_efi:1}
# To check by current loader settings
if [ -f %{_sysconfdir}/sysconfig/bootloader ]; then
. %{_sysconfdir}/sysconfig/bootloader