summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2025-01-16 18:03:01 +0300
committerArd Biesheuvel <workofard@gmail.com>2025-01-21 15:45:46 +0300
commit46ae4e4b9574530e5081e98af0495d6f6d28379f (patch)
tree27cefd58cc81a3f1dc147a53633ab30dfd66d8ba
parent1111e9fe7078eed9e5c50e1808776ee40a629e16 (diff)
downloadedk2-46ae4e4b9574530e5081e98af0495d6f6d28379f.tar.xz
OvmfPkg/QemuKernelLoaderFsDxe: accept absolute paths
EFI shell looks for "\startup.nsh". Try "-fw_cfg name=etc/boot/startup.nsh,string='echo hello'" ;) Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
index 3e1a876bf0..5b90420dad 100644
--- a/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
+++ b/OvmfPkg/QemuKernelLoaderFsDxe/QemuKernelLoaderFsDxe.c
@@ -806,6 +806,11 @@ QemuKernelStubFileOpen (
//
// Locate the file.
//
+ if (FileName[0] == '\\') {
+ // also accept absolute paths, i.e. '\kernel' for 'kernel'
+ FileName++;
+ }
+
Blob = FindKernelBlob (FileName);
if (Blob == NULL) {