summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Żygowski <michal.zygowski@3mdeb.com>2023-12-16 12:58:47 +0100
committerPeter Jones <pjones@redhat.com>2025-01-21 11:00:49 -0500
commit9415d3cada09f8043bb9a2c1b32fd1f909cefab0 (patch)
treeb723f797ac338b4bb8d1ae4dabd0297837054fa1
parentdc45aa6b3ce0c54c20ed284222297cdb29baa5d5 (diff)
downloadefi-boot-shim-9415d3cada09f8043bb9a2c1b32fd1f909cefab0.tar.gz
efi-boot-shim-9415d3cada09f8043bb9a2c1b32fd1f909cefab0.zip
simple_file: Allow to form a volume name from DevicePath
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 <michal.zygowski@3mdeb.com>
-rw-r--r--lib/simple_file.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/simple_file.c b/lib/simple_file.c
index 43b2f87a..fc082bed 100644
--- a/lib/simple_file.c
+++ b/lib/simple_file.c
@@ -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]));