]> git.proxmox.com Git - pve-container.git/blame - src/PVE/LXC/Setup/Fedora.pm
update_lxc_config: remove ostype check
[pve-container.git] / src / PVE / LXC / Setup / Fedora.pm
CommitLineData
b0143ab1
WB
1package PVE::LXC::Setup::Fedora;
2
3use strict;
4use warnings;
5
81a6ec3f 6use PVE::LXC::Setup::CentOS;
b0143ab1 7
81a6ec3f 8use base qw(PVE::LXC::Setup::CentOS);
b0143ab1
WB
9
10sub new {
11 my ($class, $conf, $rootdir) = @_;
12
13 my $release = PVE::Tools::file_read_firstline("$rootdir/etc/fedora-release");
14 die "unable to read version info\n" if !defined($release);
15
16 my $version;
17
18 if ($release =~ m/release\s+(\d+(?:\.\d+)?)(\.\d+)?/) {
97e3e8e8 19 if ($1 >= 22 && $1 < 26) {
b0143ab1
WB
20 $version = $1;
21 }
22 }
23
24 die "unsupported fedora release '$release'\n" if !$version;
25
26 my $self = { conf => $conf, rootdir => $rootdir, version => $version };
27
28 $conf->{ostype} = "fedora";
29
30 return bless $self, $class;
31}
32
97e3e8e8
WB
33sub template_fixup {
34 my ($self, $conf) = @_;
35 $self->setup_securetty($conf);
36 $self->ct_unlink('/etc/systemd/system/getty@.service');
37}
38
39sub setup_init {
40 my ($self, $conf) = @_;
41 $self->setup_container_getty_service($conf);
42}
43
b0143ab1 441;