So this actually turned out ot be very simple.  I made the following
change, and tested it in the following ways:

1)  Boot in efi mode, do a use whole disk install.  It created an efi system 
partition and used grub-efi.
2)  Boot in efi mode, manually partition, remove the efi system partition, and 
replace it with bios_grub.  It uses grub-pc, and booted fine in bios mode.
2)  Installed 13.10 in bios mode, with an mbr partition table.  Boot trusty in 
efi mode and do an along side install.  It correctly used grub-pc, and boots 
fine in bios mode.

The patch is just this simple:

=== modified file 'grub-installer'
--- grub-installer      2014-03-28 13:11:31 +0000
+++ grub-installer      2014-04-08 16:22:27 +0000
@@ -442,6 +442,10 @@
        else
                grub_package="grub-efi"
        fi
+       if ! [ -d /target/boot/efi ]; then
+               #fall back to grub-pc
+               grub_package="grub-pc"
+       fi
        ;;
     powerpc/*)
        grub_package="grub-ieee1275"


I did notice two odd things in this process.  The first is that when you 
manually partition the disk and don't have an esp, you get warned that you need 
one, but this warning does not happen when you do the guided install.  I 
thought Colin mentioned on IRC that this warning should happen no matter how 
you get there.  The second is that the menu option for the firmware setup that 
only applies for efi installs is still generated on the grub menu, even though 
we used grub-pc.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1302418

Title:
  grub-installer should fall back to grub-pc instead of grub-efi when
  there is no EFI system partition

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub-installer/+bug/1302418/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to