]> git.proxmox.com Git - pve-container.git/blame - src/PVE/LXC/Setup/ArchLinux.pm
setup: enable systemd-networkd via preset for archlinux
[pve-container.git] / src / PVE / LXC / Setup / ArchLinux.pm
CommitLineData
7af97ad5 1package PVE::LXC::Setup::ArchLinux;
c1d32b55
WB
2
3use strict;
4use warnings;
5
6use File::Path 'make_path';
7
7af97ad5 8use PVE::LXC::Setup::Base;
c1d32b55 9
7af97ad5 10use base qw(PVE::LXC::Setup::Base);
c1d32b55
WB
11
12sub 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
26sub 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
35sub 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
49sub setup_network {
50 my ($self, $conf) = @_;
51
52 $self->setup_systemd_networkd($conf);
53}
54
551;