Switch to a BLS configuration on %%post

By default the old grubby tool isn't installed anymore and it's part of
the grubby-deprecated package. Instead the grubby wrapper that modifies
BLS config files is installed for backward compatiblity with old grubby.

So on postinstall the bootloader configuration has to be changed to BLS
since non-BLS bootloader configuration won't be updated anymore without
the old grubby tool and the new-kernel-pkg script.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
This commit is contained in:
Javier Martinez Canillas 2018-11-12 22:47:30 +01:00
parent d72135ede9
commit f9d8ee1b64
No known key found for this signature in database
GPG Key ID: C751E590D63F3D69
1 changed files with 19 additions and 2 deletions

View File

@ -1,6 +1,6 @@
Name: grubby
Version: 8.40
Release: 19%{?dist}
Release: 20%{?dist}
Summary: Command line tool for updating bootloader configs
License: GPLv2+
URL: https://github.com/rhinstaller/grubby
@ -38,6 +38,8 @@ Requires: s390utils-base
%endif
Requires: findutils
Obsoletes: %{name}-bls
%description
This package provides a grubby compatibility script that manages
BootLoaderSpec files and is meant to only be used for legacy compatibility
@ -76,9 +78,21 @@ sed -e "s,@@LIBEXECDIR@@,%{_libexecdir}/grubby,g" %{SOURCE2} \
sed -e "s,@@LIBEXECDIR@@,%{_libexecdir}/installkernel,g" %{SOURCE3} \
> %{buildroot}%{_sbindir}/installkernel
%post
if [ "$1" = 2 ]; then
arch=$(uname -m)
if [[ $arch == "s390x" ]]; then
command=zipl-switch-to-blscfg
else
command=grub2-switch-to-blscfg
fi
$command --backup-suffix=.rpmsave &>/dev/null || :
fi
%package deprecated
Summary: Legacy command line tool for updating bootloader configs
Conflicts: %{name} <= 8.40-13
Conflicts: %{name} <= 8.40-18
%description deprecated
This package provides deprecated, legacy grubby. This is for temporary
@ -115,6 +129,9 @@ current boot environment.
%{_mandir}/man8/*.8*
%changelog
* Tue Nov 13 2018 Javier Martinez Canillas <javierm@redhat.com> - 8.40-20
- Switch to a BLS configuration on %%post
* Tue Nov 06 2018 Javier Martinez Canillas <javierm@redhat.com> - 8.40-19
- Make the temporary config wrapper be what "grubby" contains, and put
traditional grubby in grubby-deprecated (pjones)