me
/
guix
Archived
1
0
Fork 0

gnu: SeaBIOS: Split QEMU variants out to separate package.

* gnu/packages/firmware.scm (seabios)[arguments]: Move custom build and
install phases out to ...
(seabios-qemu): ... this new variable.
* gnu/packages/virtualization.scm (qemu)[inputs]: Change from SEABIOS to
SEABIOS-QEMU.
Marius Bakke 2022-12-20 17:00:15 +01:00
parent aeabddcfc5
commit ffc0037458
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
2 changed files with 109 additions and 86 deletions

View File

@ -420,12 +420,7 @@ executing in M-mode.")
(for-each delete-file (find-files "." "\\.hex$")))))) (for-each delete-file (find-files "." "\\.hex$"))))))
(build-system gnu-build-system) (build-system gnu-build-system)
(native-inputs (native-inputs
(append (list acpica python-wrapper))
(list acpica python-wrapper)
(if (member (%current-system) '("i686-linux" "x86_64-linux"))
'()
(list (cross-gcc "i686-linux-gnu")
(cross-binutils "i686-linux-gnu")))))
(arguments (arguments
(list (list
#:tests? #f ;no tests #:tests? #f ;no tests
@ -435,9 +430,6 @@ executing in M-mode.")
;; by Build_overview.md. ;; by Build_overview.md.
#~'("EXTRAVERSION=/GNU Guix" #~'("EXTRAVERSION=/GNU Guix"
"V=1") ;build verbosely "V=1") ;build verbosely
#:modules `(,@%gnu-build-system-modules
(ice-9 threads)
(ice-9 match))
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(replace 'configure (replace 'configure
@ -449,26 +441,64 @@ executing in M-mode.")
(format port #$(package-version this-package)))) (format port #$(package-version this-package))))
;; If we use (cc-for-target) then we have the system prefix ;; If we use (cc-for-target) then we have the system prefix
;; twice or we might have the wrong prefix. ;; twice or we might have the wrong prefix.
(setenv "CC" "gcc") (setenv "CC" "gcc")))
#$@(match (%current-system)
((or "i686-linux" "x86_64-linux")
#~())
(_
#~((substitute* "Makefile"
(("CROSS_PREFIX=")
"CROSS_PREFIX=i686-linux-gnu-")))))))
(add-before 'build 'build-description-tables (add-before 'build 'build-description-tables
(lambda _ (lambda _
;; Regenerate the ACPI description tables. ;; Regenerate the ACPI description tables.
(invoke "make" "iasl") (invoke "make" "iasl")
;; Clear temporary files added by the iasl target. ;; Clear temporary files added by the iasl target.
(invoke "make" "clean"))) (invoke "make" "clean")))
(replace 'install
(lambda _
(install-file "out/bios.bin"
(string-append #$output "/share/firmware")))))))
(home-page "https://www.seabios.org/SeaBIOS")
(synopsis "x86 BIOS implementation")
(description "SeaBIOS is an implementation of a 16bit x86 BIOS. SeaBIOS
can run in an emulator or it can run natively on X86 hardware with the use of
coreboot.")
(supported-systems '("i686-linux" "x86_64-linux"))
;; Dual licensed.
(license (list license:gpl3+ license:lgpl3+
;; src/fw/acpi-dsdt.dsl is lgpl2
license:lgpl2.1
;; src/fw/lzmadecode.c and src/fw/lzmadecode.h are lgpl3+ and
;; cpl with a linking exception.
license:cpl1.0))))
(define-public seabios-qemu
(package/inherit seabios
(name "seabios-qemu")
(native-inputs
(if (member (%current-system) '("i686-linux" "x86_64-linux"))
(package-native-inputs seabios)
(modify-inputs (package-native-inputs seabios)
(prepend (cross-gcc "i686-linux-gnu")
(cross-binutils "i686-linux-gnu")))))
(supported-systems %supported-systems)
(arguments
(substitute-keyword-arguments (package-arguments seabios)
((#:modules modules %gnu-build-system-modules)
`((ice-9 match)
(ice-9 threads)
,@modules))
((#:phases phases)
#~(modify-phases #$phases
#$@(match (%current-system)
((or "i686-linux" "x86_64-linux")
#~())
(_
#~((add-after 'configure 'configure-cross
(lambda _
(substitute* "Makefile"
(("CROSS_PREFIX=")
"CROSS_PREFIX=i686-linux-gnu-")))))))
(replace 'build (replace 'build
(lambda* (#:key (make-flags #~'()) #:allow-other-keys) (lambda* (#:key (make-flags #~'()) #:allow-other-keys)
;; Note: These BIOS configurations are taken from QEMUs roms/ ;; Note: These BIOS configurations are taken from QEMUs roms/
;; directory. ;; directory.
(let ((biosen (let ((biosen
'(;; The standard BIOS using default options. '( ;; The standard BIOS using default options.
("bios-256k" . ("QEMU=y" "ROM_SIZE=256" "ATA_DMA=n")) ("bios-256k" . ("QEMU=y" "ROM_SIZE=256" "ATA_DMA=n"))
;; A minimal BIOS for old QEMU machine types. ;; A minimal BIOS for old QEMU machine types.
("bios-128k" ("bios-128k"
@ -479,29 +509,34 @@ executing in M-mode.")
"VGAHOOKS=n" "HOST_BIOS_GEOMETRY=n" "ACPI_PARSE=n")) "VGAHOOKS=n" "HOST_BIOS_GEOMETRY=n" "ACPI_PARSE=n"))
;; Minimal BIOS for the "microvm" machine type. ;; Minimal BIOS for the "microvm" machine type.
("bios-microvm" ("bios-microvm"
. ("QEMU=y" "ROM_SIZE=128" "XEN=n" "BOOTSPLASH=n" "ATA=n" . ("QEMU=y" "ROM_SIZE=128" "XEN=n" "BOOTSPLASH=n"
"AHCI=n" "SDCARD=n" "PVSCSI=n" "ESP_SCSI=n" "LSI_SCSI=n" "ATA=n" "AHCI=n" "SDCARD=n" "PVSCSI=n" "ESP_SCSI=n"
"MEGASAS=n" "MPT_SCSI=n" "FLOPPY=n" "FLASH_FLOPPY=n" "LSI_SCSI=n" "MEGASAS=n" "MPT_SCSI=n" "FLOPPY=n"
"NVME=n" "PS2PORT=n" "USB=n" "LPT=n" "RTC_TIMER=n" "FLASH_FLOPPY=n" "NVME=n" "PS2PORT=n" "USB=n"
"USE_SMM=n" "PMTIMER=n" "TCGBIOS=n" "HARDWARE_IRQ=n" "LPT=n" "RTC_TIMER=n" "USE_SMM=n" "PMTIMER=n"
"ACPI_PARSE=y")))) "TCGBIOS=n" "HARDWARE_IRQ=n" "ACPI_PARSE=y"))))
(vgabiosen (vgabiosen
'(("ati" . ("VGA_ATI=y" "VGA_PCI=y")) '(("ati" . ("VGA_ATI=y" "VGA_PCI=y"))
("bochs-display" . ("DISPLAY_BOCHS=y" "VGA_PCI=y")) ("bochs-display" . ("DISPLAY_BOCHS=y" "VGA_PCI=y"))
("cirrus" . ("VGA_CIRRUS=y" "VGA_PCI=y")) ("cirrus" . ("VGA_CIRRUS=y" "VGA_PCI=y"))
("stdvga" . ("VGA_BOCHS=y" "VGA_PCI=y")) ("stdvga" . ("VGA_BOCHS=y" "VGA_PCI=y"))
("virtio" . ("VGA_BOCHS=y" "VGA_BOCHS_VIRTIO=y" "VGA_PCI=y")) ("virtio" . ("VGA_BOCHS=y" "VGA_BOCHS_VIRTIO=y"
("vmware" . ("VGA_BOCHS=y" "VGA_BOCHS_VMWARE=y" "VGA_PCI=y")) "VGA_PCI=y"))
("qxl" . ("VGA_BOCHS=y" "VGA_BOCHS_QXL=y" "VGA_PCI=y")) ("vmware" . ("VGA_BOCHS=y" "VGA_BOCHS_VMWARE=y"
"VGA_PCI=y"))
("qxl" . ("VGA_BOCHS=y" "VGA_BOCHS_QXL=y"
"VGA_PCI=y"))
("isavga" . ("VGA_BOCHS=y" "VGA_PCI=n")) ("isavga" . ("VGA_BOCHS=y" "VGA_PCI=n"))
("ramfb" . ("VGA_RAMFB=y" "VGA_PCI=n"))))) ("ramfb" . ("VGA_RAMFB=y" "VGA_PCI=n")))))
(mkdir "out") (mkdir "out")
(n-par-for-each (parallel-job-count) (n-par-for-each
(parallel-job-count)
(match-lambda (match-lambda
((target . config) ((target . config)
(let* ((dot-config (string-append (getcwd) "/" target (let* ((dot-config (string-append (getcwd) "/" target
"/.config")) "/.config"))
(flags (append make-flags (flags (append
make-flags
(list (string-append "KCONFIG_CONFIG=" (list (string-append "KCONFIG_CONFIG="
dot-config) dot-config)
(string-append "OUT=" target "/"))))) (string-append "OUT=" target "/")))))
@ -532,19 +567,7 @@ executing in M-mode.")
(with-directory-excursion firmware (with-directory-excursion firmware
;; Compatibility symlinks for QEMU. ;; Compatibility symlinks for QEMU.
(symlink "bios-128k.bin" "bios.bin") (symlink "bios-128k.bin" "bios.bin")
(symlink "vgabios-isavga.bin" "vgabios.bin")))))))) (symlink "vgabios-isavga.bin" "vgabios.bin")))))))))))
(home-page "https://www.seabios.org/SeaBIOS")
(synopsis "x86 BIOS implementation")
(description "SeaBIOS is an implementation of a 16bit x86 BIOS. SeaBIOS
can run in an emulator or it can run natively on X86 hardware with the use of
coreboot.")
;; Dual licensed.
(license (list license:gpl3+ license:lgpl3+
;; src/fw/acpi-dsdt.dsl is lgpl2
license:lgpl2.1
;; src/fw/lzmadecode.c and src/fw/lzmadecode.h are lgpl3+ and
;; cpl with a linking exception.
license:cpl1.0))))
(define-public edk2-tools (define-public edk2-tools
(package (package

View File

@ -402,7 +402,7 @@ exec smbd $@")))
pixman pixman
pulseaudio pulseaudio
sdl2 sdl2
seabios seabios-qemu
spice spice
usbredir usbredir
util-linux util-linux