Page MenuHomeFreeBSD

Move EFI FAT creation to here to obviate need for the boot1.efifat file
ClosedPublic

Authored by nwhitehorn on Sep 10 2017, 5:33 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 13, 8:51 PM
Unknown Object (File)
Tue, Apr 9, 2:49 AM
Unknown Object (File)
Tue, Apr 9, 1:54 AM
Unknown Object (File)
Thu, Apr 4, 11:42 AM
Unknown Object (File)
Mar 17 2024, 7:28 AM
Unknown Object (File)
Feb 6 2024, 10:06 AM
Unknown Object (File)
Feb 6 2024, 8:27 AM
Unknown Object (File)
Feb 4 2024, 10:37 PM

Details

Summary

Only call partcode_path once.

Sponsored by: Netflix

Allow FAT filesystems to be created

Allow a platform to specify a FAT filesystem is to be created. On such
platforms, make a FAT and copy files to it. This is prototype code,
and the actual code likely should call a standardized script to do
this (which, in general, this part stuff should have been done with,
but that's a bigget change.

Sponsored by: Netflix

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 14686

Event Timeline

Let the comments begin :)

usr.sbin/bsdinstall/partedit/gpart_ops.c
450 ↗(On Diff #32868)

The more I think of it, the more I am going to create such a script so we can also do u-boot installs in the future if we wanted (though that's even more complex a can of worms).

460 ↗(On Diff #32868)

/tmp/junk is obviously lame and should be replaced, perhaps, with something unique. Don't know all the envs this runs in enough to say if that's absolutely needed or not.

Plus the use of sprintf instead of snprintf (or even better asprintf) makes my skin crawl, but that's how the rest of the file is written.

809 ↗(On Diff #32868)

Sorry for this, and the other, gratuitous white space changes.

usr.sbin/bsdinstall/partedit/partedit_arm64.c
99 ↗(On Diff #32868)

This is also bogus.

usr.sbin/bsdinstall/partedit/partedit_x86.c
145

This change shouldn't be made. It's a vestige of an earlier plan.

Move all the white space changes to a separate commit
Fix some issues with returning the wrong thing
Simplify the system call (though I think we may just want to have a popen

to a script that knows all the cases and rip out most of the knowledge
from here so all creators of images / disks can use it).
imp marked 4 inline comments as done.Sep 10 2017, 5:21 PM
allanjude added inline comments.
usr.sbin/bsdinstall/partedit/gpart_ops.c
452 ↗(On Diff #32889)

You will need to use -F 16 here, since the ESP is 200MB now.

Otherwise you only get a 24MB filesystem:

newfs_msdos: warning: FAT type limits file system to 65416 sectors
/dev/md0: 65344 sectors in 4084 FAT12 clusters (8192 bytes/cluster)
BytesPerSec=512 SecPerClust=16 ResSectors=1 FATs=2 RootDirEnts=512 Sectors=65416 Media=0xf0 FATsecs=12 SecPerTrack=63 Heads=16 HiddenSecs=0

Filesystem Size Used Avail Capacity Mounted on
/dev/md0 24M 16K 24M 0% /mnt

This revision now requires changes to proceed.Sep 11 2017, 12:32 AM
nwhitehorn edited reviewers, added: imp; removed: nwhitehorn.

The framework in the install to support this ended up being a little different. The updated diff is attached.

This revision is now accepted and ready to land.Jan 31 2018, 12:55 AM

This is missing changes for arm and arm64. They also do efi booting and have the horrific boot.efifat hack as well. At least if we support installing from them...

In D12302#296712, @imp wrote:

This is missing changes for arm and arm64. They also do efi booting and have the horrific boot.efifat hack as well. At least if we support installing from them...

For arm64 we absolutely do, performing an install from memstick on arm64 functions exactly as on amd64.

Yes, this is a WIP. Is there anything different about ARM[64] EFI boot vs. amd64? I don't have any such hardware to test on, but I would guess this code can basically be copied and pasted.

Overtaken by events long ago.