]> xenbits.xensource.com Git - osstest.git/commitdiff
target_guest_lv_name: move into TestSupport; fix FreeBSD test flight-22221 flight-22232 flight-22243 flight-22261 flight-22273 flight-22275 flight-22276 flight-22277 flight-22278 flight-22279 flight-22281 flight-22282 flight-22283 flight-22284 flight-22285 flight-22286 flight-22287 flight-22290 flight-22291 flight-22292 flight-22293 flight-22294 flight-22295 flight-22296 flight-22297 flight-22298 flight-22300 flight-22301 flight-22302 flight-22303 flight-22304 flight-22306 flight-22307 flight-22308 flight-22309 flight-22311 flight-22312 flight-22313
authorRoger Pau Monné <roger.pau@citrix.com>
Mon, 2 Dec 2013 15:22:53 +0000 (16:22 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 2 Dec 2013 15:35:53 +0000 (15:35 +0000)
Move from lvm_lv_name in Debian.pm, and use it where appropriate in
ts-freebsd-install.  This will fix the bug where ts-freebsd-install
fails on hsots with "-" in their hostname (and hence their vg name).

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Debian.pm
Osstest/TestSupport.pm
ts-freebsd-install

index e51a2339b716ac615c80431c55de11fa28e89593..6759263582fe15d67dd269e639adb279c0356cef 100644 (file)
@@ -111,15 +111,6 @@ sub bl_getmenu_open ($$$) {
     return $f;
 }
 
-sub lvm_lv_name($$) {
-    my ($ho, $lv) = @_;
-
-    my $vg = "$ho->{Name}";
-    # Dashes are escaped in the VG name
-    $vg =~ s/-/--/g;
-    return "/dev/mapper/$vg-$lv";
-}
-
 sub setupboot_uboot ($$$) {
     my ($ho,$want_kernver,$xenhopt,$xenkopt) = @_;
     my $bl= { };
@@ -131,7 +122,7 @@ sub setupboot_uboot ($$$) {
        my $kern = "vmlinuz-$want_kernver";
        my $initrd = "initrd.img-$want_kernver";
 
-       my $root= lvm_lv_name($ho,"root");
+       my $root= target_guest_lv_name($ho,"root");
 
        logm("Xen options: $xenhopt");
        logm("Linux options: $xenkopt");
@@ -590,7 +581,7 @@ END
     }
 
     if ( $ho->{Flags}{'need-uboot-bootscr'} ) {
-       my $root=lvm_lv_name($ho,"root");
+       my $root=target_guest_lv_name($ho,"root");
 
        preseed_hook_command($ho, 'late_command', $sfx, <<END);
 #!/bin/sh
index 3bad5cac75be2e1840c7833c8784b73af46b1eb3..a513540bae129adfaa6f03de48d460b4ebb20761 100644 (file)
@@ -57,7 +57,7 @@ BEGIN {
                       target_put_guest_image
                       target_editfile_root target_file_exists
                       target_install_packages target_install_packages_norec
-                      target_extract_jobdistpath
+                      target_extract_jobdistpath target_guest_lv_name
 
                       poll_loop tcpconnect await_tcp
                       contents_make_cpio file_simple_write_contents
@@ -616,6 +616,15 @@ sub poll_loop ($$$&) {
     logm("$what: ok. (${waited}s)");
 }
 
+sub target_guest_lv_name($$) {
+    my ($ho, $lv) = @_;
+
+    my $vg = "$ho->{Name}";
+    # Dashes are escaped in the VG name
+    $vg =~ s/-/--/g;
+    return "/dev/mapper/$vg-$lv";
+}
+
 #---------- dhcp watching ----------
 
 sub dhcp_watch_setup ($$) {
index 470fb8394db942be232d3448073a07bc73e37acd..6c6abbef05203a89c325790f80cc526a4002fad2 100755 (executable)
@@ -67,7 +67,7 @@ sub prep () {
                            ? $r{"$gho->{Guest}_arch"} : 'amd64').
                           ".qcow2.xz");
                                
-    my $rootpartition_dev = "/dev/mapper/$gho->{Vg}-$gho->{Name}--disk3";
+    my $rootpartition_dev = target_guest_lv_name($ho, $gho->{Name}) . "--disk3";
 
     target_cmd_root($ho, "umount $gho->{Lvdev} ||:");