Repository navigation
Expand file tree
/
Copy path002-add-anolis.patch
More file actions
84 lines (80 loc) · 2.25 KB
/
Copy path002-add-anolis.patch
File metadata and controls
84 lines (80 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
From a5fec2b01a76ae3ba33704f9f8037c332bd30966 Mon Sep 17 00:00:00 2001
From: jiangcuo <jiangcuo@bingsin.com>
Date: Thu, 5 Dec 2024 12:17:37 +0800
Subject: [PATCH] add anolis
---
src/PVE/LXC/Setup.pm | 2 ++
src/PVE/LXC/Setup/Anolis.pm | 34 ++++++++++++++++++++++++++++++++++
src/PVE/LXC/Setup/Makefile | 1 +
3 files changed, 37 insertions(+)
create mode 100644 src/PVE/LXC/Setup/Anolis.pm
diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm
index 78272be..98398f8 100644
--- a/src/PVE/LXC/Setup.pm
+++ b/src/PVE/LXC/Setup.pm
@@ -10,6 +10,7 @@ use PVE::Tools;
use PVE::LXC::Setup::Alpine;
use PVE::LXC::Setup::ArchLinux;
+use PVE::LXC::Setup::Anolis;
use PVE::LXC::Setup::CentOS;
use PVE::LXC::Setup::Debian;
use PVE::LXC::Setup::Devuan;
@@ -24,6 +25,7 @@ use PVE::LXC::Setup::Unmanaged;
my $plugins = {
alpine => 'PVE::LXC::Setup::Alpine',
archlinux => 'PVE::LXC::Setup::ArchLinux',
+ anolis => 'PVE::LXC::Setup::Anolis',
centos => 'PVE::LXC::Setup::CentOS',
debian => 'PVE::LXC::Setup::Debian',
devuan => 'PVE::LXC::Setup::Devuan',
diff --git a/src/PVE/LXC/Setup/Anolis.pm b/src/PVE/LXC/Setup/Anolis.pm
new file mode 100644
index 0000000..7c482b5
--- /dev/null
+++ b/src/PVE/LXC/Setup/Anolis.pm
@@ -0,0 +1,34 @@
+package PVE::LXC::Setup::Anolis;
+
+use strict;
+use warnings;
+
+use PVE::LXC::Setup::CentOS;
+use base qw(PVE::LXC::Setup::CentOS);
+
+sub new {
+ my ($class, $conf, $rootdir, $os_release) = @_;
+
+ my $version = $os_release->{VERSION_ID};
+
+ my $self = { conf => $conf, rootdir => $rootdir, version => $version };
+
+ $conf->{ostype} = "anolis";
+
+ return bless $self, $class;
+}
+
+sub template_fixup {
+ my ($self, $conf) = @_;
+
+ $self->remove_lxc_name_from_etc_hosts();
+ $self->setup_systemd_disable_static_units(['dev-mqueue.mount']);
+}
+
+sub setup_init {
+ my ($self, $conf) = @_;
+ $self->setup_container_getty_service($conf);
+ $self->setup_systemd_preset();
+}
+
+1;
diff --git a/src/PVE/LXC/Setup/Makefile b/src/PVE/LXC/Setup/Makefile
index 688b547..9ff3de9 100644
--- a/src/PVE/LXC/Setup/Makefile
+++ b/src/PVE/LXC/Setup/Makefile
@@ -13,6 +13,7 @@ SOURCES=\
NixOS.pm \
OpenEuler.pm \
Unmanaged.pm \
+ Anolis.pm \
.PHONY: install
install: