Page MenuHomeFreeBSD

UPDATING: update notes on EFI booting
ClosedPublic

Authored by imp on Sep 20 2022, 3:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 28, 4:32 AM
Unknown Object (File)
Fri, May 24, 9:05 AM
Unknown Object (File)
Tue, May 21, 12:20 PM
Unknown Object (File)
Sun, May 12, 8:13 PM
Unknown Object (File)
Sat, May 11, 9:34 PM
Unknown Object (File)
Apr 27 2024, 7:54 AM
Unknown Object (File)
Apr 26 2024, 2:57 AM
Unknown Object (File)
Apr 24 2024, 12:25 AM

Details

Summary

The notes on EFI booting and updating for ZFS had become dated and only
partially updated. Expand the notes with a few more details and a
pointer to laoder.efi(8) and uefi(8).

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Sep 20 2022, 3:47 AM
imp created this revision.
markmi_dsl-only.net added inline comments.
UPDATING
2569

The modern release/tools/arm.subr sets up . . .

For MBR:

/dev/msdosfs/MSDOSBOOT    /boot/msdos     msdosfs rw,noatime      0       0

For GPT:

/dev/msdosfs/EFI          /boot/efi       msdosfs rw,noatime      0       0

Also used for filling in the content is:

chroot ${CHROOTDIR} mkdir -p ${FATMOUNT}/EFI/BOOT
chroot ${CHROOTDIR} cp -p ${BOOTFILES}/efi/loader_lua/loader_lua.efi \
                ${FATMOUNT}/EFI/BOOT/$(efi_boot_name ${EMBEDDED_TARGET})

where efi_boot_name produces lower case names.

The use of the mount points and such for the resulting setup these leads to freebsd/UFS paths like (aarch64 examples):

/boot/msdos/EFI/BOOT/bootaa64.efi
/boot/efi/EFI/BOOT/bootaa64.efi

This seems likely to lead to various confusions/questions for those having this type of context involved.

UPDATING
2569

The 32-bit arm userbase is tiny. I don't want to make this more complex for them.
i should just fix that so we always mount/use the now-standard /boot/efi like all the installer images use.
The 64-bit arm userbase, though is a bit larger, so I'm unsure there.
But if I document this at all, it will be in uefi(8) since UPDATING is supposed to be small and of the most use for the most number of users.

Hopefully this documentation will find itself into a more permanent location too.

UPDATING
2545

"choices" might not be the right word; it sounds like the choice is arbitrary. Maybe "alternative configurations"?

Also, maybe a reference to efibootmgr -v to see which loader location is in use?

2547

maybe "ESP is on ada0, partition p1"?

2553

s/There's/There are/

update, per reviews... not sure about being extra verbose
on ada0p1 update just yet...

pauamma_gundo.com added inline comments.
UPDATING
2545

Not "many" unless there really are more than ~10. Unlikely on most installations, I would think.

2547
2553
2560–2562

Maybe s/newer/recent/ or s/newer/more recent/ (and in that case s/older/less recent/)

Or better yet, use versions, eg FreeBSD12.3 loader.efi fits but 13.1 doesn't.

2570

zfs upgrade, or zpool upgrade? (Note use of zpool upgrade earlier.)

This revision now requires changes to proceed.Sep 21 2022, 10:32 PM
UPDATING
2569

FYI:

# grep -r 'PART_SCHEME="MBR"' /usr/main-src/release/
/usr/main-src/release/arm64/RPI.conf:PART_SCHEME="MBR"
/usr/main-src/release/arm/GENERICSD.conf:PART_SCHEME="MBR"
/usr/main-src/release/arm/RPI-B.conf:PART_SCHEME="MBR"

Also: release/tools/arm.subr is used for aarch64, as well as armv7/armv6. Currently RPI.conf is the only aarch64 using MBR under release. GENERICSD.conf is for armv7 and RPI-B.conf is for the only armv6 .

updates inspired by pau's feedback and feeling like I was getting too defensive
about my text (which in the past is a sign it likely sucked and needed to be
rewritten / reorganized which I've done).

UPDATING
2545

I should update this... I changed this to:
"There are three configurations for FreeBSD EFI bootstraps."
(but maybe a s/bootstraps/booting/ is in order here and below since bootstrapping seems too verbose and adds no value over booting.

2547

Thanks

2560–2562

That suggestion likely won't have much value. The ESPs for old setups are truly tiny and even an old loader.efi would be too huge. Plus, loaders that old won't be able to load latter-day ZFS pools which is a primary reason to upgrade.

2570

you are correct. Both exist and I was confused about which is the typical trigger. zpool upgrade is the right one.

I redid things to be a bit simpler and less repetitive. Please comment

UPDATING
2569

I picked notation that is ambiguous for GENERICSD.conf , as it turns out:

# grep -r PART_SCHEME= /usr/main-src/release/
/usr/main-src/release/arm64/RPI.conf:PART_SCHEME="MBR"
/usr/main-src/release/arm64/PINE64.conf:PART_SCHEME="GPT"
/usr/main-src/release/arm64/ROCKPRO64.conf:PART_SCHEME="GPT"
/usr/main-src/release/arm64/PINE64-LTS.conf:PART_SCHEME="GPT"
/usr/main-src/release/arm64/ROCK64.conf:PART_SCHEME="GPT"
/usr/main-src/release/arm64/PINEBOOK.conf:PART_SCHEME="GPT"
/usr/main-src/release/riscv/GENERICSD.conf:PART_SCHEME="GPT"
/usr/main-src/release/arm/GENERICSD.conf:PART_SCHEME="MBR"
/usr/main-src/release/arm/RPI-B.conf:PART_SCHEME="MBR"

arm/GENERICSD.conf is MBR but riscv/GENERICSD.conf is GPT . Also, release/tools/arm.subr covers riscv as well, if I understand right.

UPDATING
2569

I think despite my grumping, this is addressed in my revisions.
Plus I have another commit that moves it all to /boot/efi so there's no need for multiple locations (though I note it anyway).

UPDATING
2568

however, you must update loader.efi after you do 'zpool upgrade' the

Updating loader.efi before doing the 'zpool upgrade' would be safer. (Imagine a crash between the two operations.)

Ordering is importing...

Nearly here as far as I'm concerned, but can't speak for subject matter experts.

UPDATING
2543
2553
2554
2555–2557

Also, not sure about deficient, which sounds very vague to me. Maybe "buggy"?

2560
2568

Forgot s/after/before/ here?

Or "run 'zpool upgrade' on...."

This revision now requires changes to proceed.Sep 23 2022, 12:54 AM
This revision was not accepted when it landed; it landed in state Needs Revision.Jan 20 2023, 11:18 PM
This revision was automatically updated to reflect the committed changes.