networking: Update keepalived from 1.3.5 to 2.1.5

This commit updates keepalived from v1.3.5 to v2.1.5 to avoid failures
encountered when building StarlingX flock container images, which
started to fail with the following errors after the recent iptables
update introduced by commit 36673774ee ("iproute-5.12, iptables-1.8.4,
and libnftnl-1.1.5", 2021-10-27):

=== 8< ===
Error: Package: keepalived-1.3.5-19.el7.x86_64 (base)
       Requires: libxtables.so.10()(64bit)
       Available: iptables-1.4.21-35.el7.x86_64 (base)
           libxtables.so.10()(64bit)
       Installing: iptables-1.8.4-21.tis.5.x86_64 (stx-mirror-distro)
           Not found
=== >8 ===

keepalived-2.1.5 was imported from CentOS 8-Stream where it is the
latest version as of this writing. It should be noted that rebuilding
keepalived-1.3.5 (i.e., CentOS 7's version) was not suitable as
keepalived-1.3.5 does not support iptables-nftables, and the CentOS
8-Stream keepalived RPM cannot be used as is due to the specific
versions of some of its dependencies.

During the preparation of this patch, an unexpected build failure had to
be worked around by disabling SNMP support in keepalived, which is
assumed to not have a negative impact on StarlingX according to a
software architect colleague at Wind River. Please see the description
of the patch named "keepalived.spec-Disable-dependency-on-snmp.patch"
for further details regarding the build failure.

Verification:
- Layered and monolithic StarlingX master branch builds succeed.
- StarlingX container builds, which used to fail without this commit,
  succeed as well.

Closes-Bug: #1950513

Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
Change-Id: I59bd7d4f8ed89c73248ecd97e6985f91b88c4623
This commit is contained in:
M. Vefa Bicakci 2021-11-10 18:43:13 -05:00
parent b75f375c62
commit 6da5c5ecbe
8 changed files with 131 additions and 0 deletions

View File

@ -99,4 +99,5 @@ tools/kexec-tools
tools/libbpf
networking/iproute
networking/iptables
networking/keepalived
networking/libnftnl

View File

@ -1,5 +1,6 @@
iproute-5.12.0-4.el8.src.rpm#https://vault.centos.org/8-stream/BaseOS/Source/SPackages/iproute-5.12.0-4.el8.src.rpm
iptables-1.8.4-21.el8.src.rpm#https://vault.centos.org/8-stream/BaseOS/Source/SPackages/iptables-1.8.4-21.el8.src.rpm
keepalived-2.1.5-6.el8.src.rpm#http://vault.centos.org/8-stream/AppStream/Source/SPackages/keepalived-2.1.5-6.el8.src.rpm
libnftnl-1.1.5-4.el8.src.rpm#https://vault.centos.org/8-stream/BaseOS/Source/SPackages/libnftnl-1.1.5-4.el8.src.rpm
libvirt-python-4.7.0-1.fc28.src.rpm#https://libvirt.org/sources/python/libvirt-python-4.7.0-1.fc28.src.rpm
linuxptp-3.1.1-1.el8.src.rpm#http://vault.centos.org/8-stream/AppStream/Source/SPackages/linuxptp-3.1.1-1.el8.src.rpm

View File

@ -0,0 +1 @@
TIS_PATCH_VER=PKG_GITREVCOUNT

View File

@ -0,0 +1,3 @@
keepalived.spec-Modify-Release-field-for-StarlingX.patch
keepalived.spec-Disable-dependency-on-snmp.patch
keepalived.spec-Remove-usr-share-doc-keepalived-READ.patch

View File

@ -0,0 +1,57 @@
From 2c2b300edea3dea24d59dce0347a70d37994c135 Mon Sep 17 00:00:00 2001
From: "M. Vefa Bicakci" <vefa.bicakci@windriver.com>
Date: Wed, 10 Nov 2021 20:52:06 -0500
Subject: [PATCH] keepalived.spec: Disable dependency on snmp
This commit removes keepalived package's dependency on SNMP. This was
done for two reasons:
- keepalived's configure script fails with the following error message
when attempting to check the sanity of the C compiler flags needed to
link keepalived with the net-snmp library.
configure:11981: checking whether C compiler supports flag "..." from Net-SNMP
configure:11992: gcc -o conftest -O2 -g -pipe -Wall ...
/usr/lib64/libnetsnmpmibs.so: undefined reference to `headerGetEntry'
collect2: error: ld returned 1 exit status
This occurs because of the mock build environment has a version of RPM
(and hence librpm) that is more recent than the one shipped with
CentOS 7.x, and librpm's "headerGetEntry" function has since been
deprecated, but net-snmp library is expected to dynamically link
against an RPM library with the "headerGetEntry" function defined.
For the record, another colleague has encountered this issue in the
past, but with lldp instead of keepalived:
https://gist.github.com/ericho/049d1908f5d80485541e918515996702
- To resolve the aforementioned issue, one can build net-snmp library in
StarlingX as well. net-snmp used to be included in StarlingX's integ
repository, but it was removed with the following commit:
https://review.opendev.org/c/starlingx/integ/+/765381
keepalived is being updated in StarlingX, because OpenStack's neutron
depends on keepalived, and the stock version in CentOS 7 is not
compatible with the recently updated iptables. A software architect
colleague confirmed that neutron does not need to use keepalived in
StarlingX's context. This change is made to avoid the need to re-package
a large number of dependencies due to the recent iptables update.
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
---
SPECS/keepalived.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/keepalived.spec b/SPECS/keepalived.spec
index 13650da79d64..8087fd474585 100644
--- a/SPECS/keepalived.spec
+++ b/SPECS/keepalived.spec
@@ -1,4 +1,4 @@
-%bcond_without snmp
+%bcond_with snmp
%bcond_without vrrp
%bcond_without sha1
%bcond_with iptables
--
2.29.2

View File

@ -0,0 +1,29 @@
From 63e4c62e7b642e273409b28bac8658af627553b6 Mon Sep 17 00:00:00 2001
From: "M. Vefa Bicakci" <vefa.bicakci@windriver.com>
Date: Wed, 10 Nov 2021 19:01:31 -0500
Subject: [PATCH] keepalived.spec: Modify Release field for StarlingX
This commit modifies the Release field of the keepalived package's spec
file for StarlingX.
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
---
SPECS/keepalived.spec | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/SPECS/keepalived.spec b/SPECS/keepalived.spec
index b719d6cf2789..13650da79d64 100644
--- a/SPECS/keepalived.spec
+++ b/SPECS/keepalived.spec
@@ -10,7 +10,7 @@
Name: keepalived
Summary: High Availability monitor built upon LVS, VRRP and service pollers
Version: 2.1.5
-Release: 6%{?dist}
+Release: 6%{?_tis_dist}.%{tis_patch_ver}
License: GPLv2+
URL: http://www.keepalived.org/
Group: System Environment/Daemons
--
2.29.2

View File

@ -0,0 +1,38 @@
From e111abc4421d848c99b30f6aaf077d08aea61337 Mon Sep 17 00:00:00 2001
From: "M. Vefa Bicakci" <vefa.bicakci@windriver.com>
Date: Wed, 10 Nov 2021 21:34:32 -0500
Subject: [PATCH] keepalived.spec: Remove /usr/share/doc/keepalived/README
This commit removes the file "/usr/share/doc/keepalived/README" from the
installation directory, because the same file is already installed into
"/usr/share/doc/keepalived-<version>/README", and RPM reports the
following error about the former file:
Checking for unpackaged file(s): /usr/lib/rpm/check-files \
/builddir/build/BUILDROOT/keepalived-2.1.5-6.tis.1.x86_64
RPM build errors:
error: Installed (but unpackaged) file(s) found:
/usr/share/doc/keepalived/README
Installed (but unpackaged) file(s) found:
/usr/share/doc/keepalived/README
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
---
SPECS/keepalived.spec | 1 +
1 file changed, 1 insertion(+)
diff --git a/SPECS/keepalived.spec b/SPECS/keepalived.spec
index 8087fd474585..44b5a3f06578 100644
--- a/SPECS/keepalived.spec
+++ b/SPECS/keepalived.spec
@@ -69,6 +69,7 @@ rm -rf %{buildroot}
make install DESTDIR=%{buildroot}
rm -rf %{buildroot}%{_initrddir}/
rm -rf %{buildroot}%{_sysconfdir}/keepalived/samples/
+rm -f %{buildroot}%{_docdir}/%{name}/README
%{__install} -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/keepalived.service
mkdir -p %{buildroot}%{_libexecdir}/keepalived
--
2.29.2

View File

@ -0,0 +1 @@
mirror:Source/keepalived-2.1.5-6.el8.src.rpm