gnu: QEMU: Unbundle OpenSBI.

* gnu/packages/virtualization.scm (qemu)[source](snippet): Delete precompiled
riscv64 firmware, and its source code.
[arguments]: Provide OpenSBI.
[inputs]: Add OPENSBI-QEMU.
This commit is contained in:
Marius Bakke 2022-12-25 13:44:17 +01:00
parent c8e836991d
commit f81c05d89b
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -184,6 +184,9 @@ (define-public qemu
;; Delete ppc64 OpenBIOS. TODO: Remove sparc32 and sparc64 too ;; Delete ppc64 OpenBIOS. TODO: Remove sparc32 and sparc64 too
;; once they are supported in Guix. ;; once they are supported in Guix.
(delete-file "openbios-ppc") (delete-file "openbios-ppc")
;; Delete riscv64 OpenSBI. TODO: Remove riscv32 when supported
;; in Guix.
(delete-file "opensbi-riscv64-generic-fw_dynamic.bin")
;; Delete iPXE firmwares. ;; Delete iPXE firmwares.
(for-each delete-file (find-files "." "^(efi|pxe)-.*\\.rom$"))) (for-each delete-file (find-files "." "^(efi|pxe)-.*\\.rom$")))
;; Delete bundled code that we provide externally. ;; Delete bundled code that we provide externally.
@ -191,6 +194,7 @@ (define-public qemu
'("dtc" "meson" '("dtc" "meson"
"roms/ipxe" "roms/ipxe"
"roms/openbios" "roms/openbios"
"roms/opensbi"
"roms/seabios" "roms/seabios"
"roms/sgabios")))))) "roms/sgabios"))))))
(outputs '("out" "static" "doc")) ;5.3 MiB of HTML docs (outputs '("out" "static" "doc")) ;5.3 MiB of HTML docs
@ -206,6 +210,9 @@ (define-public qemu
(meson (search-input-file %build-inputs "bin/meson")) (meson (search-input-file %build-inputs "bin/meson"))
(openbios (search-input-file %build-inputs (openbios (search-input-file %build-inputs
"share/qemu/openbios-ppc")) "share/qemu/openbios-ppc"))
(opensbi (search-input-file
%build-inputs
"share/qemu/opensbi-riscv64-generic-fw_dynamic.bin"))
(seabios (search-input-file %build-inputs (seabios (search-input-file %build-inputs
"share/qemu/bios.bin")) "share/qemu/bios.bin"))
(sgabios (search-input-file %build-inputs (sgabios (search-input-file %build-inputs
@ -225,6 +232,7 @@ (define-public qemu
(dirname seabios) ":" (dirname seabios) ":"
(dirname ipxe) ":" (dirname ipxe) ":"
(dirname openbios) ":" (dirname openbios) ":"
(dirname opensbi) ":"
(dirname sgabios)) (dirname sgabios))
(string-append "--smbd=" out "/libexec/samba-wrapper") (string-append "--smbd=" out "/libexec/samba-wrapper")
"--disable-debug-info" ;for space considerations "--disable-debug-info" ;for space considerations
@ -252,6 +260,10 @@ (define-public qemu
(ipxe-firmwares (find-files ipxe "\\.rom$")) (ipxe-firmwares (find-files ipxe "\\.rom$"))
(openbios (search-input-file (openbios (search-input-file
inputs "share/qemu/openbios-ppc")) inputs "share/qemu/openbios-ppc"))
(opensbi-riscv64
(search-input-file
inputs
"share/qemu/opensbi-riscv64-generic-fw_dynamic.bin"))
(allowed-differences (allowed-differences
;; Ignore minor differences (addresses etc) in the firmware ;; Ignore minor differences (addresses etc) in the firmware
;; data tables compared to what the test suite expects. ;; data tables compared to what the test suite expects.
@ -267,7 +279,7 @@ (define-public qemu
(for-each (lambda (file) (for-each (lambda (file)
(symlink file (basename file))) (symlink file (basename file)))
(append seabios-firmwares ipxe-firmwares (append seabios-firmwares ipxe-firmwares
(list openbios sgabios)))) (list openbios opensbi-riscv64 sgabios))))
(for-each (lambda (file) (for-each (lambda (file)
(format allowed-differences-whitelist (format allowed-differences-whitelist
"\"~a\",~%" file)) "\"~a\",~%" file))
@ -385,7 +397,9 @@ (define-public qemu
(with-directory-excursion (string-append #$output "/share/qemu") (with-directory-excursion (string-append #$output "/share/qemu")
(for-each delete-file (for-each delete-file
(append (append
'("openbios-ppc" "sgabios.bin") '("openbios-ppc"
"opensbi-riscv64-generic-fw_dynamic.bin"
"sgabios.bin")
(find-files "." "^(vga)?bios(-[a-z0-9-]+)?\\.bin$") (find-files "." "^(vga)?bios(-[a-z0-9-]+)?\\.bin$")
(find-files "." "^(efi|pxe)-.*\\.rom$")))))) (find-files "." "^(efi|pxe)-.*\\.rom$"))))))
;; Create a wrapper for Samba. This allows QEMU to use Samba without ;; Create a wrapper for Samba. This allows QEMU to use Samba without
@ -430,6 +444,7 @@ (define-public qemu
mesa mesa
ncurses ncurses
openbios-qemu-ppc openbios-qemu-ppc
opensbi-qemu
;; ("pciutils" ,pciutils) ;; ("pciutils" ,pciutils)
pixman pixman
pulseaudio pulseaudio