Bug 212648 - [EFI] Increase size of boot1.efifat
Summary: [EFI] Increase size of boot1.efifat
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs mailing list
URL:
Keywords: install, patch
Depends on:
Blocks:
 
Reported: 2016-09-13 10:50 UTC by Ganael LAPLANCHE
Modified: 2018-03-26 02:26 UTC (History)
5 users (show)

See Also:


Attachments
Patch to increase boot1.efifat size (1.75 KB, text/plain)
2016-09-13 10:50 UTC, Ganael LAPLANCHE
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ganael LAPLANCHE 2016-09-13 10:50:54 UTC
Created attachment 174717 [details]
Patch to increase boot1.efifat size

This patch is a follow-up to PR 212604.

Now that ESP size has been enlarged to 200m, find attached a patch the enables the creation of a 200m boot1.efifat image.

- EFI partition is now FAT32 (as found on Linux distributions) and uses 4 sectors per cluster (arbitrary value to overcome the "too few clusters for FAT32" error reported by newfs_msdos)
- zfsboot script now uses dd to write partition data as gpart bootcode has a (arbitrary) hardcoded limit of 1MB files
- Do not forget to regenerate sys/boot/efi/boot1/fat*.tmpl.bz2.uu and sys/boot/efi/boot1/Makefile.fat files using sys/boot/efi/boot1/generate-fat.sh !
- Successfully tested on a Supermicro X9SRI-F motherboard (patch *NOT* tested on other platforms: arm, arm64, i386)
- We will probably have to remove boot1.efifat from media where it is useless and stored uncompressed (e.g. CD ISOs) as adding 200 MB is unacceptable there

Note: this patch includes ESP size increase patch from: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212604
Comment 1 Ed Maste freebsd_committer 2017-10-13 14:03:12 UTC
What we really need to do is have the installer start creating the FAT ESP filesystem at install time (and copying boot1.efi in), rather than using this pre-created FAT filesystem image.
Comment 2 Ganael LAPLANCHE freebsd_committer 2017-10-16 11:14:17 UTC
Hi Ed,

Yes, I've seen the comments in r323554. I totally agree with that direction, so I'll close that PR.

Thanks :)
Comment 3 vas 2018-03-23 06:51:11 UTC
I have just installed 11.1-RELEASE and the resulting EFI partition is still too small. No room to place useful utilities, like the rEFInd Boot Manager.

Why is this bug marked as closed?
Comment 4 Eugene Grosbein freebsd_committer 2018-03-23 12:04:28 UTC
(In reply to vas from comment #3)

The PR was filed against CURRENT, not STABLE. Anyway, the fix has already been merged to stable/11 too.
Comment 5 vas 2018-03-23 17:02:44 UTC
(In reply to Eugene Grosbein from comment #4)
Can I expect the fix in 11.2-RELEASE?
Comment 6 Eugene Grosbein freebsd_committer 2018-03-23 17:07:57 UTC
(In reply to vas from comment #5)

Yes. You should also test if it's really working using recent 11.1-STABLE snapshot image: https://download.freebsd.org/ftp/snapshots/ISO-IMAGES/11.1/?C=M&O=D
Comment 7 Ed Maste freebsd_committer 2018-03-23 18:22:26 UTC
Note that the FAT filesystem image is still relatively small, but the EFI system partition is larger. You would need to newfs_msdos the partition and copy the bootloader bits back into the new filesystem to have more space.
Comment 8 vas 2018-03-26 02:26:28 UTC
(In reply to Ed Maste from comment #7)
> Note that the FAT filesystem image is still relatively small, but the EFI system partition is larger. 

Thanks, that's a great workaround. The EFI partition is 200M, more than enough once reformatted.