[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH OSSTEST v4 07/25] Debian: add preseed_create_guest helper



Creates a preseed file suitable for use in a PV guest

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
v4: Rebase, pass $ho to preseed_base
v3: Handle $xopts{ExtraPreseed} undefined in preseed_base
---
 Osstest/Debian.pm | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 13cd147..993acc7 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -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
@@ -611,6 +612,9 @@ END
 sub preseed_base ($$$;@) {
     my ($ho,$suite,$extra_packages,%xopts) = @_;
 
+    $extra_packages ||= '';
+    $xopts{ExtraPreseed} ||= '';
+
     my $preseed = <<"END";
 d-i mirror/suite string $suite
 
@@ -693,6 +697,31 @@ END
     return $preseed;
 }
 
+sub preseed_create_guest ($$;@) {
+    my ($ho, $sfx, %xopts) = @_;
+
+    my $suite= $xopts{Suite} || $c{DebianSuite};
+
+    my $extra_packages;
+
+    my $preseed_file= preseed_base($ho, $suite, $extra_packages, %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_ssh($ho, $sfx);
+    preseed_hook_overlay($ho, $sfx, $c{OverlayLocal}, 'overlay-local.tar');
+
+    $preseed_file .= preseed_hook_cmds();
+
+    return create_webfile($ho, "preseed$sfx", $preseed_file);
+}
+
 sub preseed_create ($$;@) {
     my ($ho, $sfx, %xopts) = @_;
 
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.