Skip to content

Commit db26316

Browse files
committed
bump pve-container to 5.2.2+port1
1 parent 6997d58 commit db26316

5 files changed

Lines changed: 155 additions & 9 deletions

File tree

‎packages/pve-container/patches/001-add-loongarch-support.patch‎

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1+
From 6c3157c3324c5e47cb0a8c3df0aaa59b753a2f2f Mon Sep 17 00:00:00 2001
2+
From: jiangcuo <jiangcuo@bingsin.com>
3+
Date: Thu, 5 Dec 2024 11:31:29 +0800
4+
Subject: [PATCH] Add loongarch support
5+
6+
---
7+
src/PVE/LXC/Config.pm | 2 +-
8+
src/PVE/LXC/Setup.pm | 11 ----------
9+
src/PVE/LXC/Setup/Plugin.pm | 44 ++++++++++++++++++++++++++++++++++++-
10+
src/PVE/LXC/Tools.pm | 1 +
11+
4 files changed, 45 insertions(+), 13 deletions(-)
12+
113
diff --git a/src/PVE/LXC/Config.pm b/src/PVE/LXC/Config.pm
2-
index 1664a35..73f60f0 100644
14+
index 5cc37f7..0452d4a 100644
315
--- a/src/PVE/LXC/Config.pm
416
+++ b/src/PVE/LXC/Config.pm
517
@@ -473,7 +473,7 @@ my $confdesc = {
@@ -12,10 +24,10 @@ index 1664a35..73f60f0 100644
1224
default => 'amd64',
1325
},
1426
diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm
15-
index 5c9114c..cae55b1 100644
27+
index dc58990..78272be 100644
1628
--- a/src/PVE/LXC/Setup.pm
1729
+++ b/src/PVE/LXC/Setup.pm
18-
@@ -135,17 +135,6 @@ sub new {
30+
@@ -141,17 +141,6 @@ sub new {
1931
if (!defined($conf->{arch})) {
2032
my $arch = eval { $self->protected_call(sub { $plugin->detect_architecture() }) };
2133

@@ -34,14 +46,14 @@ index 5c9114c..cae55b1 100644
3446
}
3547

3648
diff --git a/src/PVE/LXC/Setup/Plugin.pm b/src/PVE/LXC/Setup/Plugin.pm
37-
index b9d9c2d..533afe0 100644
49+
index b9d9c2d..f413d91 100644
3850
--- a/src/PVE/LXC/Setup/Plugin.pm
3951
+++ b/src/PVE/LXC/Setup/Plugin.pm
4052
@@ -6,6 +6,7 @@ use strict;
4153
use warnings;
4254

4355
use Carp;
44-
+use PVE::Tools;
56+
+use PVE::Tools qw(get_host_arch);
4557

4658
sub new {
4759
my ($class, $conf, $rootdir, $os_release) = @_;
@@ -84,8 +96,8 @@ index b9d9c2d..533afe0 100644
8496
+
8597
+ my $arch = eval { PVE::Tools::run_fork_with_timeout(5, $detect_arch) };
8698
+ if (my $err = $@) {
87-
+ $arch = 'arm64';
88-
+ print "Architecture detection failed: $err\nFalling back to loongarch64.\n" .
99+
+ $arch = get_host_arch();
100+
+ print "Architecture detection failed: $err\nFalling back to $arch.\n" .
89101
+ "Use `pct set VMID --arch ARCH` to change.\n";
90102
+ } else {
91103
+ print "Detected container architecture: $arch\n";
@@ -96,7 +108,7 @@ index b9d9c2d..533afe0 100644
96108

97109
# hooks
98110
diff --git a/src/PVE/LXC/Tools.pm b/src/PVE/LXC/Tools.pm
99-
index 7e3e530..838327f 100644
111+
index 3380c62..a9aa942 100644
100112
--- a/src/PVE/LXC/Tools.pm
101113
+++ b/src/PVE/LXC/Tools.pm
102114
@@ -179,6 +179,7 @@ sub detect_elf_architecture {
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
From a5fec2b01a76ae3ba33704f9f8037c332bd30966 Mon Sep 17 00:00:00 2001
2+
From: jiangcuo <jiangcuo@bingsin.com>
3+
Date: Thu, 5 Dec 2024 12:17:37 +0800
4+
Subject: [PATCH] add anolis
5+
6+
---
7+
src/PVE/LXC/Setup.pm | 2 ++
8+
src/PVE/LXC/Setup/Anolis.pm | 34 ++++++++++++++++++++++++++++++++++
9+
src/PVE/LXC/Setup/Makefile | 1 +
10+
3 files changed, 37 insertions(+)
11+
create mode 100644 src/PVE/LXC/Setup/Anolis.pm
12+
13+
diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm
14+
index 78272be..98398f8 100644
15+
--- a/src/PVE/LXC/Setup.pm
16+
+++ b/src/PVE/LXC/Setup.pm
17+
@@ -10,6 +10,7 @@ use PVE::Tools;
18+
19+
use PVE::LXC::Setup::Alpine;
20+
use PVE::LXC::Setup::ArchLinux;
21+
+use PVE::LXC::Setup::Anolis;
22+
use PVE::LXC::Setup::CentOS;
23+
use PVE::LXC::Setup::Debian;
24+
use PVE::LXC::Setup::Devuan;
25+
@@ -24,6 +25,7 @@ use PVE::LXC::Setup::Unmanaged;
26+
my $plugins = {
27+
alpine => 'PVE::LXC::Setup::Alpine',
28+
archlinux => 'PVE::LXC::Setup::ArchLinux',
29+
+ anolis => 'PVE::LXC::Setup::Anolis',
30+
centos => 'PVE::LXC::Setup::CentOS',
31+
debian => 'PVE::LXC::Setup::Debian',
32+
devuan => 'PVE::LXC::Setup::Devuan',
33+
diff --git a/src/PVE/LXC/Setup/Anolis.pm b/src/PVE/LXC/Setup/Anolis.pm
34+
new file mode 100644
35+
index 0000000..7c482b5
36+
--- /dev/null
37+
+++ b/src/PVE/LXC/Setup/Anolis.pm
38+
@@ -0,0 +1,34 @@
39+
+package PVE::LXC::Setup::Anolis;
40+
+
41+
+use strict;
42+
+use warnings;
43+
+
44+
+use PVE::LXC::Setup::CentOS;
45+
+use base qw(PVE::LXC::Setup::CentOS);
46+
+
47+
+sub new {
48+
+ my ($class, $conf, $rootdir, $os_release) = @_;
49+
+
50+
+ my $version = $os_release->{VERSION_ID};
51+
+
52+
+ my $self = { conf => $conf, rootdir => $rootdir, version => $version };
53+
+
54+
+ $conf->{ostype} = "anolis";
55+
+
56+
+ return bless $self, $class;
57+
+}
58+
+
59+
+sub template_fixup {
60+
+ my ($self, $conf) = @_;
61+
+
62+
+ $self->remove_lxc_name_from_etc_hosts();
63+
+ $self->setup_systemd_disable_static_units(['dev-mqueue.mount']);
64+
+}
65+
+
66+
+sub setup_init {
67+
+ my ($self, $conf) = @_;
68+
+ $self->setup_container_getty_service($conf);
69+
+ $self->setup_systemd_preset();
70+
+}
71+
+
72+
+1;
73+
diff --git a/src/PVE/LXC/Setup/Makefile b/src/PVE/LXC/Setup/Makefile
74+
index 688b547..9ff3de9 100644
75+
--- a/src/PVE/LXC/Setup/Makefile
76+
+++ b/src/PVE/LXC/Setup/Makefile
77+
@@ -13,6 +13,7 @@ SOURCES=\
78+
NixOS.pm \
79+
OpenEuler.pm \
80+
Unmanaged.pm \
81+
+ Anolis.pm \
82+
83+
.PHONY: install
84+
install:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
From bba618e88b694a38f63de8b4bfaa403b7e3cad2f Mon Sep 17 00:00:00 2001
2+
From: jiangcuo <jiangcuo@bingsin.com>
3+
Date: Thu, 5 Dec 2024 12:21:23 +0800
4+
Subject: [PATCH] set unknown ostype to unmanaged
5+
6+
---
7+
src/PVE/LXC/Setup.pm | 2 --
8+
1 file changed, 2 deletions(-)
9+
10+
diff --git a/src/PVE/LXC/Setup.pm b/src/PVE/LXC/Setup.pm
11+
index 98398f8..a3a4588 100644
12+
--- a/src/PVE/LXC/Setup.pm
13+
+++ b/src/PVE/LXC/Setup.pm
14+
@@ -87,8 +87,6 @@ my $autodetect_type = sub {
15+
return "nixos";
16+
} elsif (-f "$rootdir/etc/openEuler-release") {
17+
return "openeuler";
18+
- } elsif (-f "$rootdir/etc/os-release") {
19+
- die "unable to detect OS distribution\n";
20+
} else {
21+
warn "/etc/os-release file not found and autodetection failed, falling back to 'unmanaged'\n";
22+
return "unmanaged";
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 22b279f7305e3d80634cf697f61ae64f47f25622 Mon Sep 17 00:00:00 2001
2+
From: jiangcuo <jiangcuo@bingsin.com>
3+
Date: Thu, 5 Dec 2024 12:22:17 +0800
4+
Subject: [PATCH] bump version to 5.2.2+port1
5+
6+
---
7+
debian/changelog | 8 ++++++++
8+
1 file changed, 8 insertions(+)
9+
10+
diff --git a/debian/changelog b/debian/changelog
11+
index 014958c..44785c2 100644
12+
--- a/debian/changelog
13+
+++ b/debian/changelog
14+
@@ -1,3 +1,11 @@
15+
+pve-container (5.2.2+port1) bookworm; urgency=medium
16+
+
17+
+ * Add Anolis support
18+
+
19+
+ * Set all unknown ostype to unmanaged
20+
+
21+
+ -- Jiangcuo <jiangcuo@bingsin.com> Thu, 05 Dec 2024 12:18:26 +0800
22+
+
23+
pve-container (5.2.2) bookworm; urgency=medium
24+
25+
* network config: avoid committing invalid config on hotplug failure, rather

‎packages/pve-container/series‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
patches/001-add-loongarch-support.patch
1+
patches/001-add-loongarch-support.patch
2+
patches/002-add-anolis.patch
3+
patches/003-set-unknown-ostype-to-unmanaged.patch
4+
patches/changelog/001-bump-version-to-5.2.2+port1.patch

0 commit comments

Comments
 (0)