gnu: qemu: Enable building without ipxe firmware.
* gnu/packages/virtualization.scm (qemu)[arguments]: Adjust the configure-flags to provide a substitute location if built without ipxe-qemu. Adjust the 'replace-firmwares phase to provide a substitute location if built without ipxe-qemu. Add a phase when built without ipxe-qemu to not require those firmware files for building or for tests. [inputs]: Only build with ipxe-qemu when on a supported architecture. Change-Id: If914193827faef6fa18b3cc3268d24cc7db4225e
This commit is contained in:
parent
4b9cb5f87c
commit
b3de9bcd54
@ -1,7 +1,7 @@
|
|||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013-2017, 2020-2022 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2013-2017, 2020-2022 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
|
;;; Copyright © 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
|
||||||
;;; Copyright © 2016-2021, 2023 Efraim Flashner <efraim@flashner.co.il>
|
;;; Copyright © 2016-2021, 2023, 2024 Efraim Flashner <efraim@flashner.co.il>
|
||||||
;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
|
;;; Copyright © 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
|
||||||
;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
|
;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
|
||||||
;;; Copyright © 2017 Andy Patterson <ajpatter@uwaterloo.ca>
|
;;; Copyright © 2017 Andy Patterson <ajpatter@uwaterloo.ca>
|
||||||
@ -222,8 +222,11 @@
|
|||||||
"share/qemu/opensbi-riscv64-generic-fw_dynamic.bin"))
|
"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"))
|
||||||
(ipxe (search-input-file %build-inputs
|
(ipxe
|
||||||
"share/qemu/pxe-virtio.rom"))
|
#$@(if (this-package-input "ipxe-qemu")
|
||||||
|
#~((search-input-file %build-inputs
|
||||||
|
"share/qemu/pxe-virtio.rom"))
|
||||||
|
#~((string-append #$output "/share/qemu"))))
|
||||||
(out #$output))
|
(out #$output))
|
||||||
(list (string-append "--cc=" gcc)
|
(list (string-append "--cc=" gcc)
|
||||||
;; Some architectures insist on using HOST_CC.
|
;; Some architectures insist on using HOST_CC.
|
||||||
@ -256,8 +259,11 @@
|
|||||||
(let* ((seabios (dirname (search-input-file
|
(let* ((seabios (dirname (search-input-file
|
||||||
inputs "share/qemu/bios.bin")))
|
inputs "share/qemu/bios.bin")))
|
||||||
(seabios-firmwares (find-files seabios "\\.bin$"))
|
(seabios-firmwares (find-files seabios "\\.bin$"))
|
||||||
(ipxe (dirname (search-input-file
|
(ipxe
|
||||||
inputs "share/qemu/pxe-virtio.rom")))
|
#$@(if (this-package-input "ipxe-qemu")
|
||||||
|
#~((dirname (search-input-file
|
||||||
|
inputs "share/qemu/pxe-virtio.rom")))
|
||||||
|
#~((string-append #$output "/share/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"))
|
||||||
@ -286,6 +292,28 @@
|
|||||||
"\"~a\",~%" file))
|
"\"~a\",~%" file))
|
||||||
allowed-differences)
|
allowed-differences)
|
||||||
(close-port allowed-differences-whitelist))))
|
(close-port allowed-differences-whitelist))))
|
||||||
|
;; If the ipxe firmware isn't available, remove it from the list
|
||||||
|
;; of files expected to be available and remove some of the tests.
|
||||||
|
#$@(if (not (this-package-input "ipxe-qemu"))
|
||||||
|
#~((add-after 'unpack 'dont-require-ipxe-firmware
|
||||||
|
(lambda _
|
||||||
|
(substitute* "pc-bios/meson.build"
|
||||||
|
((".*(pxe|efi)-.*") ""))
|
||||||
|
(substitute* "tests/qtest/meson.build"
|
||||||
|
((".*qom-test.*") "")
|
||||||
|
((".*qos-test.*") "")
|
||||||
|
((".*test-hmp.*") "")
|
||||||
|
((".*'pxe-test':.*") "")
|
||||||
|
((",? ?'boot-serial-test',?") "")
|
||||||
|
((",? ?'endianness-test',?") "")
|
||||||
|
((",? ?'prom-env-test',?") "")
|
||||||
|
((",? ?'pxe-test',?") "")
|
||||||
|
((",? ?'test-filter-mirror',?") "")
|
||||||
|
((",? ?'test-filter-redirector',?") "")
|
||||||
|
((",? ?'test-netfilter',?") "")
|
||||||
|
;; Fix the slow_qtests array after the substitutions
|
||||||
|
((" : .*") "")))))
|
||||||
|
#~())
|
||||||
(add-after 'unpack 'extend-test-time-outs
|
(add-after 'unpack 'extend-test-time-outs
|
||||||
(lambda _
|
(lambda _
|
||||||
;; These tests can time out on heavily-loaded and/or slow storage.
|
;; These tests can time out on heavily-loaded and/or slow storage.
|
||||||
@ -450,41 +478,44 @@ exec smbd $@")))
|
|||||||
(rename-file (string-append out "/share/doc/qemu")
|
(rename-file (string-append out "/share/doc/qemu")
|
||||||
(string-append qemu-doc "/html"))))))))
|
(string-append qemu-doc "/html"))))))))
|
||||||
(inputs
|
(inputs
|
||||||
(list alsa-lib
|
(append
|
||||||
bash-minimal
|
(if (supported-package? ipxe-qemu)
|
||||||
dtc
|
(list ipxe-qemu)
|
||||||
glib
|
'())
|
||||||
gtk+
|
(list alsa-lib
|
||||||
ipxe-qemu
|
bash-minimal
|
||||||
libaio
|
dtc
|
||||||
libcacard ;smartcard support
|
glib
|
||||||
attr libcap-ng ;VirtFS support
|
gtk+
|
||||||
libdrm
|
libaio
|
||||||
libepoxy
|
libcacard ;smartcard support
|
||||||
libjpeg-turbo
|
attr libcap-ng ;VirtFS support
|
||||||
libpng
|
libdrm
|
||||||
libseccomp
|
libepoxy
|
||||||
libslirp
|
libjpeg-turbo
|
||||||
liburing
|
libpng
|
||||||
libusb ;USB pass-through support
|
libseccomp
|
||||||
mesa
|
libslirp
|
||||||
ncurses
|
liburing
|
||||||
openbios-qemu-ppc
|
libusb ;USB pass-through support
|
||||||
opensbi-qemu
|
mesa
|
||||||
;; ("pciutils" ,pciutils)
|
ncurses
|
||||||
pixman
|
openbios-qemu-ppc
|
||||||
pulseaudio
|
opensbi-qemu
|
||||||
sdl2
|
;; pciutils
|
||||||
seabios-qemu
|
pixman
|
||||||
spice
|
pulseaudio
|
||||||
usbredir
|
sdl2
|
||||||
util-linux
|
seabios-qemu
|
||||||
vde2
|
spice
|
||||||
virglrenderer
|
usbredir
|
||||||
|
util-linux
|
||||||
|
vde2
|
||||||
|
virglrenderer
|
||||||
|
|
||||||
;; Formats to support for .qcow2 (and possibly other) compression.
|
;; Formats to support for .qcow2 (and possibly other) compression.
|
||||||
zlib
|
zlib
|
||||||
`(,zstd "lib")))
|
`(,zstd "lib"))))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
;; Note: acpica is here only to pretty-print firmware differences with IASL
|
;; Note: acpica is here only to pretty-print firmware differences with IASL
|
||||||
;; (see the replace-firmwares phase above).
|
;; (see the replace-firmwares phase above).
|
||||||
|
Loading…
Reference in New Issue
Block a user