]> git.proxmox.com Git - pve-container.git/blame - src/PVE/LXC/Setup/Devuan.pm
fix #4192: revamp check for systemd version
[pve-container.git] / src / PVE / LXC / Setup / Devuan.pm
CommitLineData
151c5b73
TL
1package PVE::LXC::Setup::Devuan;
2
3use strict;
4use warnings;
5
6use PVE::Tools qw($IPV6RE);
7
8use PVE::LXC::Setup::Debian;
9use base qw(PVE::LXC::Setup::Debian);
10
11sub new {
12 my ($class, $conf, $rootdir) = @_;
13
14 my $version = PVE::Tools::file_read_firstline("$rootdir/etc/devuan_version");
15
16 die "unable to read version info\n" if !defined($version);
3d27198e 17 $version = lc($version);
151c5b73 18
7f910f27
TL
19 # map to Debian version, we sometimes check that
20 my $version_map = {
21 'jessie' => 8, # Devuan 1.0
22 'ascii' => 9, # Devuan 2.0
23 'ascii/ceres' => 9,
24 'beowulf' => 10, # Devuan 3.0
25 'beowulf/ceres' => 10,
26 'chimaera' => 11, # Devuan 4.0
27 'chimaera/ceres' => 11,
28 };
29 die "unsupported Devuan version '$version'\n" if !exists($version_map->{$version});
30
31 my $self = {
32 conf => $conf,
33 rootdir => $rootdir,
34 version => $version_map->{$version},
35 devuan_version => $version,
36 };
151c5b73
TL
37
38 $conf->{ostype} = "devuan";
39
40 return bless $self, $class;
41}
42
766ffcc9
SI
43# non systemd based containers work with pure cgroupv2
44sub unified_cgroupv2_support {
917f7ae3 45 my ($self, $init) = @_;
766ffcc9
SI
46
47 return 1;
48}
49
151c5b73
TL
50# the rest gets handled by the Debian plugin, which is compatible with older
51# non-systemd Debian versions for now.
52
531;