28 Mar, 2020

1 commit


17 Mar, 2020

1 commit

  • Addresses in the sandbox's device tree are in the sandbox's virtual address
    space. If we want to compare memory reservations in the device-tree with
    the output of 'efidebug memmap', we need to convert back to this address
    space.

    Adjust the output of the 'efidebug memmap' command.

    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     

11 Mar, 2020

2 commits


29 Feb, 2020

1 commit

  • Following kernel's proposal for an arch-agnostic initrd loading
    mechanism [1] let's implement the U-boot counterpart.
    This new approach has a number of advantages compared to what we did up
    to now. The file is loaded into memory only when requested limiting the
    area of TOCTOU attacks. Users will be allowed to place the initramfs
    file on any u-boot accessible partition instead of just the ESP one.
    Finally this is an attempt of a generic interface across architectures
    in the linux kernel so it makes sense to support that.

    The file location is intentionally only supported as a config option
    argument(CONFIG_EFI_INITRD_FILESPEC), in an effort to enhance security.
    Although U-boot is not responsible for verifying the integrity of the
    initramfs, we can enhance the offered security by only accepting a
    built-in option, which will be naturally verified by UEFI Secure Boot.
    This can easily change in the future if needed and configure that via ENV
    or UEFI variable.

    [1] https://lore.kernel.org/linux-efi/20200207202637.GA3464906@rani.riverdale.lan/T/#m4a25eb33112fab7a22faa0fd65d4d663209af32f

    Signed-off-by: Ilias Apalodimas
    Signed-off-by: Heinrich Schuchardt

    Ilias Apalodimas
     

27 Feb, 2020

1 commit


08 Jan, 2020

3 commits


04 Dec, 2019

1 commit

  • I detected the following error in sandbox with Clang on Travis CI:
    +cmd/efidebug.c:703:15: error: result of comparison of constant
    9223372036854775822 with expression of type 'int' is always false
    [-Werror,-Wtautological-constant-out-of-range-compare]
    + else if (ret == EFI_NOT_FOUND)
    + ~~~ ^ ~~~~~~~~~~~~~

    Simply changing a type of 'ret' to efi_status_t will fix this error.

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     

12 Aug, 2019

1 commit


31 Jul, 2019

1 commit


17 Jul, 2019

1 commit


21 Jun, 2019

2 commits


05 Jun, 2019

1 commit


03 May, 2019

2 commits

  • The field boot OptionalData in structure _EFI_LOAD_OPTIONS is for binary
    data.

    When we use `efidebug boot add` we should convert the 5th argument from
    UTF-8 to UTF-16 before putting it into the BootXXXX variable.

    When printing boot variables with `efidebug boot dump` we should support
    the OptionalData being arbitrary binary data. So let's dump the data as
    hexadecimal values.

    Here is an example session protocol:

    => efidebug boot add 00a1 label1 scsi 0:1 doit1 'my option'
    => efidebug boot add 00a2 label2 scsi 0:1 doit2
    => efidebug boot dump
    Boot00A0:
    attributes: A-- (0x00000001)
    label: label1
    file_path: .../HD(1,MBR,0xeac4e18b,0x800,0x3fffe)/doit1
    data:
    00000000: 6d 00 79 00 20 00 6f 00 70 00 74 00 69 00 6f 00 m.y. .o.p.t.i.o.
    00000010: 6e 00 00 00 n...
    Boot00A1:
    attributes: A-- (0x00000001)
    label: label2
    file_path: .../HD(1,MBR,0xeac4e18b,0x800,0x3fffe)/doit2
    data:

    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     
  • Currently in do_efi_boot_dump(), we directly read EFI variables from
    related environment variables. To accommodate alternative storage
    backends, we should switch to using the UEFI API instead.

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     

23 Apr, 2019

2 commits

  • The `efidebug dh` command shows handles and the installed protocols. For
    most of the protocols implemented by U-Boot a short text was shown. But for
    some only the GUID was displayed.

    Provide the missing short texts for the following protocols: HII String,
    HII Database, HII Config Routing, Simple Network, PXE Base Code.

    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     
  • We should consistently use the same name for protocol GUIDs as defined in
    the UEFI specification. Not adhering to this rule has led to duplicate
    definitions for the EFI_LOADED_IMAGE_PROTOCOL_GUID.

    Adjust misnamed protocol GUIDs.

    Adjust the text for the graphics output protocol in the output of the
    `efidebug dh` command.

    Signed-off-by: Heinrich Schuchardt

    Heinrich Schuchardt
     

03 Mar, 2019

1 commit


25 Feb, 2019

6 commits

  • "memmap" command prints uefi-specific memory map information.
    => efi memmap
    Type Start End Attributes
    ================ ================ ================ ==========
    CONVENTIONAL 0000000040000000-000000007de27000 WB
    RUNTIME DATA 000000007de27000-000000007de28000 WB|RT
    RESERVED 000000007de28000-000000007de2a000 WB
    RUNTIME DATA 000000007de2a000-000000007de2b000 WB|RT
    RESERVED 000000007de2b000-000000007de2c000 WB
    RUNTIME DATA 000000007de2c000-000000007de2d000 WB|RT
    LOADER DATA 000000007de2d000-000000007ff37000 WB
    RUNTIME CODE 000000007ff37000-000000007ff38000 WB|RT
    LOADER DATA 000000007ff38000-0000000080000000 WB

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     
  • "images" command prints loaded images-related information.

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     
  • "dh" command prints all the uefi handles used in the system.

    => efi dh
    7ef3bfa0: Device Path, Device Path To Text, Device Path Utilities,
    Unicode Collation 2
    7ef31d30: Driver Binding
    7ef31da0: Simple Text Output
    7ef31e10: Simple Text Input, Simple Text Input Ex
    7ef3cca0: Block IO, Device Path
    7ef3d070: Block IO, Device Path
    7ef3d1b0: Block IO, Device Path, Simple File System
    7ef3d3e0: Block IO, Device Path, Simple File System

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     
  • "drivers" command prints all the uefi drivers on the system.

    => efi drivers
    Driver Name Image Path
    ================ ==================== ====================
    000000007ef003d0

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     
  • "devices" command prints all the uefi variables on the system.

    => efi devices
    Scanning disk ahci_scsi.id0lun0...
    Scanning disk ahci_scsi.id1lun0...
    Found 4 disks
    Device Device Path
    ================ ====================
    000000007ef07ea0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)
    000000007ef00c10 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(0,0)
    000000007ef00dd0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(1,0)
    000000007ef07be0 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(1,0)/HD(1,MBR,0x086246ba,0x800,0x40000)
    000000007ef07510 /VenHw(e61d73b9-a384-4acc-aeab-82e828f3628b)/Scsi(1,0)/HD(2,MBR,0x086246ba,0x40800,0x3f800)

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro
     
  • Currently, there is no easy way to add or modify UEFI variables.
    In particular, bootmgr supports BootOrder/BootXXXX variables, it is
    quite hard to define them as u-boot variables because they are represented
    in a complicated and encoded format.

    The new command, efidebug, helps address these issues and give us
    more friendly interfaces:
    * efidebug boot add: add BootXXXX variable
    * efidebug boot rm: remove BootXXXX variable
    * efidebug boot dump: display all BootXXXX variables
    * efidebug boot next: set BootNext variable
    * efidebug boot order: set/display a boot order (BootOrder)

    Signed-off-by: AKASHI Takahiro
    Reviewed-by: Heinrich Schuchardt

    AKASHI Takahiro