[PATCH v5 00/12] efi_loader: more tightly integrate UEFI disks to driver model

Heinrich Schuchardt xypron.glpk at gmx.de
Tue Apr 26 15:57:26 CEST 2022


On 4/26/22 01:44, AKASHI Takahiro wrote:
> On Mon, Apr 25, 2022 at 10:43:44PM +0200, Heinrich Schuchardt wrote:
>> On 4/19/22 03:05, AKASHI Takahiro wrote:
>>> With this patch set[1] applied, UEFI subsystem maintains a list of its
>>> disk objects dynamically at runtime based on block device's probing.
>>> (See "issues" and "prerequisite" below.)
>>>
>>> [1] https://github.com/t-akashi/u-boot/tree/efi/dm_disk
>>>
>>> For instance,
>>> => dm tree
>>>    Class     Index  Probed  Driver                Name
>>> -----------------------------------------------------------
>>>    root          0  [ + ]   root_driver           root_driver
>>>    ...
>>>    pci           0  [ + ]   pci_generic_ecam      |-- pcie at 10000000
>>>    ...
>>>    ahci          0  [   ]   ahci_pci              |   |-- ahci_pci
>>>    scsi          0  [   ]   ahci_scsi             |   |   `-- ahci_scsi
>>>    usb           0  [   ]   xhci_pci              |   `-- xhci_pci
>>>    ...
>>> => efi devices
>>> Missing RNG device for EFI_RNG_PROTOCOL
>>> No EFI system partition
>>> Unable to find TPMv2 device
>>> Device           Device Path
>>> ================ ====================
>>> 000000013eee88d0 /VenHw(..)
>>> 000000013ffeb798 /VenHw(..)/Uart(0,0,D,D)
>>> 000000013eeeb810 /VenHw(..)/MAC(525252525252,1)
>>> => scsi rescan
>>
>>
>> With the series binding block devices after initializing the UEFI
>> sub-system works fine. Also unbinding is reflected in the EFI devices.
>>
>> But this series breaks UEFI compliance.
>
> I don't think so.
>
>> All block devices must be probed
>> before booting.
>
> This (not enumerating all the devices) is also true even before my patch.
>
>> Without this GRUB will not be able to read the boot
>> partition with vmlinuz and initrd.
>
> I'm not sure what you expect here, but
> is it enough to define "preboot" variables with any number of
> enumerating commands, like "scsi rescan", "usb start" and so on?

I expect that boards that booted with previous versions of U-Boot using
the respective defconfig still boot. But they don't. Here is one example
(orangepi_pc_defconfig):

     Found U-Boot script /boot.scr.uimg
     189 bytes read in 2 ms (91.8 KiB/s)
     ## Executing script at 43100000
     22979 bytes read in 8 ms (2.7 MiB/s)
     98304 bytes read in 8 ms (11.7 MiB/s)
     Booting /EFI\debian\grubarm.efi
     Welcome to GRUB!

     error: disk `,msdos2' not found.
     grub rescue>

In U-Boot v2022.04 function efi_disk_register() ensured that all block
devices and their partitions were added as EFI handles. But that
function is missing now.

Best regards

Heinrich


>
> # Again, this method can also be applied even without my patch.
>
> -Takahiro Akashi
>
>> Will you provide the missing patch?
>>
>> Best regards
>>
>> Heinrich



More information about the U-Boot mailing list