gnu: ovmf: Only build 32-bit firmware on i686-linux.

* gnu/packages/firmware.scm (ovmf)[arguments]: Only when the build
machine is x86_64-linux should the 64-bit firmware be built and
installed.
This commit is contained in:
Efraim Flashner 2017-06-29 12:54:54 +03:00
parent 8363a83517
commit 2eb95ade8f
No known key found for this signature in database
GPG Key ID: 41AAE7DCCA3D8351
1 changed files with 14 additions and 9 deletions

View File

@ -2,6 +2,7 @@
;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org> ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2017 David Craven <david@craven.ch> ;;; Copyright © 2017 David Craven <david@craven.ch>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -275,13 +276,15 @@ use of coreboot.")
(("^ACTIVE_PLATFORM[ ]*=.*$") (("^ACTIVE_PLATFORM[ ]*=.*$")
"ACTIVE_PLATFORM = OvmfPkg/OvmfPkgIa32.dsc\n")) "ACTIVE_PLATFORM = OvmfPkg/OvmfPkgIa32.dsc\n"))
(zero? (system* "build")))) (zero? (system* "build"))))
(add-after 'build 'build-x64 ,@(if (string=? "x86_64-linux" (%current-system))
'(add-after 'build 'build-x64
(lambda _ (lambda _
(substitute* "Conf/target.txt" (substitute* "Conf/target.txt"
(("^TARGET_ARCH[ ]*=.*$") "TARGET_ARCH = X64\n") (("^TARGET_ARCH[ ]*=.*$") "TARGET_ARCH = X64\n")
(("^ACTIVE_PLATFORM[ ]*=.*$") (("^ACTIVE_PLATFORM[ ]*=.*$")
"ACTIVE_PLATFORM = OvmfPkg/OvmfPkgX64.dsc\n")) "ACTIVE_PLATFORM = OvmfPkg/OvmfPkgX64.dsc\n"))
(zero? (system* "build")))) (zero? (system* "build"))))
'())
(delete 'build) (delete 'build)
(replace 'install (replace 'install
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
@ -290,8 +293,10 @@ use of coreboot.")
(mkdir-p fmw) (mkdir-p fmw)
(copy-file "Build/OvmfIa32/RELEASE_GCC49/FV/OVMF.fd" (copy-file "Build/OvmfIa32/RELEASE_GCC49/FV/OVMF.fd"
(string-append fmw "/ovmf_ia32.bin")) (string-append fmw "/ovmf_ia32.bin"))
(copy-file "Build/OvmfX64/RELEASE_GCC49/FV/OVMF.fd" ,@(if (string=? "x86_64-linux" (%current-system))
'((copy-file "Build/OvmfX64/RELEASE_GCC49/FV/OVMF.fd"
(string-append fmw "/ovmf_x64.bin"))) (string-append fmw "/ovmf_x64.bin")))
'()))
#t))))) #t)))))
(supported-systems '("x86_64-linux" "i686-linux")) (supported-systems '("x86_64-linux" "i686-linux"))
(home-page "http://www.tianocore.org") (home-page "http://www.tianocore.org")