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 <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
Changes in v4:
1. Add missing "use Osstest::Debian;".
Changes in v3:
1. Introduce a function to return vg name and use it.
Changes in v2:
1. Make Jessie case default.
preseed_hook_overlay
preseed_hook_cmds
di_installcmdline_core
+ di_vg_name
);
%EXPORT_TAGS = ( );
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) = @_;
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 (<EI>) {
s/^terminal.*/terminal --timeout=10 serial console/;
use Osstest;
use POSIX;
use Osstest::TestSupport;
+use Osstest::Debian;
tsreadconfig();
}
sub determine_vg_lv () {
- $vg=
- $ho->{Suite} =~ m/lenny/
- ? "$ho->{Name}.$c{TestHostDomain}"
- : $ho->{Name};
+ $vg = di_vg_name($ho);
$lv = "/dev/$vg/$lvleaf";
}