From 961450f8ce1c628e83b718a5794a44f12e7a3150 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Wed, 18 May 2022 14:17:57 +0300 Subject: [PATCH] AlmaLinux changes --- .../WALinuxAgent-2.3-almalinux_support.patch | 101 ++++++++++++++++++ SPECS/WALinuxAgent.spec | 9 +- 2 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 SOURCES/WALinuxAgent-2.3-almalinux_support.patch diff --git a/SOURCES/WALinuxAgent-2.3-almalinux_support.patch b/SOURCES/WALinuxAgent-2.3-almalinux_support.patch new file mode 100644 index 0000000..c8f9188 --- /dev/null +++ b/SOURCES/WALinuxAgent-2.3-almalinux_support.patch @@ -0,0 +1,101 @@ +From 958d73ebc8c196dd30e9768d3e9cf1bdb6d32e25 Mon Sep 17 00:00:00 2001 +From: Aleksandr Kravchenko +Date: Thu, 1 Apr 2021 17:19:08 +0300 +Subject: [PATCH 1/3] added AlmaLinux + +--- + azurelinuxagent/common/osutil/factory.py | 2 +- + azurelinuxagent/pa/rdma/factory.py | 2 +- + setup.py | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/azurelinuxagent/common/osutil/factory.py b/azurelinuxagent/common/osutil/factory.py +index b212c38253..4a09544c4d 100644 +--- a/azurelinuxagent/common/osutil/factory.py ++++ b/azurelinuxagent/common/osutil/factory.py +@@ -98,7 +98,7 @@ def _get_osutil(distro_name, distro_code_name, distro_version, distro_full_name) + + return DebianOSBaseUtil() + +- if distro_name in ("redhat", "rhel", "centos", "oracle"): ++ if distro_name in ("redhat", "rhel", "centos", "oracle", "almalinux"): + if Version(distro_version) < Version("7"): + return Redhat6xOSUtil() + +diff --git a/azurelinuxagent/pa/rdma/factory.py b/azurelinuxagent/pa/rdma/factory.py +index d86d8b8f49..e19f2fe918 100644 +--- a/azurelinuxagent/pa/rdma/factory.py ++++ b/azurelinuxagent/pa/rdma/factory.py +@@ -38,7 +38,7 @@ def get_rdma_handler( + ): + return SUSERDMAHandler() + +- if distro_full_name == 'CentOS Linux' or distro_full_name == 'CentOS' or distro_full_name == 'Red Hat Enterprise Linux Server': ++ if distro_full_name == 'CentOS Linux' or distro_full_name == 'CentOS' or distro_full_name == 'Red Hat Enterprise Linux Server' or distro_full_name == 'AlmaLinux': + return CentOSRDMAHandler(distro_version) + + if distro_full_name == 'Ubuntu': +diff --git a/setup.py b/setup.py +index c258e4b878..8ebdde5e50 100755 +--- a/setup.py ++++ b/setup.py +@@ -97,7 +97,7 @@ def get_data_files(name, version, fullname): # pylint: disable=R0912 + agent_bin_path = osutil.get_agent_bin_path() + + set_bin_files(data_files, dest=agent_bin_path) +- if name == 'redhat' or name == 'centos': # pylint: disable=R1714 ++ if name == 'redhat' or name == 'centos' or name == 'almalinux': # pylint: disable=R1714 + set_conf_files(data_files) + set_logrotate_files(data_files) + set_udev_files(data_files) + +From 74e3b01b6be8014c4da92c30d8ac7464cb2d381e Mon Sep 17 00:00:00 2001 +From: Aleksandr Kravchenko +Date: Fri, 2 Apr 2021 16:06:56 +0300 +Subject: [PATCH 2/3] added test for AlmaLinux + +--- + tests/common/osutil/test_factory.py | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/tests/common/osutil/test_factory.py b/tests/common/osutil/test_factory.py +index f7d46b21a4..4ab234131b 100644 +--- a/tests/common/osutil/test_factory.py ++++ b/tests/common/osutil/test_factory.py +@@ -237,6 +237,13 @@ def test_get_osutil_it_should_return_redhat(self): + self.assertTrue(isinstance(ret, RedhatOSUtil)) + self.assertEqual(ret.get_service_name(), "waagent") + ++ ret = _get_osutil(distro_name="almalinux", ++ distro_code_name="", ++ distro_full_name="", ++ distro_version="8") ++ self.assertTrue(isinstance(ret, RedhatOSUtil)) ++ self.assertEqual(ret.get_service_name(), "waagent") ++ + def test_get_osutil_it_should_return_euleros(self): + ret = _get_osutil(distro_name="euleros", + distro_code_name="", + +From c9eb420d4a6ce69d2c668deef273a446e73fe2d0 Mon Sep 17 00:00:00 2001 +From: Aleksandr Kravchenko +Date: Thu, 20 May 2021 13:48:17 +0300 +Subject: [PATCH 3/3] improved + +--- + azurelinuxagent/pa/rdma/factory.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/azurelinuxagent/pa/rdma/factory.py b/azurelinuxagent/pa/rdma/factory.py +index e19f2fe918..c6d808117b 100644 +--- a/azurelinuxagent/pa/rdma/factory.py ++++ b/azurelinuxagent/pa/rdma/factory.py +@@ -38,7 +38,7 @@ def get_rdma_handler( + ): + return SUSERDMAHandler() + +- if distro_full_name == 'CentOS Linux' or distro_full_name == 'CentOS' or distro_full_name == 'Red Hat Enterprise Linux Server' or distro_full_name == 'AlmaLinux': ++ if distro_full_name in ('CentOS Linux', 'CentOS', 'Red Hat Enterprise Linux Server', 'AlmaLinux'): + return CentOSRDMAHandler(distro_version) + + if distro_full_name == 'Ubuntu': diff --git a/SPECS/WALinuxAgent.spec b/SPECS/WALinuxAgent.spec index 5680643..2b6ff05 100644 --- a/SPECS/WALinuxAgent.spec +++ b/SPECS/WALinuxAgent.spec @@ -3,7 +3,7 @@ Name: WALinuxAgent Version: 2.3.0.2 -Release: 3%{?dist} +Release: 3%{?dist}.alma Summary: The Microsoft Azure Linux Agent License: ASL 2.0 @@ -15,6 +15,9 @@ Source1: module-setup.sh Patch0002: 0002-Fix-distro-resolution-for-RedHat-2083.patch # Source-git patches +# AlmaLinux patches +Patch1000: WALinuxAgent-2.3-almalinux_support.patch + BuildArch: noarch BuildRequires: python3-devel @@ -62,6 +65,7 @@ Udev rules specific to Microsoft Azure Virtual Machines. %setup -q %patch0002 -p1 # Apply source-git patches +%patch1000 -p1 %build %py3_build @@ -122,6 +126,9 @@ install -m0755 -D -t %{buildroot}%{_prefix}/lib/dracut/modules.d/%{dracut_modnam %endif %changelog +* Wed May 18 2022 Eduard Abdullin - 2.3.0.2-3.alma +- Add AlmaLinux support + * Tue Aug 10 2021 Mohan Boddu - 2.3.0.2-3 - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags Related: rhbz#1991688