]>
Commit | Line | Data |
---|---|---|
7af97ad5 | 1 | package PVE::LXC::Setup::ArchLinux; |
c1d32b55 WB |
2 | |
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use File::Path 'make_path'; | |
7 | ||
7af97ad5 | 8 | use PVE::LXC::Setup::Base; |
c1d32b55 | 9 | |
7af97ad5 | 10 | use base qw(PVE::LXC::Setup::Base); |
c1d32b55 WB |
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) = @_; | |
b7cd927f WB |
28 | |
29 | # edit /etc/securetty (enable login on console) | |
5e84bdc8 | 30 | $self->setup_securetty($conf); |
8f56203b SI |
31 | |
32 | $self->remove_lxc_name_from_etc_hosts(); | |
c1d32b55 WB |
33 | } |
34 | ||
35 | sub setup_init { | |
90b21cdc | 36 | my ($self, $conf) = @_; |
454ea391 WB |
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 | ||
5e84bdc8 | 46 | $self->setup_container_getty_service($conf); |
c1d32b55 WB |
47 | } |
48 | ||
49 | sub setup_network { | |
50 | my ($self, $conf) = @_; | |
51 | ||
52 | $self->setup_systemd_networkd($conf); | |
53 | } | |
54 | ||
55 | 1; |