summaryrefslogtreecommitdiff
path: root/src/boot/efi/vmm.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2022-09-09 13:12:04 +0200
committerGerd Hoffmann <kraxel@redhat.com>2022-11-16 12:52:58 +0100
commit8fec4f95be7a323410f9853b6773c810ba6c7152 (patch)
tree15458fe3c17e74c6a4d499b07fa82cf4a35e7c05 /src/boot/efi/vmm.h
parentb8d6b1608e9dd554d499eab0e6527d1f6177a85e (diff)
downloadsystemd-8fec4f95be7a323410f9853b6773c810ba6c7152.tar.gz
boot: improve support for qemu
systemd-boot expects being loaded from ESP and is quite unhappy in case the loaded image device path is something else. When running on qemu this can easily happen though. Case one is direct kernel boot, i.e. loading via 'qemu -kernel systemd-bootx64.efi'. Case two is sd-boot being added to the ovmf firmware image and being loaded from there. This patch detects both cases and goes inspect all file systems known to the firmware, trying to find the ESP. When present the VMMBootOrderNNNN variables are used to inspect the file systems in the given order.
Diffstat (limited to 'src/boot/efi/vmm.h')
-rw-r--r--src/boot/efi/vmm.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/boot/efi/vmm.h b/src/boot/efi/vmm.h
new file mode 100644
index 0000000000..7bac1a324a
--- /dev/null
+++ b/src/boot/efi/vmm.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include <efi.h>
+#include <efilib.h>
+
+bool is_direct_boot(EFI_HANDLE device);
+EFI_STATUS vmm_open(EFI_HANDLE *ret_qemu_dev, EFI_FILE **ret_qemu_dir);