]> git.proxmox.com Git - pve-container.git/blob - src/PVE/LXC/Setup/ArchLinux.pm
e93293f2abf2eee1fbe99b74ff0c6c868a3e3abc
[pve-container.git] / src / PVE / LXC / Setup / ArchLinux.pm
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 # ArchLinux doesn't come with any particular predefined and enabled
29 # networking, so it probably makes sense to do the equivalent of
30 # 'systemctl enable systemd-networkd', since that's what we're configuring
31 # in setup_network
32
33 # systemctl enable systemd-networkd
34 $self->ct_mkdir('/etc/systemd/system/multi-user.target.wants');
35 $self->ct_mkdir('/etc/systemd/system/socket.target.wants');
36 $self->ct_symlink('/usr/lib/systemd/system/systemd-networkd.service',
37 '/etc/systemd/system/multi-user.target.wants/systemd-networkd.service');
38 $self->ct_symlink('/usr/lib/systemd/system/systemd-networkd.socket',
39 '/etc/systemd/system/socket.target.wants/systemd-networkd.socket');
40
41 # edit /etc/securetty (enable login on console)
42 $self->setup_securetty($conf, qw(console tty1 tty2 tty3 tty4));
43 }
44
45 sub setup_init {
46 my ($self, $conf) = @_;
47 $self->setup_container_getty_service(1);
48 }
49
50 sub setup_network {
51 my ($self, $conf) = @_;
52
53 $self->setup_systemd_networkd($conf);
54 }
55
56 1;