]> git.proxmox.com Git - pve-container.git/commitdiff
add support for Ubuntu 14.04 and 12.04
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 30 Jun 2015 04:28:38 +0000 (06:28 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 30 Jun 2015 04:29:34 +0000 (06:29 +0200)
debian/changelog
src/PVE/LXCSetup/Ubuntu.pm

index 18e539ab9a2f593d6a1ea93bbf018afdfea8b4ca..b24b09c0c3b5ead455ba0e85f72480be615d1a07 100644 (file)
@@ -6,6 +6,8 @@ pve-container (0.9-1) unstable; urgency=medium
 
   * add net hotplug and hotplug ip configuration
 
+  * add support for Ubuntu 15.04
+
  -- Proxmox Support Team <support@proxmox.com>  Mon, 29 Jun 2015 12:38:46 +0200
 
 pve-container (0.8-1) unstable; urgency=medium
index a8f9658ac73db04ff169fb7c8a14b7c5454d8582..11f34c8c9d05f7ffb85771ca32bbb0891baf62bb 100644 (file)
@@ -11,6 +11,12 @@ use PVE::LXCSetup::Debian;
 
 use base qw(PVE::LXCSetup::Debian);
 
+my $known_versions = {
+    '15.04' => 1, # vivid
+    '14.04' => 1, # trusty LTS
+    '12.04' => 1, # precise LTS
+};
+
 sub new {
     my ($class, $conf, $rootdir) = @_;
 
@@ -26,7 +32,7 @@ sub new {
     
     die "unable to read version info\n" if !defined($version);
   
-    die "unsupported ubunt version '$version'\n" if $version ne '15.04';
+    die "unsupported ubunt version '$version'\n" if !$known_versions->{$version};
 
     my $self = { conf => $conf, rootdir => $rootdir, version => $version };
 
@@ -39,8 +45,9 @@ sub template_fixup {
     my ($self, $conf) = @_;
 
     my $rootdir = $self->{rootdir};
+    my $version = $self->{version};
     
-    if ($self->{version} eq '15.04') {
+    if ($version eq '15.04') {
        # edit /etc/securetty (enable login on console)
        my $filename = "$rootdir/etc/securetty";
        my $data = PVE::Tools::file_get_contents($filename);
@@ -49,6 +56,21 @@ sub template_fixup {
        }
        PVE::Tools::file_set_contents($filename, $data);
     }
+
+    if ($version eq '12.04') {
+       # suppress log level output for udev
+       my $filename = "$rootdir/etc/udev/udev.conf";
+       my $data = PVE::Tools::file_get_contents($filename);
+       $data =~ s/=\"err\"/=0/m;
+       PVE::Tools::file_set_contents($filename, $data);
+    }
+
+    if ($version eq '12.04' || $version eq '14.04') {
+       my $ttycount = defined($conf->{'lxc.tty'}) ? $conf->{'lxc.tty'} : 4;
+       for (my $i = $ttycount; $i < 7; $i++) {
+           unlink "$rootdir/etc/init/tty$i.conf";
+       }
+    }
 }
 
 sub setup_init {