Bug 201898

Summary: [bsdinstall] UEFI boot partition parameters
Product: Base System Reporter: Tomasz "CeDeROM" CEDRO <tomek>
Component: binAssignee: freebsd-bugs mailing list <bugs>
Status: Closed FIXED    
Severity: Affects Many People CC: emaste, ganael.laplanche, op
Priority: --- Keywords: uefi
Version: 10.1-RELEASEFlags: emaste: mfc-stable11+
emaste: mfc-stable10+
Hardware: amd64   
OS: Any   
Bug Depends on:    
Bug Blocks: 203349    

Description Tomasz "CeDeROM" CEDRO 2015-07-26 18:57:00 UTC
I have managed to install FreeBSD 10.1-RELEASE on UEFI AMD64 machine.

UEFI requires AMD64 and GPT partition scheme.

UEFI requires dedicated EFI FAT partition with the bootstrap loader code.

FreeBSD already contains this partition image which is stored in /boot/boot1.efifat. This file so far is 800k. Default boot partition size is 512k.

In BSDInstall it is possible to create GPT partitions. When creating freebsd-ufs, the installer recommends to create additional boot partition. But this partition does not meet UEFI requirements.

Please update bsdinstall so it creates EFI BOOT partition type 10M size (MS Windows makes it 100M) when using GPT [1]. It would be nice if bsdinstall also makes dd of /boot/boot1.efifat onto that partition during install, so user can boot in UEFI after install.

Thank you! :-)
Tomek

[1] https://wiki.freebsd.org/UEFI#Bootable_UEFI_memory_stick
Comment 1 Ed Maste freebsd_committer 2017-06-16 14:09:57 UTC
This was done in r302145 - the partition size is 200M. This is prior to the stable/11 branch, so this is the case from 11.0 on. I will add it to my queue to merge to 10 in advance of 10.4.
Comment 2 commit-hook freebsd_committer 2017-06-16 18:59:22 UTC
A commit references this bug:

Author: emaste
Date: Fri Jun 16 18:58:48 UTC 2017
New revision: 320007
URL: https://svnweb.freebsd.org/changeset/base/320007

Log:
  bsdinstall: use consistent EFI configuration across platforms

  - increase arm64 EFI partition to 200M, as x86
  - use EFI_BOOTPART_SIZE and EFI_BOOTPART_PATH macros on x86
  - increase ZFS EFI partition to 200M

  PR:		201898
  Reviewed by:	allanjude, manu
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D11239

Changes:
  head/usr.sbin/bsdinstall/partedit/partedit_arm64.c
  head/usr.sbin/bsdinstall/partedit/partedit_x86.c
  head/usr.sbin/bsdinstall/scripts/zfsboot
Comment 3 commit-hook freebsd_committer 2017-06-19 03:07:40 UTC
A commit references this bug:

Author: emaste
Date: Mon Jun 19 03:07:00 UTC 2017
New revision: 320088
URL: https://svnweb.freebsd.org/changeset/base/320088

Log:
  bsdinstall: use consistent EFI configuration across platforms

  MFC r320007:
  - increase arm64 EFI partition to 200M, as x86
  - use EFI_BOOTPART_SIZE and EFI_BOOTPART_PATH macros on x86
  - increase ZFS EFI partition to 200M

  MFC r320008: bsdinstall: correct comment after r320007

  PR:		201898
  Approved by:	re (kib)
  Relnotes:	Yes
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/11/
  stable/11/usr.sbin/bsdinstall/partedit/partedit_arm64.c
  stable/11/usr.sbin/bsdinstall/partedit/partedit_x86.c
  stable/11/usr.sbin/bsdinstall/scripts/zfsboot
Comment 4 Ganael LAPLANCHE freebsd_committer 2017-06-19 12:06:34 UTC
*** Bug 212604 has been marked as a duplicate of this bug. ***
Comment 5 commit-hook freebsd_committer 2017-07-19 14:16:08 UTC
A commit references this bug:

Author: emaste
Date: Wed Jul 19 14:15:49 UTC 2017
New revision: 321202
URL: https://svnweb.freebsd.org/changeset/base/321202

Log:
  MFC r302145: bsdinstall: increase EFI partition size to 200MB

  A larger EFI file system size will facilitate multi-boot configurations
  and the installation other EFI applications like firmware update tools.
  200MB matches OS X.

  Note that this changes only the partition size, not the file system that
  bsdinstall places there. We need to do both, but as the partition size
  is difficult to adjust later make this change for now so that at least
  systems installed with FreeBSD 11.0 have a partition layout with room
  to grow.

  Also merge part of r320007:

  - use EFI_BOOTPART_SIZE and EFI_BOOTPART_PATH macros on x86
  - increase ZFS EFI partition to 200M

  PR:		201898
  Relnotes:	Yes
  Sponsored by:	The FreeBSD Foundation

Changes:
_U  stable/10/
  stable/10/usr.sbin/bsdinstall/partedit/partedit_x86.c
  stable/10/usr.sbin/bsdinstall/scripts/zfsboot