add Kylin policy
This commit is contained in:
parent
2d42e9ba1b
commit
d47d7f55da
53
add-Kylin-OS-support.patch
Normal file
53
add-Kylin-OS-support.patch
Normal file
@ -0,0 +1,53 @@
|
||||
From 143db4a9516bd0e1c4c4b1e8a7aa91c04ee1699e Mon Sep 17 00:00:00 2001
|
||||
From: jxy_git <jiangxinyu@kylinos.cn>
|
||||
Date: Mon, 6 Nov 2023 17:31:38 +0800
|
||||
Subject: [PATCH] add Kylin OS support
|
||||
|
||||
---
|
||||
sos/policies/Kylin.py | 34 ++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 34 insertions(+)
|
||||
create mode 100644 sos/policies/Kylin.py
|
||||
|
||||
diff --git a/sos/policies/Kylin.py b/sos/policies/Kylin.py
|
||||
new file mode 100644
|
||||
index 0000000..dbbb229
|
||||
--- /dev/null
|
||||
+++ b/sos/policies/Kylin.py
|
||||
@@ -0,0 +1,34 @@
|
||||
+from sos.policies.redhat import RedHatPolicy, OS_RELEASE
|
||||
+import os
|
||||
+
|
||||
+class KylinPolicy(RedHatPolicy):
|
||||
+
|
||||
+ distro = "Kylin Linux Advanced Server"
|
||||
+ vendor = "Kylin"
|
||||
+ vendor_urls = [
|
||||
+ ('Distribution Website', 'https://www.kylinos.cn/'),
|
||||
+ ('Vendor Website', 'https://www.kylinos.cn/')
|
||||
+ ]
|
||||
+
|
||||
+ def __init__(self, sysroot=None, init=None, probe_runtime=True,
|
||||
+ remote_exec=None):
|
||||
+ super(KylinPolicy, self).__init__(sysroot=sysroot, init=init,
|
||||
+ probe_runtime=probe_runtime,
|
||||
+ remote_exec=remote_exec)
|
||||
+
|
||||
+ @classmethod
|
||||
+ def check(cls, remote=''):
|
||||
+
|
||||
+ if remote:
|
||||
+ return cls.distro in remote
|
||||
+
|
||||
+ if not os.path.exists(OS_RELEASE):
|
||||
+ return False
|
||||
+
|
||||
+ with open(OS_RELEASE, 'r') as f:
|
||||
+ for line in f:
|
||||
+ if line.startswith('NAME'):
|
||||
+ if 'Kylin Linux' in line:
|
||||
+ return True
|
||||
+ return False
|
||||
+
|
||||
--
|
||||
2.33.0
|
||||
|
||||
6
sos.spec
6
sos.spec
@ -2,7 +2,7 @@
|
||||
|
||||
Name: sos
|
||||
Version: 4.5.6
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: A set of tools to gather troubleshooting information from a system
|
||||
License: GPLv2+
|
||||
URL: https://github.com/sosreport/sos
|
||||
@ -12,6 +12,7 @@ Patch9000: openEuler-add-openEuler-policy.patch
|
||||
Patch9001: add-uniontech-os-support.patch
|
||||
Patch9002: Fix-sos-command-failed-in-sos-4.0.patch
|
||||
Patch9003: add-KylinSec-OS-support.patch
|
||||
Patch9004: add-Kylin-OS-support.patch
|
||||
|
||||
BuildRequires: python3-devel gettext
|
||||
Requires: bzip2 xz python3-rpm tar python3-pexpect
|
||||
@ -66,6 +67,9 @@ rm -rf ${RPM_BUILD_ROOT}/usr/config/
|
||||
%{_mandir}/man5/*
|
||||
|
||||
%changelog
|
||||
* Mon Nov 06 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 4.5.6-2
|
||||
- add Kylin policy
|
||||
|
||||
* Thu Jul 27 2023 dillon chen < dillon.chen@gmail.com> - 4.5.6-1
|
||||
- update to 4.5.6
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user