From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: [PATCH OSSTEST v3 06/11] Cope with Jessie's d-i vg name Date: Wed, 17 Jun 2015 14:06:39 +0100 Message-ID: <1434546404-2036-7-git-send-email-wei.liu2@citrix.com> References: <1434546404-2036-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z5D3j-0005A9-Ot for xen-devel@lists.xenproject.org; Wed, 17 Jun 2015 13:07:15 +0000 In-Reply-To: <1434546404-2036-1-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: ian.jackson@eu.citrix.com, Wei Liu , ian.campbell@citrix.com List-Id: xen-devel@lists.xenproject.org In Jessie the default vg name is changed to "$hostname-vg". Make that default case and check for wheezy, squeeze and lenny for backward compatibility. Signed-off-by: Wei Liu --- Changes in v3: 1. Introduce a function to return vg name and use it. Changes in v2: 1. Make Jessie case default. --- Osstest/Debian.pm | 13 +++++++++++++ ts-host-install | 3 +-- ts-xen-build-prep | 5 +---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index 8ad673e..b1a5396 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -43,6 +43,7 @@ BEGIN { preseed_hook_overlay preseed_hook_cmds di_installcmdline_core + di_vg_name ); %EXPORT_TAGS = ( ); @@ -566,6 +567,18 @@ sub di_installcmdline_core ($$;@) { return @cl; } +sub di_vg_name($) { + my ($ho) = @_; + + if ($ho->{Suite} =~ m/wheezy|squeeze/) { + return $ho->{Name}; + } + if ($ho->{Suite} =~ m/lenny/){ + return "$ho->{Name}.$c{TestHostDomain}"; + } + return "$ho->{Name}-vg"; +} + sub preseed_ssh ($$) { my ($ho,$sfx) = @_; diff --git a/ts-host-install b/ts-host-install index 242bfb0..04d5487 100755 --- a/ts-host-install +++ b/ts-host-install @@ -87,10 +87,9 @@ END await_tcp(get_timeout($ho,'reboot',$timeout{Sshd}), 14,$ho); - our $vgname= $ho->{Name}; + our $vgname = di_vg_name($ho); if ($ho->{Suite} =~ m/lenny/) { - $vgname .= ".$c{TestHostDomain}"; target_editfile_root($ho, '/boot/grub/menu.lst', sub { while () { s/^terminal.*/terminal --timeout=10 serial console/; diff --git a/ts-xen-build-prep b/ts-xen-build-prep index 4dece65..deee24c 100755 --- a/ts-xen-build-prep +++ b/ts-xen-build-prep @@ -52,10 +52,7 @@ sub overall_limit_pe ($) { } sub determine_vg_lv () { - $vg= - $ho->{Suite} =~ m/lenny/ - ? "$ho->{Name}.$c{TestHostDomain}" - : $ho->{Name}; + $vg = di_vg_name($ho); $lv = "/dev/$vg/$lvleaf"; } -- 1.9.1