From b6804462b586a210a700222bd86d41b4a89c8ac1 Mon Sep 17 00:00:00 2001 From: doupengda Date: Thu, 8 Jun 2023 15:55:36 +0800 Subject: [PATCH] Add support for Loonnix server, Euler, and Anolis systems --- ...Loonnix-server-Euler-and-Anolis-syst.patch | 38 +++++++++++++++++++ cloud-init.spec | 7 +++- 2 files changed, 44 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..409a82c --- /dev/null +++ b/0001-Add-support-for-Loonnix-server-Euler-and-Anolis-syst.patch @@ -0,0 +1,38 @@ +From 5d06c0df5d36f6a22c0ab684ef6580b4a86631eb Mon Sep 17 00:00:00 2001 +From: doupengda +Date: Thu, 8 Jun 2023 07:47:16 +0000 +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 ea44a6e..0e9c822 100644 +--- a/cloudinit/util.py ++++ b/cloudinit/util.py +@@ -606,7 +606,7 @@ def get_linux_distro(): + if not os_release: + 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 +@@ -625,6 +625,12 @@ def get_linux_distro(): + distro_name = 'redhat' + if distro_name == "alinux": + distro_name = "aliyun" ++ 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' + else: + dist = ('', '', '') + try: +-- +2.27.0 + diff --git a/cloud-init.spec b/cloud-init.spec index 936b1fc..f8168b3 100644 --- a/cloud-init.spec +++ b/cloud-init.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} @@ -27,6 +27,7 @@ URL: http://launchpad.net/cloud-init Source0: cloud-init-19.1.17.tgz Patch0: Enable-ipv6-network-by-default.patch +Patch1: 0001-Add-support-for-Loonnix-server-Euler-and-Anolis-syst.patch BuildArch: noarch BuildRoot: %{_tmppath} @@ -118,6 +119,7 @@ ssh keys and to let the user run various scripts. %prep %setup -q -n cloud-init-19.1.17 %patch0 -p1 +%patch1 -p1 # Custom patches activation @@ -251,6 +253,9 @@ fi %{python_sitelib}/* %changelog +* Thu Jun 8 2023 doupengda - 19.1.17-1.0.2 +- Add support for Loongnix server, Euler, and Anolis systems + * Tue Jun 28 2022 Chang Gao - 19.1.17-1.0.1 - Reversion to 19.1.17 - cancel disable network config -- Gitee