]> git.proxmox.com Git - pve-container.git/commitdiff
install Alpine.pm and configure its network
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 12 Feb 2016 08:27:32 +0000 (09:27 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 16 Feb 2016 11:14:11 +0000 (12:14 +0100)
Since busybox' current default DHCPv6 client is unfinished
and alpine currently doesn't handle a 'dhcp' interface type
in its /etc/network/interfaces and bails out when
configuring the network with a broken config we have to make
sure we don't pass this on to debian's setup_network.

Unfortunately a warning at this point would only be visible
when creating a container because at this point no warning
makes it to the console/UI (and errors would be hidden
because the setup runs in our lxc prestart hook).

src/PVE/LXC/Setup/Alpine.pm
src/PVE/LXC/Setup/Makefile

index f294961ba22afc4bec0aa07d7bc7540e0f7c4ec9..7f7da3aba060d8a2bf3ea126471f0688ed3e8605 100644 (file)
@@ -8,6 +8,7 @@ use PVE::Network;
 use File::Path;
 
 use PVE::LXC::Setup::Base;
+use PVE::LXC::Setup::Debian;
 
 use base qw(PVE::LXC::Setup::Base);
 
@@ -41,7 +42,28 @@ sub setup_init {
 }
 
 sub setup_network {
-    # Nothing to do
+    # Network is debian compatible, but busybox' udhcpc6 is unfinished
+    my ($self, $conf) = @_;
+
+    # XXX: udhcpc6 in busybox is broken; once a working alpine release comes
+    # we can remove this bit.
+    #
+    # Filter out ipv6 dhcp and turn it into 'manual' so they see what's up.
+    my $netconf = {};
+    my $networks = {};
+    foreach my $k (keys %$conf) {
+       next if $k !~ m/^net(\d+)$/;
+       my $netstring = $conf->{$k};
+       # check for dhcp6:
+       my $d = PVE::LXC::parse_lxc_network($netstring);
+       if (defined($d->{ip6}) && $d->{ip6} eq 'dhcp') {
+           $d->{ip6} = 'manual';
+           $netstring = PVE::LXC::print_lxc_network($d);
+       }
+       $netconf->{$k} = $netstring;
+    }
+
+    PVE::LXC::Setup::Debian::setup_network($self, $netconf);
 }
 
 1;
index 9235edf3c4377f3c12d96f10259daa3bc1c819ca..c12f1a3fdcb77b1bb839746819e5c092ba1aa48c 100644 (file)
@@ -1,4 +1,4 @@
-SOURCES=Base.pm Debian.pm Ubuntu.pm Redhat.pm Fedora.pm SUSE.pm ArchLinux.pm
+SOURCES=Base.pm Debian.pm Ubuntu.pm Redhat.pm Fedora.pm SUSE.pm ArchLinux.pm Alpine.pm
 
 .PHONY: install
 install: