gnu: QEMU: Unbundle iPXE.

* gnu/packages/virtualization.scm (qemu)[source](snippet): Purge iPXE.
[arguments]: Re-add firmware files from IPXE-QEMU.
[inputs]: Add IPXE-QEMU.
This commit is contained in:
Marius Bakke 2022-12-22 13:25:50 +01:00
parent a5dbe84a61
commit ba7f6f0bf3
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -178,10 +178,14 @@ (define-public qemu
;; TODO: Scrub all firmwares from this directory! ;; TODO: Scrub all firmwares from this directory!
(with-directory-excursion "pc-bios" (with-directory-excursion "pc-bios"
;; Delete firmwares provided by SeaBIOS. ;; Delete firmwares provided by SeaBIOS.
(for-each delete-file (find-files "." "^(bios|vgabios).*\\.bin$"))) (for-each delete-file (find-files "." "^(bios|vgabios).*\\.bin$"))
;; Delete iPXE firmwares.
(for-each delete-file (find-files "." "^(efi|pxe)-.*\\.rom$")))
;; Delete bundled code that we provide externally. ;; Delete bundled code that we provide externally.
(for-each delete-file-recursively (for-each delete-file-recursively
'("dtc" "meson" "roms/seabios")))))) '("dtc" "meson"
"roms/ipxe"
"roms/seabios"))))))
(outputs '("out" "static" "doc")) ;5.3 MiB of HTML docs (outputs '("out" "static" "doc")) ;5.3 MiB of HTML docs
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
@ -195,6 +199,8 @@ (define-public qemu
(meson (search-input-file %build-inputs "bin/meson")) (meson (search-input-file %build-inputs "bin/meson"))
(seabios (search-input-file %build-inputs (seabios (search-input-file %build-inputs
"share/firmware/bios.bin")) "share/firmware/bios.bin"))
(ipxe (search-input-file %build-inputs
"share/firmware/pxe-virtio.rom"))
(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.
@ -205,7 +211,8 @@ (define-public qemu
"--sysconfdir=/etc" "--sysconfdir=/etc"
"--enable-fdt=system" "--enable-fdt=system"
(string-append "--firmwarepath=" out "/share/qemu:" (string-append "--firmwarepath=" out "/share/qemu:"
(dirname seabios)) (dirname seabios) ":"
(dirname ipxe))
(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
;; The binaries need to be linked against -lrt. ;; The binaries need to be linked against -lrt.
@ -226,6 +233,9 @@ (define-public qemu
(let* ((seabios (dirname (search-input-file (let* ((seabios (dirname (search-input-file
inputs "share/firmware/bios.bin"))) inputs "share/firmware/bios.bin")))
(seabios-firmwares (find-files seabios "\\.bin$")) (seabios-firmwares (find-files seabios "\\.bin$"))
(ipxe (dirname (search-input-file
inputs "share/firmware/pxe-virtio.rom")))
(ipxe-firmwares (find-files ipxe "\\.rom$"))
(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.
@ -240,7 +250,7 @@ (define-public qemu
(with-directory-excursion "pc-bios" (with-directory-excursion "pc-bios"
(for-each (lambda (file) (for-each (lambda (file)
(symlink file (basename file))) (symlink file (basename file)))
seabios-firmwares)) (append seabios-firmwares ipxe-firmwares)))
(for-each (lambda (file) (for-each (lambda (file)
(format allowed-differences-whitelist (format allowed-differences-whitelist
"\"~a\",~%" file)) "\"~a\",~%" file))
@ -357,7 +367,9 @@ (define-public qemu
;; pc-bios/meson.build, hence this roundabout way. ;; pc-bios/meson.build, hence this roundabout way.
(with-directory-excursion (string-append #$output "/share/qemu") (with-directory-excursion (string-append #$output "/share/qemu")
(for-each delete-file (for-each delete-file
(find-files "." "^(vga)?bios(-[a-z0-9-]+)?\\.bin$"))))) (append
(find-files "." "^(vga)?bios(-[a-z0-9-]+)?\\.bin$")
(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
;; pulling it in as an input. Note that you need to explicitly install ;; pulling it in as an input. Note that you need to explicitly install
;; Samba in your Guix profile for Samba support. ;; Samba in your Guix profile for Samba support.
@ -385,6 +397,7 @@ (define-public qemu
dtc dtc
glib glib
gtk+ gtk+
ipxe-qemu
libaio libaio
libcacard ;smartcard support libcacard ;smartcard support
attr libcap-ng ;VirtFS support attr libcap-ng ;VirtFS support