diff options
author | Ryan Lahfa <masterancpp@gmail.com> | 2023-11-26 02:32:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-26 02:32:06 +0100 |
commit | 6dd2f029a76c0372d407b2e25fd8b83085cb7168 (patch) | |
tree | 5ee58db28b3b7e91473bbae776fd669496e9d652 /pkgs/applications/virtualization | |
parent | 16500715eb22d556a7616022263aa52b4e18e891 (diff) | |
parent | b0eed3a0ac4c3313fef96c45239521bb73931005 (diff) |
Merge pull request #269877 from RaitoBezarius/ovmf-darwin
Diffstat (limited to 'pkgs/applications/virtualization')
-rw-r--r-- | pkgs/applications/virtualization/OVMF/default.nix | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/pkgs/applications/virtualization/OVMF/default.nix b/pkgs/applications/virtualization/OVMF/default.nix index eada778e1c69c..ca2c0f890d9a2 100644 --- a/pkgs/applications/virtualization/OVMF/default.nix +++ b/pkgs/applications/virtualization/OVMF/default.nix @@ -7,7 +7,9 @@ , tpmSupport ? false , tlsSupport ? false , debug ? false -, sourceDebug ? debug +# Usually, this option is broken, do not use it except if you know what you are +# doing. +, sourceDebug ? false }: assert csmSupport -> seabios != null; @@ -20,6 +22,8 @@ let "OvmfPkg/OvmfPkgX64.dsc" else if stdenv.hostPlatform.isAarch then "ArmVirtPkg/ArmVirtQemu.dsc" + else if stdenv.hostPlatform.isRiscV then + "OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc" else throw "Unsupported architecture"; @@ -67,7 +71,8 @@ edk2.mkDerivation projectDscPath (finalAttrs: { cp ${seabios}/Csm16.bin OvmfPkg/Csm/Csm16/Csm16.bin ''; - postFixup = if stdenv.hostPlatform.isAarch then '' + postFixup = ( + if stdenv.hostPlatform.isAarch then '' mkdir -vp $fd/FV mkdir -vp $fd/AAVMF mv -v $out/FV/QEMU_{EFI,VARS}.fd $fd/FV @@ -80,10 +85,18 @@ edk2.mkDerivation projectDscPath (finalAttrs: { # Also add symlinks for Fedora dir layout: https://src.fedoraproject.org/cgit/rpms/edk2.git/tree/edk2.spec ln -s $fd/FV/AAVMF_CODE.fd $fd/AAVMF/QEMU_EFI-pflash.raw ln -s $fd/FV/AAVMF_VARS.fd $fd/AAVMF/vars-template-pflash.raw - '' else '' + '' + else if stdenv.hostPlatform.isRiscV then '' + mkdir -vp $fd/FV + + mv -v $out/FV/RISCV_VIRT_{CODE,VARS}.fd $fd/FV/ + truncate -s 32M $fd/FV/RISCV_VIRT_CODE.fd + truncate -s 32M $fd/FV/RISCV_VIRT_VARS.fd + '' + else '' mkdir -vp $fd/FV mv -v $out/FV/OVMF{,_CODE,_VARS}.fd $fd/FV - ''; + ''); dontPatchELF = true; @@ -105,5 +118,6 @@ edk2.mkDerivation projectDscPath (finalAttrs: { license = lib.licenses.bsd2; inherit (edk2.meta) platforms; maintainers = with lib.maintainers; [ adamcstephens raitobezarius ]; + broken = stdenv.isDarwin; }; }) |