From 2d40f773c68d4b987ea67a0bb184f2e6450c1cf5 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Tue, 10 Jul 2018 13:11:04 -0400 Subject: [PATCH] Add a grubby-bls package that conflicts with grubby Signed-off-by: Peter Jones --- grubby.in | 8 ++++++++ grubby.spec | 27 +++++++++++++++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 grubby.in diff --git a/grubby.in b/grubby.in new file mode 100644 index 0000000..f0036e9 --- /dev/null +++ b/grubby.in @@ -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 diff --git a/grubby.spec b/grubby.spec index 756a616..d62192d 100644 --- a/grubby.spec +++ b/grubby.spec @@ -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 - 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 - 8.40-12 - Use .rpmsave as backup suffix when switching to BLS configuration