Skip to content

Add Kylin Linux support as a RHEL-based distro - #7096

Open
debianyu wants to merge 1 commit into
canonical:mainfrom
debianyu:kylin-support
Open

debianyu wants to merge 1 commit into
canonical:mainfrom
debianyu:kylin-support

Conversation

@debianyu

Copy link
Copy Markdown

What this does

Adds Kylin Linux Advanced Server as a recognized distro in cloud-init,
following the pattern established by openeuler, OpenCloudOS and
TencentOS.

Kylin is a RHEL-based Linux distribution that uses DNF/yum package
management, NetworkManager for networking, and systemd for service
management — the same tooling as other RHEL-family distros already
supported by cloud-init.

Scope

  • 11 modified files + 1 new file (cloudinit/distros/kylin.py), 44 insertions, 9 deletions
  • The new distro class inherits from rhel.Distro and sets osfamily = "kylin"
  • Added to the is_rhel template set, gecos dict ("kylin": "Cloud User"),
    and usernames dict ("kylin": "cloud-user") in cloud.cfg.tmpl. Groups
    and shells use existing is_rhel / default fallbacks.
  • Registered in all config modules that RHEL-family distros use:
    cc_ntp, cc_resolv_conf, cc_yum_add_repo, cc_spacewalk
  • Added to networking (sysconfig) and systemd template lists
  • Includes unit test coverage (os-release parsing and variant mapping)

Testing

  • Patch applies cleanly to current main (HEAD)
  • 12 files, +44/-9 changes
  • Unit test coverage:
    • OS_RELEASE_KYLIN test data added for os-release parsing
    • test_get_linux_kylin verifies correct distro name extraction
    • TestGetVariant entry added for kylin variant mapping
  • TODO: verify on a Kylin Linux host or VM
  • TODO: run cloud-init test suite (tox -e py3)

@debianyu

Copy link
Copy Markdown
Author

Hi maintainers, gentle ping on this PR. CI is all green. Would appreciate a review when you have time.
Thanks!

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close.

If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging blackboxsw, and he will ensure that someone takes a look soon.

(If the pull request is closed and you would like to continue working on it, please do tag blackboxsw to reopen it.)

@github-actions github-actions Bot added the stale-pr Pull request is stale; will be auto-closed soon label Oct 9, 2026
@debianyu

debianyu commented Oct 9, 2026

Copy link
Copy Markdown
Author

@blackboxsw, this PR is still relevant — CI is all green and ready for review. Could you please take a look when you have time? Thanks!

@nryanl nryanl removed the stale-pr Pull request is stale; will be auto-closed soon label Oct 9, 2026

@nryanl nryanl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @debianyu !

A few things:

  1. Since you are a first time contributor, could you start by signing the CLA?

  2. If you have cloud-init logs from kylin, could you attach those to your submission?

  3. Don't forget to add kylin to the list of supported distros in our documentation. You can find that list in doc/rtd/reference/availability.rst.

  4. I left a comment regarding a minor formatting issue.

Comment thread cloudinit/distros/kylin.py Outdated
class Distro(rhel.Distro):
def __init__(self, name, cfg, paths):
super(Distro, self).__init__(name, cfg, paths)
self.osfamily = "kylin" No newline at end of file

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a newline at the end of this file. tox -e do_format should catch this.

Kylin Linux Advanced Server is a RHEL-based distribution that
uses the same DNF/yum package management, NetworkManager, and
systemd tooling as other RHEL-family distributions. This adds
it as a recognized distro following the pattern of openeuler,
OpenCloudOS and TencentOS.

Signed-off-by: YuPeng <yupeng@kylinos.cn>
@github-actions github-actions Bot added the documentation This Pull Request changes documentation label Oct 10, 2026
@debianyu

debianyu commented Oct 10, 2026 •

Copy link
Copy Markdown
Author

@nryanl Thanks for the review! All items addressed:

  1. CLA signed.
  2. Kylin cloud-init logs and os-release attached below.
  3. Added Kylin to doc/rtd/reference/availability.rst.
  4. Fixed trailing newline in kylin.py.

os-release:

NAME="Kylin Linux Advanced Server"
VERSION="V10 (Tercel)"
ID="kylin"
VERSION_ID="V10"
PRETTY_NAME="Kylin Linux Advanced Server V10 (Tercel)"
ANSI_COLOR="0;31"

tail -50 /var/log/cloud-init.log

2026-10-10 06:59:22,557 - handlers.py[DEBUG]: finish: init-local/search-SmartOS: SUCCESS: no local data found from DataSourceSmartOS
2026-10-10 06:59:22,557 - main.py[DEBUG]: No local datasource found
2026-10-10 06:59:22,558 - util.py[DEBUG]: Reading from /sys/class/net/ens3/carrier (quiet=False)
2026-10-10 06:59:22,558 - util.py[DEBUG]: Read 2 bytes from /sys/class/net/ens3/carrier
2026-10-10 06:59:22,558 - util.py[DEBUG]: Reading from /sys/class/net/ens3/address (quiet=False)
2026-10-10 06:59:22,558 - util.py[DEBUG]: Read 18 bytes from /sys/class/net/ens3/address
2026-10-10 06:59:22,558 - util.py[DEBUG]: Reading from /sys/class/net/ens3/address (quiet=False)
2026-10-10 06:59:22,558 - util.py[DEBUG]: Read 18 bytes from /sys/class/net/ens3/address
2026-10-10 06:59:22,558 - stages.py[DEBUG]: applying net config names for {'config': [{'type': 'physical', 'name': 'ens3', 'mac_address': '52:54:00:33:92:df', 'subnets': [{'type': 'dhcp'}]}], 'version': 1}
2026-10-10 06:59:22,558 - util.py[DEBUG]: Reading from /sys/class/net/ens3/device/device (quiet=False)
2026-10-10 06:59:22,558 - util.py[DEBUG]: Read 7 bytes from /sys/class/net/ens3/device/device
2026-10-10 06:59:22,558 - util.py[DEBUG]: Reading from /sys/class/net/docker0/addr_assign_type (quiet=False)
2026-10-10 06:59:22,558 - util.py[DEBUG]: Read 2 bytes from /sys/class/net/docker0/addr_assign_type
2026-10-10 06:59:22,558 - util.py[DEBUG]: Reading from /sys/class/net/lo/addr_assign_type (quiet=False)
2026-10-10 06:59:22,558 - util.py[DEBUG]: Read 2 bytes from /sys/class/net/lo/addr_assign_type
2026-10-10 06:59:22,558 - util.py[DEBUG]: Reading from /sys/class/net/lo/uevent (quiet=False)
2026-10-10 06:59:22,558 - util.py[DEBUG]: Read 23 bytes from /sys/class/net/lo/uevent
2026-10-10 06:59:22,558 - util.py[DEBUG]: Reading from /sys/class/net/lo/address (quiet=False)
2026-10-10 06:59:22,558 - util.py[DEBUG]: Read 18 bytes from /sys/class/net/lo/address
2026-10-10 06:59:22,558 - util.py[DEBUG]: Reading from /sys/class/net/lo/device/device (quiet=False)
2026-10-10 06:59:22,558 - util.py[DEBUG]: Reading from /sys/class/net/ens3/addr_assign_type (quiet=False)
2026-10-10 06:59:22,558 - util.py[DEBUG]: Read 2 bytes from /sys/class/net/ens3/addr_assign_type
2026-10-10 06:59:22,558 - util.py[DEBUG]: Reading from /sys/class/net/ens3/uevent (quiet=False)
2026-10-10 06:59:22,558 - util.py[DEBUG]: Read 25 bytes from /sys/class/net/ens3/uevent
2026-10-10 06:59:22,559 - util.py[DEBUG]: Reading from /sys/class/net/ens3/address (quiet=False)
2026-10-10 06:59:22,559 - util.py[DEBUG]: Read 18 bytes from /sys/class/net/ens3/address
2026-10-10 06:59:22,559 - util.py[DEBUG]: Reading from /sys/class/net/ens3/device/device (quiet=False)
2026-10-10 06:59:22,559 - util.py[DEBUG]: Read 7 bytes from /sys/class/net/ens3/device/device
2026-10-10 06:59:22,559 - util.py[DEBUG]: Reading from /sys/class/net/lo/operstate (quiet=False)
2026-10-10 06:59:22,559 - util.py[DEBUG]: Read 8 bytes from /sys/class/net/lo/operstate
2026-10-10 06:59:22,559 - util.py[DEBUG]: Reading from /sys/class/net/ens3/operstate (quiet=False)
2026-10-10 06:59:22,559 - util.py[DEBUG]: Read 3 bytes from /sys/class/net/ens3/operstate
2026-10-10 06:59:22,559 - util.py[DEBUG]: Running command ['ip', '-6', 'addr', 'show', 'permanent', 'scope', 'global'] with allowed return codes [0] (shell=False, capture=True)
2026-10-10 06:59:22,561 - util.py[DEBUG]: Running command ['ip', '-4', 'addr', 'show'] with allowed return codes [0] (shell=False, capture=True)
2026-10-10 06:59:22,564 - __init__.py[DEBUG]: no work necessary for renaming of [['52:54:00:33:92:df', 'ens3', 'e1000', '0x100e']]
2026-10-10 06:59:22,564 - stages.py[INFO]: Applying network configuration from fallback bringup=False: {'config': [{'type': 'physical', 'name': 'ens3', 'mac_address': '52:54:00:33:92:df', 'subnets': [{'type': 'dhcp'}]}], 'version': 1}
2026-10-10 06:59:22,564 - __init__.py[DEBUG]: Selected renderer 'sysconfig' from priority list: None
2026-10-10 06:59:22,566 - util.py[DEBUG]: Writing to /etc/sysconfig/network-scripts/ifcfg-ens3 - wb: [644] 159 bytes
2026-10-10 06:59:22,567 - util.py[DEBUG]: Reading from /etc/resolv.conf (quiet=False)
2026-10-10 06:59:22,567 - util.py[DEBUG]: Read 292 bytes from /etc/resolv.conf
2026-10-10 06:59:22,567 - util.py[DEBUG]: Writing to /etc/resolv.conf - wb: [644] 363 bytes
2026-10-10 06:59:22,567 - util.py[DEBUG]: Writing to /etc/udev/rules.d/70-persistent-net.rules - wb: [644] 96 bytes
2026-10-10 06:59:22,567 - util.py[DEBUG]: Reading from /etc/sysconfig/network (quiet=True)
2026-10-10 06:59:22,567 - util.py[DEBUG]: Read 22 bytes from /etc/sysconfig/network
2026-10-10 06:59:22,567 - util.py[DEBUG]: Writing to /etc/sysconfig/network - wb: [644] 109 bytes
2026-10-10 06:59:22,568 - main.py[DEBUG]: [local] Exiting without datasource in local mode
2026-10-10 06:59:22,568 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2026-10-10 06:59:22,568 - util.py[DEBUG]: Read 23 bytes from /proc/uptime
2026-10-10 06:59:22,568 - util.py[DEBUG]: cloud-init mode 'init' took 0.196 seconds (0.19)
2026-10-10 06:59:22,568 - handlers.py[DEBUG]: finish: init-local: SUCCESS: searching for local datasources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation This Pull Request changes documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants