]>
Commit | Line | Data |
---|---|---|
1 | package PVE::LXC::Setup::ArchLinux; | |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use File::Path 'make_path'; | |
7 | ||
8 | use PVE::LXC::Setup::Base; | |
9 | ||
10 | use base qw(PVE::LXC::Setup::Base); | |
11 | ||
12 | sub new { | |
13 | my ($class, $conf, $rootdir) = @_; | |
14 | ||
15 | # /etc/arch-release exists, but it's empty | |
16 | #my $release = PVE::Tools::file_read_firstline("$rootdir/etc/arch-release"); | |
17 | #die "unable to read version info\n" if !defined($release); | |
18 | ||
19 | my $self = { conf => $conf, rootdir => $rootdir, version => 0 }; | |
20 | ||
21 | $conf->{ostype} = "archlinux"; | |
22 | ||
23 | return bless $self, $class; | |
24 | } | |
25 | ||
26 | sub template_fixup { | |
27 | my ($self, $conf) = @_; | |
28 | ||
29 | # edit /etc/securetty (enable login on console) | |
30 | $self->setup_securetty($conf); | |
31 | ||
32 | $self->remove_lxc_name_from_etc_hosts(); | |
33 | } | |
34 | ||
35 | sub setup_init { | |
36 | my ($self, $conf) = @_; | |
37 | ||
38 | $self->setup_systemd_preset({ | |
39 | # ArchLinux doesn't come with any particular predefined and enabled | |
40 | # networking, so it probably makes sense to do the equivalent of | |
41 | # 'systemctl enable systemd-networkd', since that's what we're configuring | |
42 | # in setup_network | |
43 | 'systemd-networkd.service' => 1 | |
44 | }); | |
45 | ||
46 | $self->setup_container_getty_service($conf); | |
47 | } | |
48 | ||
49 | sub setup_network { | |
50 | my ($self, $conf) = @_; | |
51 | ||
52 | $self->setup_systemd_networkd($conf); | |
53 | } | |
54 | ||
55 | 1; |