]> xenbits.xensource.com Git - osstest.git/commitdiff
ts-debian-hvm-install: Cope with images containing only isolinux
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 18 Sep 2015 14:30:57 +0000 (15:30 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 22 Sep 2015 15:34:20 +0000 (16:34 +0100)
debian-7.2.0-i386-CD-1.iso contains no grub, only isolinux.

If the specified EFI grub file does not exist, fall back to isolinux.
This requires a -c option as well, according to
  https://wiki.debian.org/DebianInstaller/Modify/CD

Only try to set up a grub config if we are booting grub.  (The i386
image in question does not contain a [debian]/boot/grub directory.)

If boot/grub/efi.img _does_ exist (ie, for other existing tests), the
only difference in behaviour is to reorder slightly the options to
genisoimage: `-b boot/grub/efi.img' now occurs after `-no-emul-boot
-r' rather than before.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
v4: Log $bootfile value.
    Preseed generation now happens later due to previous patch;
      so $bootfile setting now also deferred.  Context change only.

ts-debian-hvm-install

index bb79d5970b62425c2122a38bc7bf2a1fbbb2ac64..5197f9b49a80ae6e2c3443a0f01e35390d2cab3e 100755 (executable)
@@ -197,7 +197,6 @@ sub prep () {
     my $preseed_file_path = $base . "preseed";
 
     my @isogen_extra = qw(-eltorito-alt-boot
-                          -b boot/grub/efi.img
                           -no-emul-boot
                           -r);
 
@@ -222,6 +221,14 @@ sub prep () {
         my $cmds = iso_copy_content_from_image($gho, $newiso);
         target_cmd_root($ho, $cmds, $isotimeout);
 
+        my $bootfile = 'boot/grub/efi.img';
+        if (!target_file_exists($ho, "$newiso/$bootfile")) {
+            $bootfile = "isolinux/isolinux.bin";
+            push @isogen_extra, qw(-c isolinux/boot.cat);
+        }
+        logm("using boot image $bootfile");
+        push @isogen_extra, '-b', $bootfile;
+
         my @isogen_opts = (iso_gen_flags_basic(), @isogen_extra);
 
         target_putfilecontents_root_stash($ho, 10, preseed(),
@@ -231,7 +238,8 @@ sub prep () {
         target_cmd_root($ho, $cmds, $isotimeout);
 
         target_putfilecontents_root_stash($ho, 10, grub_cfg(),
-                                          "$newiso/debian/boot/grub/grub.cfg");
+                                          "$newiso/debian/boot/grub/grub.cfg")
+           if $bootfile =~ m/grub/;
 
         target_putfilecontents_root_stash($ho, 10, isolinux_cfg(),
                                           "$newiso/isolinux/isolinux.cfg");