]> xenbits.xensource.com Git - osstest.git/commitdiff
ts-debian-hvm-install: Defer preseed generation
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 21 Sep 2015 14:13:23 +0000 (15:13 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 22 Sep 2015 15:34:16 +0000 (16:34 +0100)
Defer preseed file generation until after we have fetched and looked
inside the install image, because we are going to want to make changes
to the preseed file based on the image contents.

No overall functional change, although some things happen in a
different order now, and the ISO manipulation takes place in two calls
to target_cmd_root rather than one.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v4: New patch.  Needed because otherwise the test for the grub install
    image (to be introduced in the next patch) happens before the ISO
    is unpacked, and we would then always fall back to isolinux.

ts-debian-hvm-install

index 3b93ebd594dcd5e6dc0e18c4dff0a2feb9ff683f..bb79d5970b62425c2122a38bc7bf2a1fbbb2ac64 100755 (executable)
@@ -200,13 +200,9 @@ sub prep () {
                           -b boot/grub/efi.img
                           -no-emul-boot
                           -r);
-    my @isogen_opts = (iso_gen_flags_basic(), @isogen_extra);
 
     iso_create_empty($ho, $emptyiso, $emptydir);
 
-    target_putfilecontents_root_stash($ho, 10, preseed(),
-                                      $preseed_file_path);
-
     # If host has >8G free memory, create a guest with 4G memory to catch
     # any error that triggers cross 4G boundary
     my $host_freemem_mb = host_get_free_memory($ho);
@@ -224,8 +220,16 @@ sub prep () {
                           Bios => $r{bios},
                           PostImageHook => sub {
         my $cmds = iso_copy_content_from_image($gho, $newiso);
-        $cmds .= prepare_initrd($initrddir,$newiso,$preseed_file_path);
         target_cmd_root($ho, $cmds, $isotimeout);
+
+        my @isogen_opts = (iso_gen_flags_basic(), @isogen_extra);
+
+        target_putfilecontents_root_stash($ho, 10, preseed(),
+                                          $preseed_file_path);
+
+        $cmds = prepare_initrd($initrddir,$newiso,$preseed_file_path);
+        target_cmd_root($ho, $cmds, $isotimeout);
+
         target_putfilecontents_root_stash($ho, 10, grub_cfg(),
                                           "$newiso/debian/boot/grub/grub.cfg");