-
Notifications
You must be signed in to change notification settings - Fork 205
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
Recognize efi partition (0xef) as a valid boot #126
Comments
Related to #120 ? |
If/when GPT + EFI this will just work. Not adding any workarounds before then |
I don't see how this is related to #120 and I'm not talking about gpt here. |
And FYI, not having ESP support currently makes vanilla Debian 10 installation on an SD card more troublesome than it should be (when using the official UEFI firmware as However, by not having the ability to boot from a FAT/FAT32 partition of type Considering that we are seeing a lot of interest in the Pi3 and Pi4 UEFI firmware (which are now an official part of the EDK2), being able to use a formal ESP as the partition from which a Raspberry Pi can fetch its boot files from would be a great plus. And since ESPs can exist on either GPT or MBR partitioned disks, and the Pis already support MBR/ |
The 2711 (and earlier) ROMs do not recognise 0xef as a FAT partition so on Pi3 it won't be possible to load bootcode.bin from that partition and on Pi4 it will prevent recovery.bin from being loaded. Therefore Pi4 would still need a 0xc or 0xe partition for recovery.bin bootloader upgrades even if the SPI bootloader recognises 0xef as a FAT partition. |
The information we have found, from reverse engineering the mask ROM from the Pi 4 Bcm2711 indicates that it should be able to boot a Anyone can try the following, using the files from https://github.com/raspberrypi/rpi-eeprom/releases/tag/v2020.04.16-137ad:
Unlike what would be expected if the mask ROM did not have the capability to read a So, at the very least, the Bcm2711 ROM has code that is able to list FAT content from an ESP, be it a GPT or MBR one, and, depending on the presence or absence of a In other words, from what we are seeing, it does seem like at least the 2711 does recognise Maybe we are missing something here, but if you could shed some more light on this, and why we are observing the results above on the Pi 4, we would appreciate it. |
The ROM doesn't explicitly handle this partition type. For GPT it looks for EFI or BasicData GUIDs and for MBR it will failover to assuming FAT if it doesn't find a recognized type. The Pi4 bootloader and start.elf support GPT (USB only) in the USB mass-storage updates and when the changes are made to support this in start.elf SD file-system it would be reasonable to recognize 0xef as another FAT partition. It should be safe because very few Pi users will have a partition of this type in addition to the regular FAT boot partition containing start.elf |
That makes sense. Thanks for clarifying.
I'm understanding this to mean that you are considering adding support for MBR/ |
Yep, it will be done. Probably in the next couple of weeks, just need to get the current rather large USB boot changes out of the door or more precisely, off a topic branch and into mainline! |
* Resolve: USB boot fails if the GPT contains no basic data or EFI partitions #130 * Resolve: Fix default BOOT_ORDER in mass storage beta #129 * Resolve: Add support for booting from a "superfloppy" disk #120 * Resolve: USB MSD timeout message - incorrect units #131 * Resolve: Recognize efi partition (0xef) as a valid boot #126 * The HDMI diagnostics screen now displays the most significant bytes of the SHA-256 of the config.txt file.
This should be fixed by e87bc4d The binaries are available in this release which can be flashed using the Raspberry Pi Imager |
From my testing, this seems to work great for USB drives, so many thanks for following up on this! However, I can't see to get the expected results from SD. On SD, I can see You should be able to validate this by performing the test below Prerequistes
Test
Considering that the same test (MBR/ |
Unfortunately, the SD card drivers in start.elf are from a different legacy stack which will need updating for this to work. That will be available in rpi-update but it's not started yet. |
Understood. I'm just glad to hear that this is a known limitation and that you are working on removing it, even if that may take a while. The newly added USB support for ESP and GPT works beautifully as far as I'm concerned, so keep up the good work! |
Great, thanks for the test. I'll mark this as closed but will post an update here as soon as the SD firmware changes are done. Feel free to nag if it's not done by the end of next week. |
@pbatard ok, it took slightly longer than expected to get around to doing this but I've now updated the GPU firmware to support booting from a pure GPT partition table on sd-cards. The linked firmware "works for me" but is not merged into a release branch yet, if you are able to try this (with the latest stable bootloader) then that would be great! https://drive.google.com/drive/folders/1Qn6uAkgYntUr6Pu7OIgWxnHXEv_FeHJw |
Thanks a lot for following up on this. I have just tested the files you linked too, and I can confirm that direct boot from a MBR ESP (type In other words, just like we requested, it is now possible to boot the Pi 4 from just an ESP, be it GPT or MBR, or be it located on SD or USB. This is awesome, and it should really help with UEFI environments, as this allows the installation of OSes in UEFI mode, while ensuring that the Pi 4 boot files, that reside on the ESP, are preserved through the installation process. Once we have fixed a few open items, this will for instance enable the installation of vanilla Debian ARM64 as easily as if you were installing it on a UEFI PC, through a single drive where you simply extracted Debian's |
Oh and just to confirm, I have tested GPT ESP from SD card as well, and saw no issue. |
@pbatard Thanks for the test, it's been merged so should appear in rpi-update before too long. |
Normal vfat partitions with id 0xef are not seen as valid boot partitions, changing it to 0xc makes it work, but make it more complicated for using generic images for different devices.
The text was updated successfully, but these errors were encountered: