efi_driver: create a parent device for all EFI block devices
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 15 Feb 2025 15:22:06 +0000 (16:22 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 20 Feb 2025 10:07:44 +0000 (11:07 +0100)
commitbd8bc53162edde1970c04c472a8058c69bd71f3d
tree90bd1a5488a00d9e8bfba1d38e24f70cefa8521e
parent530e869ff89d9575103637af201fe97864d4f577
efi_driver: create a parent device for all EFI block devices

Up to now root has been the parent device for all block devices created via
calling ConnectController(). This does not work well together with the
implementation of bootstd.

Add a dummy parent device for all EFI block devices.

With this change EFI block devices are also accessible via commands like
'cat', 'load', and 'ls'.

    => dm tree
     Class     Seq    Probed  Driver                Name
    -----------------------------------------------------------
     efi           0  [ + ]   EFI block driver      `-- efi
     blk           3  [ + ]   efi_blk                   `-- efi.efiblk#0
     partition     0  [ + ]   blk_partition                 `-- efi.efiblk#0:1

    => ls efiloader 0:1
           13   hello.txt
            7   u-boot.txt
    2 file(s), 0 dir(s)

    => cat efiloader 0:1 hello.txt
    Hello world!

    => efidebug dh
    0000000018df1700 (efi.efiblk#0:1)
      /VenHw(dbca4c98-6cb0-694d-0872-819c650cb7b8)/HD(1,MBR,0xd1535d21,0x1,0x7f)
      Block IO
      Simple File System

Adjust the event dump unit test to consider the new event spy.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_driver/efi_block_device.c
test/py/tests/test_event_dump.py