svn commit: r323554 - head/sys/boot/efi/boot1
Allan Jude
allanjude at freebsd.org
Wed Sep 13 17:03:03 UTC 2017
On 2017-09-13 13:00, Allan Jude wrote:
> Author: allanjude
> Date: Wed Sep 13 17:00:02 2017
> New Revision: 323554
> URL: https://svnweb.freebsd.org/changeset/base/323554
>
> Log:
> Increase EFI boot file size frok 128k to 384k
>
> generate_fat.sh does the following:
> - create an 800kb zero-filled file
> - create an md device backed by this file
> - format the device fat12
> - mount the filesystem
> - create the EFI ESP directory structure
> - create the EFI boot file (BOOTx64 for amd64, BOOTaa64 for aarch64, etc)
> - Adds a marker to the beginning of the file, and pad it to 384kb
> - 384kb was chosen as it is less than half of 800kb, thus allowing
> users to keep a backup of their older boot file in the small partition
> - Unmount the filesystem
> - Scan the image and find the offset where the marker was inserted
> - The process requires root, to make image generation easier, images for
> each architecture are pregenerated, compressed with xz, and checked
> into svn.
>
> The Makefile that generates boot1.efifat does the following:
> - Ensure the compiled boot1.efi file is no larger than the generated image
> - Decompress the template created by generate-fat.sh
> - dd the contents of boot1.efi into boot1.efifat starting at the offset
> where the marker is found. This allows any file less than the maximum
> size to be written into the fat filesystem without having to mount it,
> so no root privileges are required.
>
> Later work by imp and myself makes bsdinstall create a 200mb fat16 instead
> of using this process, but it is retained to make image generation easier.
>
> Submitted by: Eric McCorkle (original version)
> Reviewed by: emaste, tsoome, Eric McCorkle
> MFC after: 1 month
> Differential Revision: https://reviews.freebsd.org/D9680
>
> Added:
> head/sys/boot/efi/boot1/fat-amd64.tmpl.xz (contents, props changed)
> head/sys/boot/efi/boot1/fat-arm.tmpl.xz (contents, props changed)
> head/sys/boot/efi/boot1/fat-arm64.tmpl.xz (contents, props changed)
> head/sys/boot/efi/boot1/fat-i386.tmpl.xz (contents, props changed)
> Deleted:
> head/sys/boot/efi/boot1/fat-amd64.tmpl.bz2.uu
> head/sys/boot/efi/boot1/fat-arm.tmpl.bz2.uu
> head/sys/boot/efi/boot1/fat-arm64.tmpl.bz2.uu
> head/sys/boot/efi/boot1/fat-i386.tmpl.bz2.uu
> Modified:
> head/sys/boot/efi/boot1/Makefile
> head/sys/boot/efi/boot1/Makefile.fat
> head/sys/boot/efi/boot1/generate-fat.sh
>
I forgot to mention:
I did away with uuencoding the binary files, because svn and git can
handle binary files just fine, and it was just silly.
I switched from bzip to xzip, as we are getting away from using bzip as
a part of the toolchain.
--
Allan Jude
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20170913/dff68005/attachment.sig>
More information about the svn-src-all
mailing list