summarylogtreecommitdiffstats
path: root/ovmf.patch
diff options
context:
space:
mode:
Diffstat (limited to 'ovmf.patch')
-rw-r--r--ovmf.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/ovmf.patch b/ovmf.patch
new file mode 100644
index 000000000000..d8729bea040b
--- /dev/null
+++ b/ovmf.patch
@@ -0,0 +1,60 @@
+--- src/platform/backends/qemu/qemu_vm_process_spec.cpp.orig 2024-05-20 18:04:46.308380873 -0400
++++ src/platform/backends/qemu/qemu_vm_process_spec.cpp 2024-05-20 18:05:36.668903896 -0400
+@@ -87,6 +87,47 @@
+ << "chardev:char0"
+ // TODO Add a debugging mode with access to console
+ << "-nographic";
++
++ // Firmware directories
++ try
++ {
++ mu::snap_dir();
++ }
++ catch (const mp::SnapEnvironmentException&)
++ {
++ // Add a list of directories to check
++ QStringList dirs = QStringList();
++ dirs << "/usr/share/seabios/"
++ << "/usr/share/seabios/x64/"
++ << "/usr/share/ovmf/"
++ << "/usr/share/ovmf/x64/"
++ << "/usr/share/qemu/"
++ << "/usr/share/qemu/x64/"
++ << "/usr/share/qemu-efi/"
++ << "/usr/share/qemu-efi/x64/"
++ << "/usr/local/share/seabios/"
++ << "/usr/local/share/seabios/x64/"
++ << "/usr/local/share/ovmf/"
++ << "/usr/local/share/ovmf/x64/"
++ << "/usr/local/share/qemu/"
++ << "/usr/local/share/qemu/x64/"
++ << "/usr/local/share/qemu-efi/"
++ << "/usr/local/share/qemu-efi/x64/";
++
++ // Now check every directory in the options, to make sure they exist
++ // If they do, add them to the args
++ for (const auto& value : dirs)
++ {
++ if (QDir(value).exists())
++ {
++ mpl::log(mpl::Level::debug, desc.vm_name, fmt::format("Adding firmware directory: {}", value));
++ args << "-L" << value;
++ }
++ }
++
++ }
++
++
+ // Cloud-init disk
+ args << "-cdrom" << desc.cloud_init_iso;
+ }
+@@ -203,7 +244,7 @@
+ catch (const mp::SnapEnvironmentException&)
+ {
+ signal_peer = "unconfined";
+- firmware = "/usr{,/local}/share/{seabios,ovmf,qemu,qemu-efi}/*";
++ firmware = "/usr{,/local}/share/{seabios,ovmf,qemu,qemu-efi}{,/x64,/ia32}/*";
+ }
+
+ return profile_template.arg(apparmor_profile_name(), signal_peer, firmware, root_dir, program(),
+