]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
Debian: Abolish $suite and $xopts{Suite} from preseed_* interfaces.
authorIan Campbell <ian.campbell@citrix.com>
Mon, 18 Jan 2016 14:28:46 +0000 (14:28 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 17 Feb 2016 11:16:23 +0000 (11:16 +0000)
Generating a preseed for a suite which does not match the ->{Suite} of
the underlying guest or host object does not seem useful, so remove
this option and use ->{Suite} instead.

For guests ->{Suite} is set by debian_guest_suite() (which is called
from preseed_guest_create(), although it is often also called prior to
that) and by selectguest()

For hosts $ho->{Suite} is initialised by selecthost if we are in the
context of a $job (and if we aren't we had best not be trying to
reinstall a host).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Debian.pm
ts-debian-di-install
ts-debian-hvm-install
ts-host-install

index e7b553843452971d5dd8d38d5d104153ac4de8d7..ff35c80f2fc50737693baf13f340f4b1fb364c5f 100644 (file)
@@ -794,8 +794,10 @@ sub debian_overlays ($) {
     $func->('overlay', 'overlay.tar');
 }
 
-sub preseed_base ($$$$;@) {
-    my ($ho,$suite,$sfx,$extra_packages,%xopts) = @_;
+sub preseed_base ($$$;@) {
+    my ($ho,$sfx,$extra_packages,%xopts) = @_;
+
+    my $suite = $ho->{Suite};
 
     $xopts{ExtraPreseed} ||= '';
 
@@ -927,7 +929,7 @@ END
 sub preseed_create_guest ($$$;@) {
     my ($ho, $arch, $sfx, %xopts) = @_;
 
-    my $suite= $xopts{Suite} || $c{DebianSuite};
+    my $suite= debian_guest_suite($ho);
 
     my $extra_packages = "";
     if ($xopts{PvMenuLst}) {
@@ -962,7 +964,7 @@ END
         }
     }
 
-    my $preseed_file= preseed_base($ho, $suite, $sfx, $extra_packages, %xopts);
+    my $preseed_file= preseed_base($ho, $sfx, $extra_packages, %xopts);
     $preseed_file.= (<<END);
 d-i     partman-auto/method             string regular
 d-i     partman-auto/choose_recipe \\
@@ -1004,7 +1006,7 @@ sub preseed_create ($$;@) {
     my ($ho, $sfx, %xopts) = @_;
 
     my $disk= $xopts{DiskDevice} || '/dev/sda';
-    my $suite= $xopts{Suite} || $c{DebianSuite};
+    my $suite= $ho->{Suite};
 
     my $d_i= $ho->{Tftp}{Path}.'/'.$ho->{Tftp}{DiBase}.'/'.$r{arch}.'/'.
        $c{TftpDiVersion}.'-'.$ho->{Suite};
@@ -1211,7 +1213,7 @@ END
 
     my $extra_packages = join(",",@extra_packages);
 
-    my $preseed_file= preseed_base($ho,$suite,$sfx,$extra_packages,%xopts);
+    my $preseed_file= preseed_base($ho,$sfx,$extra_packages,%xopts);
 
     $preseed_file .= (<<END);
 d-i partman-auto/method string lvm
index 96acd0e71d1583b4e97983fe2f37263b5fccf284..9a513d35278232f5e237d17b1fc53cc6156d7eb5 100755 (executable)
@@ -204,7 +204,6 @@ END
        my $pvmenulst = ($bl eq "pvgrub" || $arch =~ /arm/);
 
        $ps_url = preseed_create_guest($gho, $arch, '',
-                                      Suite=>$suite,
                                       PvMenuLst=>$pvmenulst);
 
        $extra_disk = "";
index 96190a18fb40065229241506d31aed268d37991f..7521d57191e182bd972e7f53130e774389e37074 100755 (executable)
@@ -55,7 +55,7 @@ our $gsuite;
 
 sub preseed () {
 
-    my $preseed_file = preseed_base($gho,$gsuite,'','',());
+    my $preseed_file = preseed_base($gho,'','',());
 
     my $disk = guest_var($gho,'diskdevice','/dev/xvda');
 
index cfa60445dc270eb205cf06be779e1eb36e641cbb..eb740fa95beecf5fa7d706b1e7a70ed2d55d2aca 100755 (executable)
@@ -59,7 +59,6 @@ sub install () {
 
     my ($ps_url,$ps_file)= preseed_create
         ($ho, '',
-         Suite => $ho->{Suite},
          DiskDevice => $ho->{DiskDevice},
          Properties => $ho->{Properties},
          ExtraPreseed => <<END );