From 6da5c5ecbe55047f68e74a9d180eae91ad7c9598 Mon Sep 17 00:00:00 2001 From: "M. Vefa Bicakci" Date: Wed, 10 Nov 2021 18:43:13 -0500 Subject: [PATCH] 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 36673774ee3c ("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 Change-Id: I59bd7d4f8ed89c73248ecd97e6985f91b88c4623 --- centos_pkg_dirs | 1 + centos_srpms_3rdparties.lst | 1 + networking/keepalived/centos/build_srpm.data | 1 + .../centos/meta_patches/PATCH_ORDER | 3 + ...ived.spec-Disable-dependency-on-snmp.patch | 57 +++++++++++++++++++ ...c-Modify-Release-field-for-StarlingX.patch | 29 ++++++++++ ...Remove-usr-share-doc-keepalived-READ.patch | 38 +++++++++++++ networking/keepalived/centos/srpm_path | 1 + 8 files changed, 131 insertions(+) create mode 100644 networking/keepalived/centos/build_srpm.data create mode 100644 networking/keepalived/centos/meta_patches/PATCH_ORDER create mode 100644 networking/keepalived/centos/meta_patches/keepalived.spec-Disable-dependency-on-snmp.patch create mode 100644 networking/keepalived/centos/meta_patches/keepalived.spec-Modify-Release-field-for-StarlingX.patch create mode 100644 networking/keepalived/centos/meta_patches/keepalived.spec-Remove-usr-share-doc-keepalived-READ.patch create mode 100644 networking/keepalived/centos/srpm_path diff --git a/centos_pkg_dirs b/centos_pkg_dirs index c4cfbe982..b5c88a76d 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -99,4 +99,5 @@ tools/kexec-tools tools/libbpf networking/iproute networking/iptables +networking/keepalived networking/libnftnl diff --git a/centos_srpms_3rdparties.lst b/centos_srpms_3rdparties.lst index b7040bde9..4b196d3cb 100644 --- a/centos_srpms_3rdparties.lst +++ b/centos_srpms_3rdparties.lst @@ -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 diff --git a/networking/keepalived/centos/build_srpm.data b/networking/keepalived/centos/build_srpm.data new file mode 100644 index 000000000..69abd61b8 --- /dev/null +++ b/networking/keepalived/centos/build_srpm.data @@ -0,0 +1 @@ +TIS_PATCH_VER=PKG_GITREVCOUNT diff --git a/networking/keepalived/centos/meta_patches/PATCH_ORDER b/networking/keepalived/centos/meta_patches/PATCH_ORDER new file mode 100644 index 000000000..88d17423a --- /dev/null +++ b/networking/keepalived/centos/meta_patches/PATCH_ORDER @@ -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 diff --git a/networking/keepalived/centos/meta_patches/keepalived.spec-Disable-dependency-on-snmp.patch b/networking/keepalived/centos/meta_patches/keepalived.spec-Disable-dependency-on-snmp.patch new file mode 100644 index 000000000..44bcc0499 --- /dev/null +++ b/networking/keepalived/centos/meta_patches/keepalived.spec-Disable-dependency-on-snmp.patch @@ -0,0 +1,57 @@ +From 2c2b300edea3dea24d59dce0347a70d37994c135 Mon Sep 17 00:00:00 2001 +From: "M. Vefa Bicakci" +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 +--- + 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 + diff --git a/networking/keepalived/centos/meta_patches/keepalived.spec-Modify-Release-field-for-StarlingX.patch b/networking/keepalived/centos/meta_patches/keepalived.spec-Modify-Release-field-for-StarlingX.patch new file mode 100644 index 000000000..679144ec1 --- /dev/null +++ b/networking/keepalived/centos/meta_patches/keepalived.spec-Modify-Release-field-for-StarlingX.patch @@ -0,0 +1,29 @@ +From 63e4c62e7b642e273409b28bac8658af627553b6 Mon Sep 17 00:00:00 2001 +From: "M. Vefa Bicakci" +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 +--- + 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 + diff --git a/networking/keepalived/centos/meta_patches/keepalived.spec-Remove-usr-share-doc-keepalived-READ.patch b/networking/keepalived/centos/meta_patches/keepalived.spec-Remove-usr-share-doc-keepalived-READ.patch new file mode 100644 index 000000000..b0e8ef2c1 --- /dev/null +++ b/networking/keepalived/centos/meta_patches/keepalived.spec-Remove-usr-share-doc-keepalived-READ.patch @@ -0,0 +1,38 @@ +From e111abc4421d848c99b30f6aaf077d08aea61337 Mon Sep 17 00:00:00 2001 +From: "M. Vefa Bicakci" +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-/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 +--- + 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 + diff --git a/networking/keepalived/centos/srpm_path b/networking/keepalived/centos/srpm_path new file mode 100644 index 000000000..85172d2d5 --- /dev/null +++ b/networking/keepalived/centos/srpm_path @@ -0,0 +1 @@ +mirror:Source/keepalived-2.1.5-6.el8.src.rpm