diff --git a/0008-Add-usr-libexec-rpm-sort.patch b/0008-Add-usr-libexec-rpm-sort.patch index b3e5faa32f6b4fa55963c070812ec849cfe935d4..fcb552b42eee4233a4344f62c722f855c86303c4 100644 --- a/0008-Add-usr-libexec-rpm-sort.patch +++ b/0008-Add-usr-libexec-rpm-sort.patch @@ -1,19 +1,60 @@ -From b8a581014170c6a9bb8ffb799090401a57a4bbe6 Mon Sep 17 00:00:00 2001 +From 6b326a35d329c61f80ddfd846e193087dceda2c5 Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Fri, 12 Oct 2018 16:39:37 -0400 Subject: [PATCH 8/8] Add /usr/libexec/rpm-sort Signed-off-by: Peter Jones --- - rpm-sort.c | 355 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - Makefile | 9 +- .gitignore | 1 + + Makefile | 9 +- + rpm-sort.c | 355 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 363 insertions(+), 2 deletions(-) create mode 100644 rpm-sort.c +diff --git a/.gitignore b/.gitignore +index e64d3bc..1a5a546 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -1,3 +1,4 @@ + grubby ++rpm-sort + version.h + *.o +diff --git a/Makefile b/Makefile +index cfa8e0d..1ab58ae 100644 +--- a/Makefile ++++ b/Makefile +@@ -29,7 +29,7 @@ LDFLAGS := $(RPM_LD_FLAGS) + + grubby_LIBS = -lblkid -lpopt + +-all: grubby ++all: grubby rpm-sort + + debug : clean + $(MAKE) CFLAGS="${CFLAGS} -DDEBUG=1" all +@@ -52,12 +52,17 @@ install: all + install -m 755 grubby $(DESTDIR)$(PREFIX)$(sbindir) ; \ + install -m 644 grubby.8 $(DESTDIR)/$(mandir)/man8 ; \ + fi ++ install -m 755 -d $(DESTDIR)$(PREFIX)$(libexecdir)/grubby/ ++ install -m 755 rpm-sort $(DESTDIR)$(PREFIX)$(libexecdir)/grubby/rpm-sort + + grubby:: $(OBJECTS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(grubby_LIBS) + ++rpm-sort::rpm-sort.o ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lrpm ++ + clean: +- rm -f *.o grubby *~ ++ rm -f *.o grubby rpm-sort *~ + + GITTAG = $(VERSION)-1 + diff --git a/rpm-sort.c b/rpm-sort.c new file mode 100644 -index 00000000000..f19635645ba +index 0000000..2928153 --- /dev/null +++ b/rpm-sort.c @@ -0,0 +1,355 @@ @@ -27,6 +68,7 @@ index 00000000000..f19635645ba +#include +#include +#include ++#include + +typedef enum { + RPMNVRCMP, @@ -335,7 +377,6 @@ index 00000000000..f19635645ba + * sizeof (arguments.inputs[0])); + memset (arguments.inputs, 0, (arguments.input_max + 1) + * sizeof (arguments.inputs[0])); -+ + /* Parse our arguments */ + if (argp_parse (&argp, argc, argv, 0, 0, &arguments) != 0) + errx(1, "%s", "Error in parsing command line arguments\n"); @@ -372,47 +413,7 @@ index 00000000000..f19635645ba + + return 0; +} -diff --git a/Makefile b/Makefile -index cfa8e0d60ab..1ab58aeb039 100644 ---- a/Makefile -+++ b/Makefile -@@ -29,7 +29,7 @@ LDFLAGS := $(RPM_LD_FLAGS) - - grubby_LIBS = -lblkid -lpopt - --all: grubby -+all: grubby rpm-sort - - debug : clean - $(MAKE) CFLAGS="${CFLAGS} -DDEBUG=1" all -@@ -52,12 +52,17 @@ install: all - install -m 755 grubby $(DESTDIR)$(PREFIX)$(sbindir) ; \ - install -m 644 grubby.8 $(DESTDIR)/$(mandir)/man8 ; \ - fi -+ install -m 755 -d $(DESTDIR)$(PREFIX)$(libexecdir)/grubby/ -+ install -m 755 rpm-sort $(DESTDIR)$(PREFIX)$(libexecdir)/grubby/rpm-sort - - grubby:: $(OBJECTS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(grubby_LIBS) - -+rpm-sort::rpm-sort.o -+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ -lrpm -+ - clean: -- rm -f *.o grubby *~ -+ rm -f *.o grubby rpm-sort *~ - - GITTAG = $(VERSION)-1 - -diff --git a/.gitignore b/.gitignore -index e64d3bc0986..1a5a546eee3 100644 ---- a/.gitignore -+++ b/.gitignore -@@ -1,3 +1,4 @@ - grubby -+rpm-sort - version.h - *.o +\ No newline at end of file -- -2.17.1 +2.31.1 diff --git a/grubby.spec b/grubby.spec index 9a3e6e014c593533920307356a3ea276f50eee39..6eba2c44d5dc698a6093eca75fea053c2bdbe571 100644 --- a/grubby.spec +++ b/grubby.spec @@ -1,4 +1,5 @@ -%define anolis_release 3 +%define anolis_release 4 + Name: grubby Version: 8.40 Release: %{anolis_release}%{?dist} @@ -24,14 +25,14 @@ Patch0007: 0007-Make-installkernel-to-use-kernel-install-scripts-on-.patch Patch0008: 0008-Add-usr-libexec-rpm-sort.patch Patch0009: 0009-Fix-build-with-rpm-4.16.patch -Patch1000: 1000-grubby-support-anolis.patch +Patch1000: 1000-grubby-support-anolis.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: pkgconfig glib2-devel popt-devel BuildRequires: libblkid-devel git # for make test / getopt: BuildRequires: util-linux-ng -BuildRequires: /usr/bin/grub2-editenv +BuildRequires: grub2-tools-minimal BuildRequires: rpm-devel Requires: grub2-tools-minimal @@ -46,17 +47,30 @@ and zipl (s390) boot loaders. It is primarily designed to be used from scripts which install new kernels and need to find information about the current boot environment. -%prep -%setup -q -n %{name}-%{version}-1 +%package deprecated +Summary: Legacy command line tool for updating bootloader configs +Conflicts: %{name} <= 8.40 + +%description deprecated +This package provides deprecated, legacy grubby. This is for temporary +compatibility only. + +grubby is a command line tool for updating and displaying information about +the configuration files for the grub, lilo, elilo (ia64), yaboot (powerpc) +and zipl (s390) boot loaders. It is primarily designed to be used from +scripts which install new kernels and need to find information about the +current boot environment. + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. -git init -git config user.email "noone@example.com" -git config user.name "no one" -git add . -git commit -a -q -m "%{version} baseline" -git am %{patches} - 8.40-4 +- Add doc package for grubby + * Mon Mar 28 2022 Chunmei Xu - 8.40-3 - set bls related command for default - traditional grub/installkernel move to deprecated packages