Add a grubby-bls package that conflicts with grubby

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2018-07-10 13:11:04 -04:00
parent 504ff4446b
commit 2d40f773c6
2 changed files with 29 additions and 6 deletions

8
grubby.in Normal file
View File

@ -0,0 +1,8 @@
#!/bin/bash
if [[ -x @@LIBEXECDIR@@/grubby-bls ]] ; then
exec @@LIBEXECDIR@@/grubby-bls "${@}"
elif [[ -x @@LIBEXECDIR@@/grubby ]] ; then
exec @@LIBEXECDIR@@/grubby "${@}"
fi
echo "Grubby is not installed correctly." >>/dev/stderr
exit 1

View File

@ -10,13 +10,14 @@ URL: https://github.com/rhinstaller/grubby
# Source0: %%{name}-%%{version}.tar.bz2
Source0: https://github.com/rhboot/grubby/archive/%{version}-1.tar.gz
Source1: grubby-bls
Source2: grubby.in
Patch1: drop-uboot-uImage-creation.patch
Patch2: 0001-Change-return-type-in-getRootSpecifier.patch
Patch3: 0002-Add-btrfs-subvolume-support-for-grub2.patch
Patch4: 0003-Add-tests-for-btrfs-support.patch
BuildRequires: pkgconfig glib2-devel popt-devel
BuildRequires: libblkid-devel git-core
BuildRequires: libblkid-devel git-core sed
# for make test / getopt:
BuildRequires: util-linux-ng
%ifarch aarch64 i686 x86_64 %{power64}
@ -60,28 +61,42 @@ make test
%install
make install DESTDIR=$RPM_BUILD_ROOT mandir=%{_mandir}
rm %{buildroot}/sbin/installkernel
rm %{buildroot}/sbin/new-kernel-pkg
cp %{SOURCE1} %{buildroot}/sbin/grubby
mkdir -p %{buildroot}%{_libexecdir}/grubby/
mv -v %{buildroot}/sbin/grubby %{buildroot}%{_libexecdir}/grubby/grubby
cp -v %{SOURCE1} %{buildroot}%{_libexecdir}/grubby/
sed -e "s,@@LIBEXECDIR@@,%{_libexecdir},g" %{SOURCE2} \
> %{buildroot}%{_sbindir}/grubby
%package bls
Summary: Command line tool for updating BootLoaderSpec files
Obsoletes: %{name} < 8.40-13
Conflicts: %{name} <= 8.40-13
BuildArch: noarch
%description bls
This package provides a grubby wrapper that manages BootLoaderSpec files and is
meant to only be used for legacy compatibility users with existing grubby users.
%files
%{!?_licensedir:%global license %%doc}
%license COPYING
%dir %{_libexecdir}/grubby
%{_libexecdir}/grubby/grubby
/sbin/grubby
/sbin/installkernel
/sbin/new-kernel-pkg
%{_mandir}/man8/*.8*
%files bls
%{!?_licensedir:%global license %%doc}
%license COPYING
%dir %{_libexecdir}/grubby
%{_libexecdir}/grubby/grubby-bls
/sbin/grubby
%{_mandir}/man8/*.8*
%changelog
* Fri Jul 13 2018 Javier Martinez Canillas <javierm@redhat.com> - 8.40-13
- Add a grubby-bls package that contains grubby-bls script and obsoletes grubby
- Add a grubby-bls package that conflicts with grubby
* Tue Apr 10 2018 Javier Martinez Canillas <javierm@redhat.com> - 8.40-12
- Use .rpmsave as backup suffix when switching to BLS configuration