Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(ZFS): update UEFI loader instructions for 13+ #408

Closed
wants to merge 1 commit into from

Conversation

msimerson
Copy link

FreeBSD 13.0+ no longer have boot1.efifat, so replace those instructions with the relevant commands and add reference to loader.efi man page.

FreeBSD 13.0+ no longer have boot1.efifat, so replace those instructions with the relevant commands and add reference to loader.efi man page.
Copy link
Member

@bsdimp bsdimp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

@@ -1335,11 +1335,13 @@ For systems using EFI to boot, execute the following command:

[source,shell]
....
# gpart bootcode -p /boot/boot1.efifat -i 1 ada1
# mount_msdosfs /dev/ada1p1 /boot/efi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default this will automatically be mounted (bsdinstall puts it in fstab) and so will fail with mount_msdosfs: /dev/ada1p1: Device busy. If you need to mount it manually for whatever reason, mount -t msdosfs is better than mount_msdosfs (which is a bit of an implementation detail).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction, it "may fail." You're assuming the disks were created with bsdinstall. There are more than a few FreeBSD disks roaming about that were installed with sysinstall or were manually partitioned to match disks installed long ago.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realise. I deliberately said by default at the start of the sentence to fully acknowledge there are other ways to get a working FreeBSD system. That is, by default it will fail. That doesn't mean it will always fail.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this?

mount -t msdosfs -u /dev/ada1p1 /boot/efi

@@ -1335,11 +1335,13 @@ For systems using EFI to boot, execute the following command:

[source,shell]
....
# gpart bootcode -p /boot/boot1.efifat -i 1 ada1
# mount_msdosfs /dev/ada1p1 /boot/efi
# cp /boot/loader.efi /boot/efi/efi/boot/bootx64.efi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes amd64

Copy link
Author

@msimerson msimerson Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. Most of the other FreeBSD docs I've seen only copy loader.efi to bootx64.efi, as that's correct likely ~99% of the time. The wiki page and man page note there is no 32-bit UEFI support.

The two options 'x64' and 'aa64' would cover probably 99.9% of cases.

# cp /boot/loader.efi /boot/efi/efi/boot/bootx64.efi
or
# cp /boot/loader.efi /boot/efi/efi/boot/bootaa64.efi

To cover all cases, perhaps borrow from the convention used in the loader.efi man page?

# cp /boot/loader.efi /boot/efi/efi/boot/bootXXX.efi (see uefi(8) for values to replace ‘XXX’ with)

I don't have enough knowledge to explain why we don't just direct users to only copy it to the designated FreeBSD spot:

# cp /boot/loader.efi /boot/efi/efi/freebsd/loader.efi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to follow the same approach as loader.efi(8). Both locations are important, but which is more important depends on your system. Only updating the removable media path would be wrong for most desktop and server systems. Only updating the FreeBSD-specific path would be wrong for most SBC systems.

@sergio-carlavilla
Copy link
Contributor

Any news with this patch?
@jrtc27 @msimerson

@msimerson
Copy link
Author

The current instructions are still completely broken for supported versions of FreeBSD.

This patch makes them much less broken, but only for the vast majority of FreeBSD users. My interest in improving the docs has been exhausted by perfect standing in the way of better.

@jrtc27
Copy link
Contributor

jrtc27 commented Jan 19, 2025

The current instructions are still completely broken for supported versions of FreeBSD.

This patch makes them much less broken, but only for the vast majority of FreeBSD users. My interest in improving the docs has been exhausted by perfect standing in the way of better.

No. The instructions you have provided do not work for the vast majority of FreeBSD users, because they only update the removable media path, which is not what a normal desktop/server installed via bsdinstall will be using.

@msimerson msimerson closed this Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants