efi_loader: create boot options without file path

Allow the efidebug command to create boot options without file path, e.g.

    efidebug boot add -b 0001 'short dev only' host 0:1 ''
    efidebug boot add -B 0002 'long dev only' host 0:1 ''

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
Heinrich Schuchardt
2022-06-11 05:22:08 +00:00
parent 178667b34b
commit 72fa9cd59e
2 changed files with 25 additions and 11 deletions

View File

@@ -46,7 +46,6 @@ struct efi_device_path *expand_media_path(struct efi_device_path *device_path)
{
struct efi_device_path *dp, *rem, *full_path;
efi_handle_t handle;
efi_status_t ret;
if (!device_path)
return NULL;
@@ -59,7 +58,7 @@ struct efi_device_path *expand_media_path(struct efi_device_path *device_path)
dp = device_path;
handle = efi_dp_find_obj(dp, &efi_simple_file_system_protocol_guid,
&rem);
if (ret == EFI_SUCCESS) {
if (handle) {
if (rem->type == DEVICE_PATH_TYPE_END) {
dp = efi_dp_from_file(NULL, 0,
"/EFI/BOOT/" BOOTEFI_NAME);