From 5013d0286ec4792960698167c01b162253f67aff Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Tue, 30 Apr 2024 16:31:36 +0300 Subject: [PATCH] gnu: ovmf-riscv64: Update to 202402. * gnu/packages/firmware.scm (ovmf-riscv64): Update to 202402. Build using make-ovmf-firmware. Change-Id: I1a7dcaac3975669a61723b929162ad33affa1619 --- gnu/packages/firmware.scm | 54 ++++++++++++--------------------------- 1 file changed, 16 insertions(+), 38 deletions(-) diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index 85fdaf3fba..5088232214 100644 --- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -1071,6 +1071,22 @@ (define-public ovmf-arm "RELEASE_GCC/FV/QEMU_EFI.fd") (string-append fmw "/ovmf_arm.bin")))))))))))) +(define-public ovmf-riscv64 + (let ((base (make-ovmf-firmware "riscv64"))) + (package + (inherit base) + (arguments + (substitute-keyword-arguments (package-arguments base) + ((#:phases phases) + #~(modify-phases #$phases + (replace 'install + (lambda _ + (let ((fmw (string-append #$output "/share/firmware"))) + (mkdir-p fmw) + (with-directory-excursion "Build/RiscVVirtQemu/RELEASE_GCC/FV" + (install-file "RISCV_VIRT_CODE.fd" fmw) + (install-file "RISCV_VIRT_VARS.fd" fmw)))))))))))) + (define-public ovmf (let ((toolchain-ver "GCC5")) (package @@ -1171,44 +1187,6 @@ (define-public ovmf (license (list license:expat license:bsd-2 license:bsd-3 license:bsd-4))))) -(define-public ovmf-riscv64 - (let ((toolchain-ver "GCC5")) - (package - (inherit ovmf) - (name "ovmf-riscv64") - (native-inputs - (append (package-native-inputs ovmf) - (if (not (string-prefix? "riscv64" (%current-system))) - `(("cross-gcc" ,(cross-gcc "riscv64-linux-gnu")) - ("cross-binutils" ,(cross-binutils "riscv64-linux-gnu"))) - '()))) - (arguments - (substitute-keyword-arguments (package-arguments ovmf) - ((#:phases phases) - #~(modify-phases #$phases - #$@(if (string-prefix? "riscv64" (%current-system)) - '() - #~((add-before 'configure 'set-env - (lambda _ - (setenv (string-append #$toolchain-ver "_RISCV64_PREFIX") - "riscv64-linux-gnu-"))))) - (replace 'build - (lambda _ - (invoke "build" "-a" "RISCV64" "-t" #$toolchain-ver - "-p" "OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc"))) - (delete 'build-x64) - (replace 'install - (lambda _ - (let ((fmw (string-append #$output "/share/firmware"))) - (mkdir-p fmw) - (copy-file (string-append "Build/RiscVVirtQemu/RELEASE_" - #$toolchain-ver "/FV/RISCV_VIRT_CODE.fd") - (string-append fmw "/RISCV_VIRT_CODE.fd")) - (copy-file (string-append "Build/RiscVVirtQemu/RELEASE_" - #$toolchain-ver "/FV/RISCV_VIRT_VARS.fd") - (string-append fmw "/RISCV_VIRT_VARS.fd"))))))))) - (supported-systems %supported-systems)))) - (define* (make-arm-trusted-firmware platform #:key (triplet "aarch64-linux-gnu")) (let ((native-build? (lambda ()