]>
git.proxmox.com Git - pve-container.git/blob - src/PVE/LXC/Setup/Alpine.pm
1 package PVE
::LXC
::Setup
::Alpine
;
10 use PVE
::LXC
::Setup
::Base
;
11 use PVE
::LXC
::Setup
::Debian
;
13 use base
qw(PVE::LXC::Setup::Base);
16 my ($class, $conf, $rootdir) = @_;
18 my $version = PVE
::Tools
::file_read_firstline
("$rootdir/etc/alpine-release");
20 my $self = { conf
=> $conf, rootdir
=> $rootdir, version
=> $version };
21 $conf->{ostype
} = "alpine";
22 return bless $self, $class;
26 my ($self, $conf) = @_;
27 my $rootdir = $self->{rootdir
};
28 # enable networking service
29 $self->ct_symlink('/etc/init.d/networking',
30 '/etc/runlevels/boot/networking');
32 $self->ct_symlink('/etc/init.d/bootmisc',
33 '/etc/runlevels/boot/bootmisc');
34 $self->ct_symlink('/etc/init.d/hostname',
35 '/etc/runlevels/boot/hostname');
37 $self->ct_symlink('/etc/init.d/killprocs',
38 '/etc/runlevels/shutdown/killprocs');
39 $self->ct_symlink('/etc/init.d/savecache',
40 '/etc/runlevels/shutdown/savecache');
48 # Network is debian compatible, but busybox' udhcpc6 is unfinished
49 my ($self, $conf) = @_;
51 # XXX: udhcpc6 in busybox is broken; once a working alpine release comes
52 # we can remove this bit.
54 # Filter out ipv6 dhcp and turn it into 'manual' so they see what's up.
57 foreach my $k (keys %$conf) {
58 next if $k !~ m/^net(\d+)$/;
59 my $netstring = $conf->{$k};
61 my $d = PVE
::LXC
::Config-
>parse_lxc_network($netstring);
62 if (defined($d->{ip6
}) && $d->{ip6
} eq 'dhcp') {
64 $netstring = PVE
::LXC
::Config-
>print_lxc_network($d);
66 $netconf->{$k} = $netstring;
69 PVE
::LXC
::Setup
::Debian
::setup_network
($self, $netconf);