Skip to content

Commit

Permalink
simple_file: Allow to form a volume name from DevicePath
Browse files Browse the repository at this point in the history
In case GetInfo of volume root fails, it is still possible
to form a volume name from the DevicePath. Do not skip given
SimpleFS volume handle and try to form a name from DevicePath.
That way we do not lose some filesystems from file browser.

This change already fixes the problem of a hanging platform
when trying to enroll a key from disk. However, there is still
a chance of having a non-contiguous array of entries, which
will be fixed in next commit.

Signed-off-by: Michał Żygowski <[email protected]>
  • Loading branch information
miczyg1 committed Dec 16, 2023
1 parent 43b079e commit 7abea11
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/simple_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,13 @@ simple_volume_selector(CHAR16 **title, CHAR16 **selected, EFI_HANDLE *h)

efi_status = root->GetInfo(root, &EFI_FILE_SYSTEM_INFO_GUID,
&size, fi);
if (EFI_ERROR(efi_status))
continue;
/* If GetInfo fails, try to form a name from DevicePath. */
if (EFI_ERROR(efi_status)){
name = NULL;
} else {
name = fi->VolumeLabel;
}

name = fi->VolumeLabel;
if (!name || StrLen(name) == 0 || StrCmp(name, L" ") == 0)
name = DevicePathToStr(DevicePathFromHandle(vol_handles[i]));

Expand Down

0 comments on commit 7abea11

Please sign in to comment.