From 91bf89e18a2ceda124bbac137a5beb83b5b46816 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 30 Jun 2015 06:28:38 +0200 Subject: [PATCH] add support for Ubuntu 14.04 and 12.04 --- debian/changelog | 2 ++ src/PVE/LXCSetup/Ubuntu.pm | 26 ++++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 18e539a..b24b09c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Mon, 29 Jun 2015 12:38:46 +0200 pve-container (0.8-1) unstable; urgency=medium diff --git a/src/PVE/LXCSetup/Ubuntu.pm b/src/PVE/LXCSetup/Ubuntu.pm index a8f9658..11f34c8 100644 --- a/src/PVE/LXCSetup/Ubuntu.pm +++ b/src/PVE/LXCSetup/Ubuntu.pm @@ -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 { -- 2.39.5