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

fix the EFI path #3

Open
pdp7 opened this issue Apr 28, 2021 · 8 comments
Open

fix the EFI path #3

pdp7 opened this issue Apr 28, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@pdp7
Copy link
Collaborator

pdp7 commented Apr 28, 2021

Theo de Raadt from OpenBSD contacted me:

The uboot configuration has this:

scan_dev_for_efi=if test -e ${devtype} ${devnum}:${distro_bootpart} efi/fedora/bootriscv64.efi; then echo Found EFI removable media binary efi/fedora/bootriscv64.efi; run scan_dev_for_dtb; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile

Putting /fedora/ in the path like that makes these machines only able to boot
one specific brand of Linux.

I suspect that path should be efi/boot/bootriscv64.efi

So that other operating systems stand a chance of running on this.

@jonathangray
Copy link
Contributor

jonathangray commented Apr 29, 2021

See the UEFI 2.9 specification 3.5.1.1:

To generate a file name when none is present in the FilePath, the firmware must
append a default file name in the form \EFI\BOOT\BOOT{machine type short-name}.EFI

The fedora patches should be dropped. For example fe93fbc 8a6805d and others which are for different architectures/socs entirely.
Fedora must have a way to handle this on amd64/arm64 machines where they do not provide the firmware.

A binary image with these reverted along with instructions would be helpful.
https://github.com/starfive-tech/freelight-u-sdk/blob/starfive/README.md seems to cover the instructions part.

It also isn't clear which repository should be used.
https://github.com/starfive-tech/freelight-u-sdk uses https://github.com/starfive-tech/sft-riscv-opensbi and https://github.com/starfive-tech/sft-riscv-uboot .
https://github.com/starfive-tech/beaglev_fedora uses https://github.com/starfive-tech/beagle_opensbi and https://github.com/starfive-tech/beagle_uboot-opensbi .

Which combination of repositories and branches were used to build the image that shipped in the spi flash of the beta boards?

There is only one repository for the earlier stages
https://github.com/starfive-tech/beagle_secondBoot https://github.com/starfive-tech/beagle_ddrlnit

@pdp7
Copy link
Collaborator Author

pdp7 commented Apr 30, 2021

@jonathangray sorry for the confusion about the repositories.

Wei Fu (@tekkamanninja) is actively cleaning this up so that there will be just a single repo each for opensbi, uboot and Linux. I will make it widely known once @tekkamanninja has finished that cleanup.

For the BeagleV beta developers, I have apost about this in the beaglev-beta forum:
https://forum.beagleboard.org/t/clarification-for-starfive-tech-repos/29535

For BeagleV beta developers that can not access that URL please email me: [email protected]

@pdp7
Copy link
Collaborator Author

pdp7 commented Jul 7, 2021

@tekkamanninja tells me that this will be resolved once we get u-boot executing grub which is the eventual solution needed for Fedora. We also plan in the future to try EDK2 UEFI as well.

@pdp7 pdp7 changed the title OpenBSD and u-boot correct the EFI path Jul 7, 2021
@pdp7 pdp7 changed the title correct the EFI path fix the EFI path Jul 7, 2021
@MichaelZhuxx MichaelZhuxx added the enhancement New feature or request label Jul 9, 2021
@tekkamanninja
Copy link
Collaborator

tekkamanninja commented Aug 24, 2021

@tekkamanninja tells me that this will be resolved once we get u-boot executing grub which is the eventual solution needed for Fedora. We also plan in the future to try EDK2 UEFI as well.

Since today , we have got u-boot executing grub to boot Fedora, so let me try to explain this :

for scan_dev_for_efi, we do not use this for efi file.
the current approach is uboot will import uEnv.txt for distro boot variable, and uEnv.txt is in Image, so every distro image can have their own boot flow.
For current fedora image for BeagleV, it can execute /EFI/Fedora/grubriscv64.efi

for other distro image , we can also execute efi/boot/bootriscv64.efi by modify uEnv.txt for their own Image

@kettenis
Copy link
Contributor

Reviving this thread since we're now adding support for the VisionFive board to OpenBSD.

Customizing images using uEnv.txt doesn't make any sense; the whole point of UEFI is that it allows to boot generic OS images. As a project we simply can't provide separate customized images for each and every board that hits the market. So we only provide a single generic OS image. And I suspect some of the Linux distributions are in the same boat.

While I do think that there should be no need for uEnv.txt, it should be possible to retain this feature, but simply fall back on the default distroboot boot command if no uEnv.txt file is found. I can probably help with the necessary changes in u-boot.

@X547
Copy link

X547 commented Apr 23, 2023

Customizing images using uEnv.txt doesn't make any sense; the whole point of UEFI is that it allows to boot generic OS images. As a project we simply can't provide separate customized images for each and every board that hits the market.

The same for Haiku.

@rpx99
Copy link

rpx99 commented Jul 31, 2023

I would like to see this glitch fixed, too. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants