On Tue, Apr 08, 2014 at 04:28:34PM -0000, Phillip Susi wrote:
> The patch is just this simple:

Thanks.  I'll probably sleep on it just to make sure my hindbrain has
had a chance to come up with objections, but this seems reasonably
plausible.

> 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.

Well, the check applies to the about-to-be-committed state, not the
initial state, so it happens just before committing the results of a
guided partitioning recipe or in the process of confirming manual
partitioning decisions, as appropriate.

Usually guided partitioning would ensure that an ESP exists (if the
target disk uses GPT).  Are you saying that you set up a situation where
guided partitioning should have created an ESP but didn't?  If so, could
you lay out the details?

> 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.

Yeah, the problem here is that the interface that grub.d scripts are
written to doesn't include a mechanism for determining which GRUB
platform is going to be used, and there are strange edge cases where you
might have support for multiple platforms installed in parallel, so it
gets complicated.  Right now we apply the heuristic of testing for a
particular file in /sys/firmware/efi/vars, but this doesn't work here
because now the situation at install-time and boot-time might reasonably
differ.

I think the right answer is to test this at boot time instead, where we
can get a more accurate idea of the available facilities.  The
efifwsetup module already does some of the necessary work: it only
registers the "fwsetup" command if (obviously) the module exists at all
(i.e. we're on EFI) and the appropriate OsIndicationsSupported variable
is set.  This exactly corresponds to the conditions currently tested at
install time by /etc/grub.d/30_uefi-firmware.  So the correct pseudocode
logic is simply:

  if fwsetup command exists; then
    menuentry 'System setup' --id 'uefi-firmware' {
      fwsetup
    }
  fi

There's one rather silly hitch, though.  I don't think there's actually
a way to write the "fwsetup command exists" bit in GRUB script right
now!  It would be a useful general facility to have for scripting, so
I'll take that up with grub-devel.

-- 
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
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to