Bug 193595 - bsdinstall should enable UEFI booting if booted from UEFI
Summary: bsdinstall should enable UEFI booting if booted from UEFI
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-BETA1
Hardware: amd64 Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords: uefi
Depends on:
Blocks:
 
Reported: 2014-09-13 04:25 UTC by Colin Percival
Modified: 2014-09-18 21:01 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Colin Percival freebsd_committer 2014-09-13 04:25:27 UTC
I just installed FreeBSD 10.1-BETA1 from the UEFI memstick image.  It installed fine, but then when I rebooted I had to tell my laptop to switch back to legacy boot.  The installer should detect that it has been booted via UEFI and set up the installed system to boot via UEFI.
Comment 1 Nathan Whitehorn freebsd_committer 2014-09-13 04:36:00 UTC
It does this already. Could you provide some more details on your setup?

Are you sure you booted via UEFI? The UEFI memstick image is setup with boot blocks both for UEFI and BIOS. What is the machdep.bootmethod sysctl set to when you boot from the memstick? If it's set to UEFI (which it should be if you booted via UEFI), the installer will produce something that won't even boot via CSM.
Comment 2 Colin Percival freebsd_committer 2014-09-13 05:12:05 UTC
In my laptop's BIOS, there is an option of "UEFI boot" or "legacy boot".  I set this to "UEFI boot".  I then booted from the UEFI memstick image.  When I rebooted, my laptop wouldn't boot until I set the BIOS back to "legacy boot".

When booted from the memstick, machdep.bootmethod is UEFI.  When booted (in "legacy mode") from the installed image, it is BIOS.
Comment 3 Nathan Whitehorn freebsd_committer 2014-09-13 05:15:38 UTC
That's really strange. Did you use ZFS or UFS for installation? We don't support ZFS boot with UEFI.
Comment 4 Colin Percival freebsd_committer 2014-09-13 05:18:36 UTC
Aha!  That explains it.  Yes, I used ZFS.

... if we can't support this for some reason, can we at least have some warnings?
Comment 5 Nathan Whitehorn freebsd_committer 2014-09-13 05:51:30 UTC
The UEFI boot blocks only support UFS. We could just disable the alternative ZFS installation path on UEFI systems (which uses a separate program) on x86 systems booted via UEFI. There's already some logic here for all non-x86 platforms, which also don't support ZFS booting. Would that make sense to you?
Comment 6 Colin Percival freebsd_committer 2014-09-13 06:25:52 UTC
I'd say that if machdep.bootmethod is UEFI and the user selects ZFS booting, they should get a "ZFS booting is not supported on UEFI, your system will be set up for legacy booting" warning message.  That would avoid the astonishment I experienced while allowing users the option of changing their selection if using UEFI is important to them.  (In my case, my laptop does support legacy booting, so I'll probably stick with ZFS in spite of the lack of UEFI support, but some people will definitely need UEFI -- so we can't assume that one solution will be right for everybody.)
Comment 7 Nathan Whitehorn freebsd_committer 2014-09-13 06:32:02 UTC
That makes sense. Most UEFI systems do at least allow CSM booting, so just banning it is indeed not the right choice. I'll try to get that in tomorrow. Longer term, what we really need is ZFS support in the UEFI bootblocks (ideally, we could also use the same bootblocks for BIOS for UFS and ZFS, but maybe that's a pipe dream).
Comment 8 commit-hook freebsd_committer 2014-09-14 01:57:32 UTC
A commit references this bug:

Author: allanjude
Date: Sun Sep 14 01:57:23 UTC 2014
New revision: 271563
URL: http://svnweb.freebsd.org/changeset/base/271563

Log:
  Make the root-on-zfs part of the installer warn a user who booted the installer via UEFI that we do not support booting ZFS via UEFI yet

  PR:		193595
  Approved by:	nwhitehorn
  MFC after:	5 days
  Sponsored by:	ScaleEngine Inc.
  CR:		https://reviews.freebsd.org/D782

Changes:
  head/usr.sbin/bsdinstall/scripts/zfsboot
Comment 9 Ed Maste freebsd_committer 2014-09-14 15:10:07 UTC
Also note that the installer UEFI support has not yet been merged to stable/10.

I have at least the following commits in the list:

r264978
r265016
r268256
Comment 10 commit-hook freebsd_committer 2014-09-18 17:04:48 UTC
A commit references this bug:

Author: allanjude
Date: Thu Sep 18 17:03:53 UTC 2014
New revision: 271790
URL: http://svnweb.freebsd.org/changeset/base/271790

Log:
  MFC r271563:
  Make the root-on-zfs part of the installer warn a user who booted the
  installer via UEFI that we do not support booting ZFS via UEFI yet

  PR:		193595
  Approved by:	re (gjb), nwhitehorn
  Sponsored by:	ScaleEngine Inc.

Changes:
_U  stable/10/
  stable/10/usr.sbin/bsdinstall/scripts/zfsboot
Comment 11 Nathan Whitehorn freebsd_committer 2014-09-18 21:01:21 UTC
Fix made and MFCed.