]>
Commit | Line | Data |
---|---|---|
b0143ab1 WB |
1 | package PVE::LXC::Setup::Fedora; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use PVE::LXC::Setup::Redhat; | |
7 | ||
8 | use base qw(PVE::LXC::Setup::Redhat); | |
9 | ||
10 | sub 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+)?/) { | |
19 | if ($1 >= 22 && $1 < 23) { | |
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 | ||
33 | 1; |