[PATCH 0/6] efi_loader: fix efi_dp_from_file()

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Sat May 13 10:48:14 CEST 2023

efi_dp_from_file() has multiple issues:

* When called from efi_dp_from_name() we miss to append the filename
  for non-block devices.
* When called from efi_dp_from_name we invoke efi_dp_from_part() twice.
* expand_media_path() could be simplified by using efi_dp_from_file to
  prepend the device path of the boot device.

This can be avoided by passing a device path to efi_dp_from_file() instead
of a block device descriptor and a partition number.

efi_dp_from_name() has duplicate code to replace slash by backslash.
path_to_uefi() called by efi_dp_from_file() already does this.

Heinrich Schuchardt (6):
  efi_loader: avoid #ifdef in efi_dp_from_name()
  efi_loader: duplicate code in efi_dp_from_name
  efi_loader: clean up efi_dp_from_file
  efi_loader: error code efi_dp_from_name()
  efi_loader: simplify efi_dp_from_name()
  efi_loader: fix efi_dp_from_file()

 cmd/bootefi.c                    |  2 +-
 include/efi_loader.h             |  2 +-
 lib/efi_loader/efi_bootmgr.c     | 13 ++---
 lib/efi_loader/efi_device_path.c | 91 ++++++++++----------------------
 4 files changed, 36 insertions(+), 72 deletions(-)


More information about the U-Boot mailing list