diff options
author | AKASHI Takahiro <takahiro.akashi@linaro.org> | 2019-10-07 14:59:39 +0900 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2019-11-12 23:13:54 +0100 |
commit | 89cb6a5dd6d44dc7293845d63ee29fe6b7cd1d09 (patch) | |
tree | 7e8154167ea26a521dd4e5e417141dc3a9af4b78 /lib | |
parent | cab6f06c14a2a059621ef51b241a0089beb48cfd (diff) | |
download | u-boot-89cb6a5dd6d44dc7293845d63ee29fe6b7cd1d09.zip u-boot-89cb6a5dd6d44dc7293845d63ee29fe6b7cd1d09.tar.gz u-boot-89cb6a5dd6d44dc7293845d63ee29fe6b7cd1d09.tar.bz2 |
efi_loader: disk: install file system protocol to a whole disk
Currently, a whole disk without any partitions is not associated
with EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. So even if it houses some
file system, there is a chance that we may not be able to access
it, particularly, when accesses are to be attempted after searching
that protocol against a device handle.
With this patch, EFI_SIMPLE_FILE_SYSTEM_PROTOCOL is installed
to such a disk if part_get_info() shows there is no partition
table installed on it.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Only if no partition table exists, check for a file system on disk level.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_disk.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c index 861fcaf..ed7fb3f 100644 --- a/lib/efi_loader/efi_disk.c +++ b/lib/efi_loader/efi_disk.c @@ -337,7 +337,9 @@ static efi_status_t efi_disk_add_dev( diskobj->dp); if (ret != EFI_SUCCESS) return ret; - if (part >= 1 && efi_fs_exists(desc, part)) { + /* partitions or whole disk without partitions */ + if ((part || desc->part_type == PART_TYPE_UNKNOWN) && + efi_fs_exists(desc, part)) { diskobj->volume = efi_simple_file_system(desc, part, diskobj->dp); ret = efi_add_protocol(&diskobj->header, |