diff options
author | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-03-18 00:32:39 +0900 |
---|---|---|
committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-03-27 21:21:06 +0900 |
commit | 0e151a865d223cb14ac997288cb4386225fa502f (patch) | |
tree | 4437e05dd9f1d63f4fafad0b6219b74dd0324f8f | |
parent | 8afea02d4d42cca9eedac077947a83f8f3989493 (diff) | |
download | guix-0e151a865d223cb14ac997288cb4386225fa502f.tar.gz guix-0e151a865d223cb14ac997288cb4386225fa502f.zip |
gnu: ovmf-x86-64: Install QEMU firmware metadata file.
* gnu/packages/firmware.scm (ovmf-x86-64)
[phases] {install-qemu-firmware-metadata}: New phase.
(ovmf-aux-file): New procedure.
* gnu/packages/aux-files/ovmf/51-edk2-ovmf-2m-raw-x64-nosb.json: New file.
* Makefile.am (AUX_FILES): Register it.
Change-Id: I301eac8b79aed523f3b4cdedb7b3925d8fd0ad3d
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | gnu/packages/aux-files/ovmf/51-edk2-ovmf-2m-raw-x64-nosb.json | 36 | ||||
-rw-r--r-- | gnu/packages/firmware.scm | 26 |
3 files changed, 61 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index c668b96a37..f2f4a9643e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -472,6 +472,7 @@ AUX_FILES = \ gnu/packages/aux-files/linux-libre/5.4-arm64.conf \ gnu/packages/aux-files/linux-libre/5.4-i686.conf \ gnu/packages/aux-files/linux-libre/5.4-x86_64.conf \ + gnu/packages/aux-files/ovmf/51-edk2-ovmf-2m-raw-x64-nosb.json \ gnu/packages/aux-files/pack-audit.c \ gnu/packages/aux-files/python/sanity-check.py \ gnu/packages/aux-files/python/sitecustomize.py \ diff --git a/gnu/packages/aux-files/ovmf/51-edk2-ovmf-2m-raw-x64-nosb.json b/gnu/packages/aux-files/ovmf/51-edk2-ovmf-2m-raw-x64-nosb.json new file mode 100644 index 0000000000..050853e2b8 --- /dev/null +++ b/gnu/packages/aux-files/ovmf/51-edk2-ovmf-2m-raw-x64-nosb.json @@ -0,0 +1,36 @@ +{ + "description": "OVMF without SB+SMM, empty varstore", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "mode" : "split", + "executable": { + "filename": "/usr/share/edk2/ovmf/OVMF_CODE.fd", + "format": "raw" + }, + "nvram-template": { + "filename": "/usr/share/edk2/ovmf/OVMF_VARS.fd", + "format": "raw" + } + }, + "targets": [ + { + "architecture": "x86_64", + "machines": [ + "pc-i440fx-*", + "pc-q35-*" + ] + } + ], + "features": [ + "acpi-s3", + "amd-sev", + "amd-sev-es", + "verbose-dynamic" + ], + "tags": [ + + ] +} diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index 2cd3908b0d..f04edefafe 100644 --- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -8,7 +8,7 @@ ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com> ;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius@gnu.org> ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com> -;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2022, 2023, 2025 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com> ;;; Copyright © 2023, 2024 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2024 Ricardo Wurmus <rekado@elephly.net> @@ -1001,6 +1001,10 @@ Virtual Machines. OVMF contains a sample UEFI firmware for QEMU and KVM.") (license (list license:expat license:bsd-2 license:bsd-3 license:bsd-4))))) +(define (ovmf-aux-file name) + "Return as a gexp the auxiliary OVMF file corresponding to NAME." + (local-file (search-auxiliary-file (string-append "ovmf/" name)))) + (define-public ovmf-x86-64 (let ((base (make-ovmf-firmware "x86_64"))) (package @@ -1022,7 +1026,25 @@ Virtual Machines. OVMF contains a sample UEFI firmware for QEMU and KVM.") (string-append fmw "/" (string-downcase file) "_x64.bin"))) (list "OVMF" "OVMF_CODE" - "OVMF_VARS")))))))))))) + "OVMF_VARS"))))) + (add-after 'install 'install-qemu-firmware-metadata + (lambda _ + ;; The QEMU firmware metadata files are taken from the + ;; Fedora project (see: + ;; https://src.fedoraproject.org/rpms/edk2/tree/rawhide). + (let ((51-edk2-ovmf-2m-raw-x64-nosb.json-source + #$(ovmf-aux-file "51-edk2-ovmf-2m-raw-x64-nosb.json")) + (51-edk2-ovmf-2m-raw-x64-nosb.json-dest + (string-append #$output "/share/qemu/firmware/" + "51-edk2-ovmf-2m-raw-x64-nosb.json"))) + (mkdir-p (dirname 51-edk2-ovmf-2m-raw-x64-nosb.json-dest)) + (copy-file 51-edk2-ovmf-2m-raw-x64-nosb.json-source + 51-edk2-ovmf-2m-raw-x64-nosb.json-dest) + (substitute* 51-edk2-ovmf-2m-raw-x64-nosb.json-dest + (("/usr/share/edk2/ovmf/OVMF_(CODE|VARS).fd" _ kind) + (string-append + #$output "/share/firmware/ovmf_" + (string-downcase kind) "_x64.bin"))))))))))))) (define-public ovmf-i686 (let ((base (make-ovmf-firmware "i686"))) |