]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Merge pull request #981 from DaanDeMeyer/fix-qemu-bios
authorJörg Behrmann <behrmann@physik.fu-berlin.de>
Thu, 19 May 2022 08:31:29 +0000 (10:31 +0200)
committerGitHub <noreply@github.com>
Thu, 19 May 2022 08:31:29 +0000 (10:31 +0200)
qemu: Only enable uefi related options when we want to boot using uefi

1  2 
mkosi/__init__.py

index 3d1386a34c08edc068126cfd6e458c9eb414d036,755c1e14206739b6d31930aaf92ac42f3ada2d66..5b0fdff100e361f6a6ed6c2e0cfa975523ac455e
@@@ -7718,12 -7715,20 +7718,20 @@@ def qemu_check_kvm_support() -> bool
  def run_qemu_cmdline(args: MkosiArgs) -> Iterator[List[str]]:
      accel = "kvm" if args.qemu_kvm else "tcg"
  
+     if "uefi" in args.boot_protocols:
+         mode = "uefi"
+     elif "bios" in args.boot_protocols:
+         mode = "bios"
+     else:
+         mode = "uefi"
      firmware, fw_supports_sb = find_qemu_firmware()
+     smm = "on" if fw_supports_sb and mode == "uefi" else "off"
  
      cmdline = [
 -        find_qemu_binary(),
 +        find_qemu_binary(args),
          "-machine",
-         f"type=q35,accel={accel},smm={'on' if fw_supports_sb else 'off'}",
+         f"type=q35,accel={accel},smm={smm}",
          "-smp",
          args.qemu_smp,
          "-m",