Fix bug in file system library

When InitFileSystem() API is given EnumFileSystemTypeFat in argument,
the FAT file system is not initialized. This bug is discovered when
firmware update payload fails to load capsule from FAT partition via
shell interface.

Fixed #62 

TEST=Created FwuImage.bin and perform firmware update from SBL shell on
     UP2 board. Verified successful update and booting to Ubuntu 16.04
     from eMMC

Signed-off-by: Huang Jin <huang.jin@intel.com>
This commit is contained in:
Huang Jin 2019-01-03 13:18:25 -08:00 committed by GitHub
parent d97fe977df
commit 3009428255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -91,10 +91,6 @@ InitFileSystem (
return Status;
}
if (FsType == EnumFileSystemTypeAuto) {
FsType = 0xFFFFFFFF;
}
if (mCurrentFsType == EnumFileSystemMax) {
Type = EnumFileSystemTypeFat;
if (FixedPcdGet32 (PcdSupportedFileSystemMask) & (1 << Type)) {
@ -111,7 +107,10 @@ InitFileSystem (
}
for (Type = EnumFileSystemTypeFat; Type < EnumFileSystemTypeAuto; Type++) {
if (((FsType & (1 << Type)) != 0) && (mFileSystemFuncs[Type].InitFileSystem != NULL)) {
if (mFileSystemFuncs[Type].InitFileSystem == NULL) {
continue;
}
if ((FsType == EnumFileSystemTypeAuto) || (FsType == Type)) {
Status = mFileSystemFuncs[Type].InitFileSystem (SwPart, PartHandle, FsHandle);
if (!EFI_ERROR (Status)) {
mCurrentFsType = Type;