]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
Debian: add preseed_create_guest helper
authorIan Campbell <ian.campbell@citrix.com>
Fri, 25 Apr 2014 20:29:24 +0000 (21:29 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 14 May 2015 10:56:19 +0000 (11:56 +0100)
Creates a preseed file suitable for use in a PV guest

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

index 84f420331cf01d2ea8b69cb04bb2e5e230d338ed..7a4dd01488c0c739a4fffa2ce423bef09f234c62 100644 (file)
@@ -37,6 +37,7 @@ BEGIN {
                       %preseed_cmds
                       preseed_base
                       preseed_create
+                      preseed_create_guest
                       preseed_ssh
                       preseed_hook_command preseed_hook_installscript
                       preseed_hook_overlay
@@ -617,6 +618,8 @@ END
 sub preseed_base ($$$$;@) {
     my ($ho,$suite,$sfx,$extra_packages,%xopts) = @_;
 
+    $xopts{ExtraPreseed} ||= '';
+
     preseed_ssh($ho, $sfx);
     preseed_hook_overlay($ho, $sfx, $c{OverlayLocal}, 'overlay-local.tar');
 
@@ -702,6 +705,26 @@ END
     return $preseed;
 }
 
+sub preseed_create_guest ($$;@) {
+    my ($ho, $sfx, %xopts) = @_;
+
+    my $suite= $xopts{Suite} || $c{DebianSuite};
+
+    my $preseed_file= preseed_base($ho, $suite, $sfx, '', %xopts);
+    $preseed_file.= (<<END);
+d-i     partman-auto/method             string regular
+d-i     partman-auto/choose_recipe \\
+                select All files in one partition (recommended for new users)
+
+d-i     grub-installer/bootdev          string /dev/xvda
+
+END
+
+    $preseed_file .= preseed_hook_cmds();
+
+    return create_webfile($ho, "preseed$sfx", $preseed_file);
+}
+
 sub preseed_create ($$;@) {
     my ($ho, $sfx, %xopts) = @_;