OvmfPkg/QemuKernelLoaderFsDxe: don't quit when named blobs are present

Allows to use the qemu kernel loader pseudo file system for other
purposes than loading a linux kernel (or efi binary).  Passing
startup.nsh for EFI shell is one example.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann 2025-01-20 11:28:37 +01:00 committed by Ard Biesheuvel
parent 46ae4e4b95
commit c45051450e
1 changed files with 5 additions and 2 deletions

View File

@ -71,6 +71,7 @@ STATIC KERNEL_BLOB_ITEMS mKernelBlobItems[] = {
STATIC KERNEL_BLOB *mKernelBlobs;
STATIC UINT64 mKernelBlobCount;
STATIC UINT64 mKernelNamedBlobCount;
STATIC UINT64 mTotalBlobBytes;
//
@ -1139,6 +1140,8 @@ QemuKernelFetchNamedBlobs (
FreePool (DirEntry);
return Status;
}
mKernelNamedBlobCount++;
}
FreePool (DirEntry);
@ -1218,8 +1221,8 @@ QemuKernelLoaderFsDxeEntrypoint (
}
Blob = FindKernelBlob (L"kernel");
if (Blob == NULL) {
DEBUG ((DEBUG_INFO, "%a: no kernel present -> quit\n", __func__));
if ((Blob == NULL) && (mKernelNamedBlobCount == 0)) {
DEBUG ((DEBUG_INFO, "%a: no kernel and no named blobs present -> quit\n", __func__));
Status = EFI_NOT_FOUND;
goto FreeBlobs;
}