diff --git a/SOURCES/cloud-init-22.1-tencentos-support.patch b/SOURCES/cloud-init-22.1-opencloudos-support.patch similarity index 62% rename from SOURCES/cloud-init-22.1-tencentos-support.patch rename to SOURCES/cloud-init-22.1-opencloudos-support.patch index 83175443648372824b699ff34070ea7af93e4aa9..425420d3935d630633afffc1c77eeabc9004b073 100644 --- a/SOURCES/cloud-init-22.1-tencentos-support.patch +++ b/SOURCES/cloud-init-22.1-opencloudos-support.patch @@ -1,13 +1,13 @@ From 70d533c33eb47ff80a212c23eef80f779619f548 Mon Sep 17 00:00:00 2001 From: victorzhong Date: Mon, 3 Jul 2023 15:32:54 +0800 -Subject: [PATCH] cloud-init-22.1-tencentos-support +Subject: [PATCH] cloud-init-22.1-opencloudos-support --- Makefile | 3 +++ cloudinit/config/cc_ntp.py | 1 + cloudinit/config/cc_yum_add_repo.py | 3 ++- - cloudinit/config/tencentos.py | 10 ++++++++++ + cloudinit/config/opencloudos.py | 10 ++++++++++ cloudinit/distros/__init__.py | 1 + cloudinit/net/sysconfig.py | 1 + cloudinit/util.py | 1 + @@ -17,7 +17,7 @@ Subject: [PATCH] cloud-init-22.1-tencentos-support tools/read-dependencies | 7 +++++-- tools/render-cloudcfg | 1 + 12 files changed, 30 insertions(+), 8 deletions(-) - create mode 100644 cloudinit/config/tencentos.py + create mode 100644 cloudinit/config/opencloudos.py diff --git a/Makefile b/Makefile index 4ead786..5c33a11 100644 @@ -27,8 +27,8 @@ index 4ead786..5c33a11 100644 ci-deps-centos: @$(PYTHON) $(CWD)/tools/read-dependencies --distro centos --test-distro -+ci-deps-tencentos: -+ @$(PYTHON) $(CWD)/tools/read-dependencies --distro tencentos --test-distro ++ci-deps-opencloudos: ++ @$(PYTHON) $(CWD)/tools/read-dependencies --distro opencloudos --test-distro + pip-requirements: @echo "Installing cloud-init dependencies..." @@ -41,7 +41,7 @@ index 25bba76..3356f17 100644 "photon", "rhel", "rocky", -+ "tencentos", ++ "opencloudos", "sles", "ubuntu", "virtuozzo", @@ -54,7 +54,7 @@ index 7a23268..6959b31 100644 **Supported distros:** almalinux, centos, cloudlinux, eurolinux, fedora, - miraclelinux, openEuler, photon, rhel, rocky, virtuozzo -+ miraclelinux, openEuler, photon, rhel, tencentos, rocky, virtuozzo ++ miraclelinux, openEuler, photon, rhel, opencloudos, rocky, virtuozzo **Config keys**:: @@ -62,15 +62,15 @@ index 7a23268..6959b31 100644 "openEuler", "photon", "rhel", -+ "tencentos", ++ "opencloudos", "rocky", "virtuozzo", ] -diff --git a/cloudinit/config/tencentos.py b/cloudinit/config/tencentos.py +diff --git a/cloudinit/config/opencloudos.py b/cloudinit/config/opencloudos.py new file mode 100644 index 0000000..41728d5 --- /dev/null -+++ b/cloudinit/config/tencentos.py ++++ b/cloudinit/config/opencloudos.py @@ -0,0 +1,10 @@ +# This file is part of cloud-init. See LICENSE file for license information. + @@ -91,7 +91,7 @@ index 76acd6a..ea73a36 100755 "openEuler", "photon", "rhel", -+ "tencentos", ++ "opencloudos", "rocky", "virtuozzo", ], @@ -103,7 +103,7 @@ index 362e8d1..97927b6 100644 "openEuler", "rhel", "rocky", -+ "tencentos", ++ "opencloudos", "suse", "virtuozzo", ] @@ -115,7 +115,7 @@ index 569fc21..1999035 100644 "openeuler", "photon", "rhel", -+ "tencentos", ++ "opencloudos", "rocky", "suse", "virtuozzo", @@ -128,7 +128,7 @@ index 08b6efb..1608da1 100644 {% if variant in ["almalinux", "alpine", "amazon", "cloudlinux", "eurolinux", - "fedora", "miraclelinux", "openEuler", "openmandriva", "rocky", "virtuozzo"] or is_rhel %} -+ "fedora", "miraclelinux", "openEuler", "openmandriva", "tencentos", "rocky", "virtuozzo"] or is_rhel %} ++ "fedora", "miraclelinux", "openEuler", "openmandriva", "opencloudos", "rocky", "virtuozzo"] or is_rhel %} {% if is_rhel %} mount_default_fields: [~, ~, 'auto', 'defaults,nofail,x-systemd.requires=cloud-init.service,_netdev', '0', '2'] {% else %} @@ -137,7 +137,7 @@ index 08b6efb..1608da1 100644 {% if variant in ["almalinux", "alpine", "amazon", "arch", "cloudlinux", "debian", "eurolinux", "fedora", "freebsd", "gentoo", "netbsd", "miraclelinux", "openbsd", "openEuler", - "openmandriva", "photon", "rocky", "suse", "ubuntu", "virtuozzo"] or is_rhel %} -+ "openmandriva", "photon", "tencentos", "rocky", "suse", "ubuntu", "virtuozzo"] or is_rhel %} ++ "openmandriva", "photon", "opencloudos", "rocky", "suse", "ubuntu", "virtuozzo"] or is_rhel %} distro: {{ variant }} {% elif variant in ["dragonfly"] %} distro: dragonflybsd @@ -146,7 +146,7 @@ index 08b6efb..1608da1 100644 ssh_svcname: ssh {% elif variant in ["almalinux", "alpine", "amazon", "arch", "cloudlinux", "eurolinux", - "fedora", "gentoo", "miraclelinux", "openEuler", "openmandriva", "rocky", "suse", "virtuozzo"] or is_rhel %} -+ "fedora", "gentoo", "miraclelinux", "openEuler", "openmandriva", "tencentos", "rocky", "suse", "virtuozzo"] or is_rhel %} ++ "fedora", "gentoo", "miraclelinux", "openEuler", "openmandriva", "opencloudos", "rocky", "suse", "virtuozzo"] or is_rhel %} # Default user name + that default users groups (if added/used) default_user: {% if variant == "amazon" %} @@ -159,7 +159,7 @@ index 74d4742..585233a 100644 local ds_rc="" {% if variant in ["almalinux", "centos", "cloudlinux", "eurolinux", "fedora", - "miraclelinux", "openEuler", "rhel", "rocky", "virtuozzo"] %} -+ "miraclelinux", "openEuler", "rhel", "tencentos", "rocky", "virtuozzo"] %} ++ "miraclelinux", "openEuler", "rhel", "opencloudos", "rocky", "virtuozzo"] %} local dsidentify="/usr/libexec/cloud-init/ds-identify" {% else %} local dsidentify="/usr/lib/cloud-init/ds-identify" @@ -172,7 +172,7 @@ index fc984d5..d29a109 100644 {% endif %} {% if variant in ["almalinux", "centos", "cloudlinux", "eurolinux", "fedora", - "miraclelinux", "openEuler", "rhel", "rocky", "virtuozzo"] %} -+ "miraclelinux", "openEuler", "rhel", "tencentos", "rocky", "virtuozzo"] %} ++ "miraclelinux", "openEuler", "rhel", "opencloudos", "rocky", "virtuozzo"] %} After=network.service After=NetworkManager.service After=NetworkManager-wait-online.service @@ -184,7 +184,7 @@ index 6ef72a9..7309023 100755 'centos': 'redhat', 'eurolinux': 'redhat', 'miraclelinux': 'redhat', -+ 'tencentos': 'redhat', ++ 'opencloudos': 'redhat', 'rocky': 'redhat', 'redhat': 'redhat', 'debian': 'debian', @@ -192,7 +192,7 @@ index 6ef72a9..7309023 100755 DRY_DISTRO_INSTALL_PKG_CMD = { 'rocky': ['yum', 'install', '--assumeyes'], -+ 'tencentos': ['yum', 'install', '--assumeyes'], ++ 'opencloudos': ['yum', 'install', '--assumeyes'], 'centos': ['yum', 'install', '--assumeyes'], 'eurolinux': ['yum', 'install', '--assumeyes'], 'miraclelinux': ['yum', 'install', '--assumeyes'], @@ -200,7 +200,7 @@ index 6ef72a9..7309023 100755 DISTRO_INSTALL_PKG_CMD = { 'rocky': MAYBE_RELIABLE_YUM_INSTALL, -+ 'tencentos': MAYBE_RELIABLE_YUM_INSTALL, ++ 'opencloudos': MAYBE_RELIABLE_YUM_INSTALL, 'eurolinux': MAYBE_RELIABLE_YUM_INSTALL, 'miraclelinux': MAYBE_RELIABLE_YUM_INSTALL, 'centos': MAYBE_RELIABLE_YUM_INSTALL, @@ -209,11 +209,11 @@ index 6ef72a9..7309023 100755 install_cmd.extend(cmd) - if distro in ['centos', 'redhat', 'rocky', 'eurolinux']: -+ if distro in ['centos', 'redhat', 'tencentos', 'rocky', 'eurolinux']: ++ if distro in ['centos', 'redhat', 'opencloudos', 'rocky', 'eurolinux']: # CentOS and Redhat need epel-release to access oauthlib and jsonschema subprocess.check_call(install_cmd + ['epel-release']) - if distro in ['suse', 'opensuse', 'redhat', 'rocky', 'centos', 'eurolinux']: -+ if distro in ['suse', 'opensuse', 'redhat', 'tencentos', 'rocky', 'centos', 'eurolinux']: ++ if distro in ['suse', 'opensuse', 'redhat', 'opencloudos', 'rocky', 'centos', 'eurolinux']: pkg_list.append('rpm-build') subprocess.check_call(install_cmd + pkg_list) @@ -225,10 +225,110 @@ index afe999e..0fd494d 100755 "photon", "rhel", "suse", -+ "tencentos", ++ "opencloudos", "rocky", "ubuntu", "unknown", + +diff --git a/templates/chrony.conf.opencloudos.tmpl b/templates/chrony.conf.opencloudos.tmpl +new file mode 100644 +index 00000000..5b3542ef +--- /dev/null ++++ b/templates/chrony.conf.opencloudos.tmpl +@@ -0,0 +1,45 @@ ++## template:jinja ++# Use public servers from the pool.ntp.org project. ++# Please consider joining the pool (http://www.pool.ntp.org/join.html). ++{% if pools %}# pools ++{% endif %} ++{% for pool in pools -%} ++pool {{pool}} iburst ++{% endfor %} ++{%- if servers %}# servers ++{% endif %} ++{% for server in servers -%} ++server {{server}} iburst ++{% endfor %} ++ ++# Record the rate at which the system clock gains/losses time. ++driftfile /var/lib/chrony/drift ++ ++# Allow the system clock to be stepped in the first three updates ++# if its offset is larger than 1 second. ++makestep 1.0 3 ++ ++# Enable kernel synchronization of the real-time clock (RTC). ++rtcsync ++ ++# Enable hardware timestamping on all interfaces that support it. ++#hwtimestamp * ++ ++# Increase the minimum number of selectable sources required to adjust ++# the system clock. ++#minsources 2 ++ ++# Allow NTP client access from local network. ++#allow 192.168.0.0/16 ++ ++# Serve time even if not synchronized to a time source. ++#local stratum 10 ++ ++# Specify file containing keys for NTP authentication. ++#keyfile /etc/chrony.keys ++ ++# Specify directory for log files. ++logdir /var/log/chrony ++ ++# Select which information is logged. ++#log measurements statistics tracking +diff --git a/templates/hosts.opencloudos.tmpl b/templates/hosts.opencloudos.tmpl +new file mode 100644 +index 00000000..bc5da32c +--- /dev/null ++++ b/templates/hosts.opencloudos.tmpl +@@ -0,0 +1,24 @@ ++## template:jinja ++{# ++This file /etc/cloud/templates/hosts.redhat.tmpl is only utilized ++if enabled in cloud-config. Specifically, in order to enable it ++you need to add the following to config: ++ manage_etc_hosts: True ++-#} ++# Your system has configured 'manage_etc_hosts' as True. ++# As a result, if you wish for changes to this file to persist ++# then you will need to either ++# a.) make changes to the master file in /etc/cloud/templates/hosts.redhat.tmpl ++# b.) change or remove the value of 'manage_etc_hosts' in ++# /etc/cloud/cloud.cfg or cloud-config from user-data ++# ++# The following lines are desirable for IPv4 capable hosts ++127.0.0.1 {{fqdn}} {{hostname}} ++127.0.0.1 localhost.localdomain localhost ++127.0.0.1 localhost4.localdomain4 localhost4 ++ ++# The following lines are desirable for IPv6 capable hosts ++::1 {{fqdn}} {{hostname}} ++::1 localhost.localdomain localhost ++::1 localhost6.localdomain6 localhost6 ++ + +--- a/cloudinit/config/cc_ntp.py 2023-04-21 05:31:09.000000000 +0800 ++++ b/cloudinit/config/cc_ntp.py 2023-07-03 09:39:55.445000000 +0800 +@@ -185,6 +185,14 @@ + "check_exe": "/usr/lib/systemd/systemd-timesyncd", + }, + }, ++ "opencloudos": { ++ "ntp": { ++ "service_name": "ntpd", ++ }, ++ "chrony": { ++ "service_name": "chronyd", ++ }, ++ }, + "photon": { + "chrony": { + "service_name": "chronyd", -- 2.31.1 diff --git a/SPECS/cloud-init.spec b/SPECS/cloud-init.spec index 116e4320f33cc8633f6d25077456efe85cf7df71..f40745f31647f70f96e3df0ed967eccebc1feb3e 100644 --- a/SPECS/cloud-init.spec +++ b/SPECS/cloud-init.spec @@ -6,7 +6,7 @@ Name: cloud-init Version: 22.1 -Release: 8%{?dist}.1 +Release: 8%{?dist}.2 Summary: Cloud instance init scripts Group: System Environment/Base @@ -53,7 +53,7 @@ Patch16: ci-Ensure-network-ready-before-cloud-init-service-runs-.patch # For bz#2162258 - systemd[1]: Failed to start Initial cloud-init job after reboot system via sysrq 'b' [RHEL-8] Patch17: ci-cc_set_hostname-ignore-var-lib-cloud-data-set-hostna.patch # For TencentOS -Patch3000: cloud-init-22.1-tencentos-support.patch +Patch3000: cloud-init-22.1-opencloudos-support.patch BuildArch: noarch @@ -146,7 +146,7 @@ mv $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/hook-network-manager \ $RPM_BUILD_ROOT/etc/NetworkManager/dispatcher.d/cloud-init-azure-hook [ ! -d $RPM_BUILD_ROOT/usr/lib/systemd/system-generators ] && mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system-generators -python3 tools/render-cloudcfg --variant rhel systemd/cloud-init-generator.tmpl > $RPM_BUILD_ROOT/usr/lib/systemd/system-generators/cloud-init-generator +python3 tools/render-cloudcfg --variant opencloudos systemd/cloud-init-generator.tmpl > $RPM_BUILD_ROOT/usr/lib/systemd/system-generators/cloud-init-generator chmod 755 $RPM_BUILD_ROOT/usr/lib/systemd/system-generators/cloud-init-generator # installing man pages @@ -239,7 +239,10 @@ fi %config(noreplace) %{_sysconfdir}/rsyslog.d/21-cloudinit.conf %changelog -* Mon Jun 20 2023 Xin Cheng - 22.1-8.tl3.1 +* Fri Jul 7 2023 Feng Weiyao - 22.1-8.tl3.2 +- add opencloudos support + +* Mon Jun 19 2023 Xin Cheng - 22.1-8.tl3.1 - add TencentOS support * Mon Jan 30 2023 Camilla Conte - 22.1-8