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

[Xen-devel] [PATCH RFC V3 3/7] TestSupport.pm: functions for creating isos



I would have replaced genisoimage with xorriso but I think it is better
to keep it for compatibility.

create_iso_xorriso is mainly used to create a EFI bootable ISO image. As
far as I can tell Wheezy's genisoimage cannot do that.

Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 Osstest/TestSupport.pm |   28 ++++++++++++++++++++++++++++
 ts-redhat-install      |   13 ++++---------
 2 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index ebe313c..31ca102 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -97,6 +97,9 @@ BEGIN {
                       await_webspace_fetch_byleaf create_webfile
                       file_link_contents get_timeout
                       setup_pxeboot setup_pxeboot_local host_pxefile
+
+                      create_iso_genisoimage
+                      create_iso_xorriso
                       );
     %EXPORT_TAGS = ( );
 
@@ -1859,4 +1862,29 @@ default local
 END
 }
 
+#---------- ISO images ----------
+sub create_iso_genisoimage ($$$$;@) {
+    my ($ho,$iso,$dir,$isotimeout,@xopts) = @_;
+
+    target_install_packages_norec($ho, qw(genisoimage));
+
+    target_cmd_root($ho, <<END, 60);
+        mkdir -p $dir
+        genisoimage @xopts -o $iso $dir/.
+END
+
+}
+
+sub create_iso_xorriso ($$$$;@) {
+    my ($ho,$iso,$dir,$isotimeout,@xopts) = @_;
+
+    target_install_packages_norec($ho, qw(xorriso));
+
+    target_cmd_root($ho, <<END, 60);
+        mkdir -p $dir
+        xorriso @xopts -o $iso $dir/.
+END
+
+}
+
 1;
diff --git a/ts-redhat-install b/ts-redhat-install
index a945033..87f2335 100755
--- a/ts-redhat-install
+++ b/ts-redhat-install
@@ -112,7 +112,7 @@ END
 our $emptyiso= '/root/empty.iso';
 
 sub prep () {
-    target_install_packages_norec($ho, qw(lvm2 rsync genisoimage));
+    target_install_packages_norec($ho, qw(lvm2 rsync));
 
     my $isotimeout= 600;
 
@@ -129,12 +129,9 @@ sub prep () {
                         -no-emul-boot
                         -boot-load-size 4
                         -boot-info-table);
+    my @isogen= (@isogen_base, @isogen_boot);
 
-    target_cmd_root($ho, <<END, 60);
-            set -e
-            mkdir -p $emptydir
-            genisoimage -o $emptyiso @isogen_base $emptydir/.
-END
+    create_iso_genisoimage($ho, $emptyiso, $emptydir, 60, @isogen_base);
 
     more_prepareguest_hvm($ho,$gho, $ram_mb, $disk_mb,
                           OnReboot => 'preserve',
@@ -163,9 +160,7 @@ END
         target_putfilecontents_root_stash($ho, 10, kickstart(),
                                           "$newiso/ks.cfg");
 
-        target_cmd_root($ho, <<END, $isotimeout);
-            genisoimage -o $gho->{Rimage} @isogen_base @isogen_boot $newiso/.
-END
+        create_iso_genisoimage($ho, $gho->{Rimage}, $newiso, $isotimeout, 
@isogen);
     });
 }
 
-- 
1.7.10.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®.