]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
di_installer_path: Break out of preseed_create
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 14 Dec 2017 13:04:31 +0000 (13:04 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 14 Dec 2017 15:34:41 +0000 (15:34 +0000)
No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Debian.pm

index 6a1babf526663d5e2198269b4dd5689958e05edd..7664194f9209ebb9b53b6252d23127fa505c9d4c 100644 (file)
@@ -34,7 +34,7 @@ BEGIN {
     $VERSION     = 1.00;
     @ISA         = qw(Exporter);
     @EXPORT      = qw(debian_boot_setup
-                      di_special_kernel
+                      di_installer_path di_special_kernel
                       setupboot_bootloader_edited_rune
                       debian_overlays
                       debian_guest_suite debian_guest_di_version
@@ -1044,6 +1044,16 @@ END
     return create_webfile($ho, "preseed$sfx", $preseed_file);
 }
 
+sub di_installer_path ($) {
+    # returns a path within $ho->{Tftp}{Path}, which is therefore
+    # useable for constructing host paths as well as guest paths
+    my ($ho) = @_;
+
+    return $ho->{Tftp}{DiBase}.'/'.$r{arch}.'/'.
+       ($ho->{DiVersion} // cfg_tftp_di_version($ho->{Suite}))
+       .'-'.$ho->{Suite};
+}
+
 sub di_special_kernel ($$$) {
     my ($ho, $d_i, $fn) = @_;
     # calls $fn->($kp, $kernel, $cpio) # $kernel and/or $cpio may be undef
@@ -1080,9 +1090,7 @@ sub preseed_create ($$;@) {
     my $disk= $xopts{DiskDevice} || '/dev/sda';
     my $suite= $ho->{Suite};
 
-    my $d_i= $ho->{Tftp}{Path}.'/'.$ho->{Tftp}{DiBase}.'/'.$r{arch}.'/'.
-       ($ho->{DiVersion} // cfg_tftp_di_version($ho->{Suite}))
-       .'-'.$ho->{Suite};
+    my $d_i = $ho->{Tftp}{Path}.'/'.di_installer_path($ho);
 
     preseed_hook_installscript($ho, $sfx,
           '/lib/partman/init.d', '000override-parted-devices', <<END);