From 86f0d905290602a64dd78c2760b2ab2ba09e69e3 Mon Sep 17 00:00:00 2001 From: doupengda Date: Thu, 8 Jun 2023 15:24:06 +0800 Subject: [PATCH] Add support for Loonnix server, Euler, and Anolis systems --- ...Loonnix-server-Euler-and-Anolis-syst.patch | 38 +++++++++++++++++++ cloud-init.spec | 6 ++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 0001-Add-support-for-Loonnix-server-Euler-and-Anolis-syst.patch diff --git a/0001-Add-support-for-Loonnix-server-Euler-and-Anolis-syst.patch b/0001-Add-support-for-Loonnix-server-Euler-and-Anolis-syst.patch new file mode 100644 index 0000000..5d04202 --- /dev/null +++ b/0001-Add-support-for-Loonnix-server-Euler-and-Anolis-syst.patch @@ -0,0 +1,38 @@ +From c094ac08cf6366089b0063e2b74f2f9d664ce37a Mon Sep 17 00:00:00 2001 +From: doupengda +Date: Thu, 8 Jun 2023 15:19:01 +0800 +Subject: [PATCH] Add support for Loonnix server, Euler, and Anolis systems + +--- + cloudinit/util.py | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/cloudinit/util.py b/cloudinit/util.py +index 2639478..7f2c7bb 100644 +--- a/cloudinit/util.py ++++ b/cloudinit/util.py +@@ -536,7 +536,7 @@ def get_linux_distro(): + os_release_rhel = True + os_release = _parse_redhat_release() + if os_release: +- distro_name = os_release.get("ID", "") ++ distro_name = os_release.get("ID", "").lower() + distro_version = os_release.get("VERSION_ID", "") + if "sles" in distro_name or "suse" in distro_name: + # RELEASE_BLOCKER: We will drop this sles divergent behavior in +@@ -560,6 +560,12 @@ def get_linux_distro(): + flavor = match.groupdict()["codename"] + if distro_name == "rhel": + distro_name = "redhat" ++ elif distro_name == 'loongnix-server': ++ distro_name = 'redhat' ++ elif distro_name == 'openeuler' or distro_name == 'euler': ++ distro_name = 'redhat' ++ elif distro_name == 'anolis' or distro_name == 'openanolis': ++ distro_name = 'redhat' + elif is_BSD(): + distro_name = platform.system().lower() + distro_version = platform.release() +-- +2.33.0 + diff --git a/cloud-init.spec b/cloud-init.spec index baa2959..45cd35f 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,6 +1,6 @@ Name: cloud-init Version: 22.2 -Release: 10 +Release: 11 Summary: the defacto multi-distribution package that handles early initialization of a cloud instance. License: ASL 2.0 or GPLv3 URL: http://launchpad.net/cloud-init @@ -20,6 +20,7 @@ Patch8: backport-Cleanup-ephemeral-IP-routes-on-exception.patch Patch9: backport-CVE-2023-1786.patch Patch9000: fix-permission-of-the-private-key.patch +Patch9001: 0001-Add-support-for-Loonnix-server-Euler-and-Anolis-syst.patch BuildRequires: pkgconfig(systemd) python3-devel python3-setuptools systemd BuildRequires: iproute python3-configobj python3-httpretty >= 0.8.14-2 @@ -134,6 +135,9 @@ fi %exclude /usr/share/doc/* %changelog +* Thu Jun 8 2023 doupengda - 22.2-11 +- Add support for Loongnix server, Euler, and Anolis systems + * Wed May 24 2023 shixuantong - 22.2-10 - Type:CVE - ID:CVE-2023-1786 -- Gitee