[PATCH 1/4] gnu: ovmf: Update to 202308.

  • Done
  • quality assurance status badge
Details
3 participants
  • Efraim Flashner
  • Ludovic Courtès
  • spacecadet
Owner
unassigned
Submitted by
spacecadet
Severity
normal
S
S
spacecadet wrote on 12 Nov 2023 03:48
(name . Guix Patches)(address . guix-patches@gnu.org)
a2d97e6834a178809e79e50b463fd29c@purge.sh
Update package to 202308 and add toolchain-ver variable for the GCC
version being use in the build.
---
gnu/packages/firmware.scm | 39 +++++++++++++++++++++++++++------------
1 file changed, 27 insertions(+), 12 deletions(-)

Toggle diff (111 lines)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 294bbea184..fd8b6bb8f0 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -872,21 +872,21 @@ (define-public edk2-tools
(license license:bsd-2)))

(define-public ovmf
- (let ((commit "13a50a6fe1dcfa6600c38456ee24e0f9ecf51b5f")
- (revision "1"))
+ (let ((toolchain-ver "GCC5"))
(package
(name "ovmf")
- (version (git-version "20170116" revision commit))
+ (version "202308")
(source (origin
(method git-fetch)
(uri (git-reference
;; OVMF is part of the edk2 source tree.
(url "https://github.com/tianocore/edk2")
- (commit commit)))
+ (recursive? #t) ;edk2 now uses a lot of
submodules
+ (commit (string-append "edk2-stable" version))))
(file-name (git-file-name name version))
(sha256
(base32
-
"1gy2332kdqk8bjzpcsripx10896rbvgl0ic7r344kmpiwdgm948b"))))
+
"04rnfnaqr2c7ayplj7ib730zp1snw157zx5rmykz5hz1zz2vb20j"))))
(build-system gnu-build-system)
(arguments
(list
@@ -916,41 +916,56 @@ (define-public ovmf
(bin (string-append tools
"/BinWrappers/PosixLike")))
(setenv "WORKSPACE" cwd)
(setenv "EDK_TOOLS_PATH" tools)
+ (setenv "PYTHON3_ENABLE" "TRUE")
+ (setenv "PYTHON_COMMAND" "python3")
(setenv "PATH" (string-append (getenv "PATH") ":"
bin))
(invoke "bash" "edksetup.sh")
+ (substitute* "Conf/tools_def.txt"
+ ;; Guix gcc is compiled without pie
+ ;; The -no-pie flag causes the Ia32 build to fail
+ (("-no-pie") ""))
(substitute* "Conf/target.txt"
(("^TARGET[ ]*=.*$") "TARGET = RELEASE\n")
+ (("^TOOL_CHAIN_TAG[ ]*=.*$") (string-append
"TOOL_CHAIN_TAG = " #$toolchain-ver "\n"))
+ (("^TARGET_ARCH[ ]*=.*$")
+ (string-append "TARGET_ARCH = IA32"
+ #$@(if (string=? "x86_64-linux"
(%current-system))
+ '(", X64")
+ '())
+ "\n"))
(("^MAX_CONCURRENT_THREAD_NUMBER[ ]*=.*$")
(format #f "MAX_CONCURRENT_THREAD_NUMBER = ~a~%"
(number->string (parallel-job-count)))))
;; Build build support.
- (setenv "BUILD_CC" "gcc")
+ (setenv "CC" "gcc")
(invoke "make" "-C" tools))))
(replace 'build
(lambda _
- (invoke "build" "-a" "IA32" "-t" "GCC49"
+ (invoke "build" "-a" "IA32" "-t" #$toolchain-ver
"-p" "OvmfPkg/OvmfPkgIa32.dsc")))
#$@(if (string=? "x86_64-linux" (%current-system))
#~((add-after 'build 'build-x64
(lambda _
- (invoke "build" "-a" "X64" "-t" "GCC49"
+ (invoke "build" "-a" "X64" "-t"
#$toolchain-ver
"-p" "OvmfPkg/OvmfPkgX64.dsc"))))
#~())
(replace 'install
(lambda _
- (let ((fmw (string-append #$output "/share/firmware")))
+ (let ((fmw (string-append #$output "/share/firmware"))
+ (toolchain-ver #$toolchain-ver))
(mkdir-p fmw)
- (copy-file "Build/OvmfIa32/RELEASE_GCC49/FV/OVMF.fd"
+ (copy-file (string-append "Build/OvmfIa32/RELEASE_"
toolchain-ver "/FV/OVMF.fd")
(string-append fmw "/ovmf_ia32.bin"))
#$@(if (string=? "x86_64-linux" (%current-system))
- '((copy-file
"Build/OvmfX64/RELEASE_GCC49/FV/OVMF.fd"
+ '((copy-file (string-append
"Build/OvmfX64/RELEASE_" toolchain-ver "/FV/OVMF.fd")
(string-append fmw
"/ovmf_x64.bin")))
'())))))))
(native-inputs
`(("acpica" ,acpica)
("gcc@5" ,gcc-5)
("nasm" ,nasm)
- ("python-2" ,python-2)
+ ("perl" ,perl)
+ ("python-3" ,python-3)
("util-linux" ,util-linux "lib")))
(supported-systems '("x86_64-linux" "i686-linux"))
(home-page "https://www.tianocore.org")

base-commit: af6105afc67a15a491a0a4fd18a28c9f801a0b94
--
2.41.0
S
S
spacecadet wrote on 12 Nov 2023 04:02
[PATCH 2/4] gnu: ovmf: Add OVMF_CODE and OVMF_VARS files.
(address . 67119@debbugs.gnu.org)
b891d6e1940d959979fc355f8e102f92@purge.sh
Add OVMF_CODE.fd and OVMF_VARS.fs to outputs as ovmf_code_arch.bin and
ovmf_vars_arch.bin, respectively, for both ia32 and x64 architectures.
---
gnu/packages/firmware.scm | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)

Toggle diff (38 lines)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index fd8b6bb8f0..53b89e4d90 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -954,12 +954,17 @@ (define-public ovmf
(let ((fmw (string-append #$output "/share/firmware"))
(toolchain-ver #$toolchain-ver))
(mkdir-p fmw)
- (copy-file (string-append "Build/OvmfIa32/RELEASE_"
toolchain-ver "/FV/OVMF.fd")
- (string-append fmw "/ovmf_ia32.bin"))
- #$@(if (string=? "x86_64-linux" (%current-system))
- '((copy-file (string-append
"Build/OvmfX64/RELEASE_" toolchain-ver "/FV/OVMF.fd")
- (string-append fmw
"/ovmf_x64.bin")))
- '())))))))
+ (for-each
+ (lambda (file)
+ (copy-file (string-append
"Build/OvmfIa32/RELEASE_" toolchain-ver "/FV/" file ".fd")
+ (string-append fmw "/"
(string-downcase file) "_ia32.bin"))
+ #$@(if (string=? "x86_64-linux"
(%current-system))
+ '((copy-file (string-append
"Build/OvmfX64/RELEASE_" toolchain-ver "/FV/" file ".fd")
+ (string-append fmw "/"
(string-downcase file) "_x64.bin")))
+ '()))
+ (list "OVMF"
+ "OVMF_CODE"
+ "OVMF_VARS"))))))))
(native-inputs
`(("acpica" ,acpica)
("gcc@5" ,gcc-5)
--
2.41.0
S
S
spacecadet wrote on 12 Nov 2023 04:06
[PATCH 3/4] gnu: ovmf: Update ovmf-aarch64 to use GCC5.
(address . 67119@debbugs.gnu.org)
e8374e9d185ea2c1f0bd6da0f5c6a863@purge.sh
Updating OVMF to 202308 requires GCC5, packages inheriting from ovmf
also need to be updated.
---
gnu/packages/firmware.scm | 61 ++++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 30 deletions(-)

Toggle diff (83 lines)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 53b89e4d90..e713aa9ac6 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -981,36 +981,37 @@ (define-public ovmf
license:bsd-2 license:bsd-3 license:bsd-4)))))

(define-public ovmf-aarch64
- (package
- (inherit ovmf)
- (name "ovmf-aarch64")
- (native-inputs
- (append (package-native-inputs ovmf)
- (if (not (string-prefix? "aarch64" (%current-system)))
- `(("cross-gcc" ,(cross-gcc "aarch64-linux-gnu"))
- ("cross-binutils" ,(cross-binutils
"aarch64-linux-gnu")))
- '())))
- (arguments
- (substitute-keyword-arguments (package-arguments ovmf)
- ((#:phases phases)
- #~(modify-phases #$phases
- #$@(if (string-prefix? "aarch64" (%current-system))
- '()
- '((add-before 'configure 'set-env
- (lambda _
- (setenv "GCC49_AARCH64_PREFIX"
"aarch64-linux-gnu-")))))
- (replace 'build
- (lambda _
- (invoke "build" "-a" "AARCH64" "-t" "GCC49"
- "-p" "ArmVirtPkg/ArmVirtQemu.dsc")))
- (delete 'build-x64)
- (replace 'install
- (lambda _
- (let ((fmw (string-append #$output "/share/firmware")))
- (mkdir-p fmw)
- (copy-file
"Build/ArmVirtQemu-AARCH64/RELEASE_GCC49/FV/QEMU_EFI.fd"
- (string-append fmw
"/ovmf_aarch64.bin")))))))))
- (supported-systems %supported-systems)))
+ (let ((toolchain-ver "GCC5"))
+ (package
+ (inherit ovmf)
+ (name "ovmf-aarch64")
+ (native-inputs
+ (append (package-native-inputs ovmf)
+ (if (not (string-prefix? "aarch64" (%current-system)))
+ `(("cross-gcc" ,(cross-gcc "aarch64-linux-gnu"))
+ ("cross-binutils" ,(cross-binutils
"aarch64-linux-gnu")))
+ '())))
+ (arguments
+ (substitute-keyword-arguments (package-arguments ovmf)
+ ((#:phases phases)
+ #~(modify-phases #$phases
+ #$@(if (string-prefix? "aarch64" (%current-system))
+ '()
+ #~((add-before 'configure 'set-env
+ (lambda _
+ (setenv (string-append #$toolchain-ver
"_AARCH64_PREFIX") "aarch64-linux-gnu-")))))
+ (replace 'build
+ (lambda _
+ (invoke "build" "-a" "AARCH64" "-t" #$toolchain-ver
+ "-p" "ArmVirtPkg/ArmVirtQemu.dsc")))
+ (delete 'build-x64)
+ (replace 'install
+ (lambda _
+ (let ((fmw (string-append #$output
"/share/firmware")))
+ (mkdir-p fmw)
+ (copy-file (string-append
"Build/ArmVirtQemu-AARCH64/RELEASE_" #$toolchain-ver "/FV/QEMU_EFI.fd")
+ (string-append fmw
"/ovmf_aarch64.bin")))))))))
+ (supported-systems %supported-systems))))

(define-public ovmf-arm
(package
--
2.41.0
S
S
spacecadet wrote on 12 Nov 2023 04:07
[PATCH 4/4] gnu: ovmf: Update ovmf-arm with GCC5.
(address . 67119@debbugs.gnu.org)
c4637fa2f6256a0bdbdc37b0a4fb2b4d@purge.sh
Updating OVMF to 202308 requires GCC5, packages inheriting from ovmf
also need to be updated.
---
gnu/packages/firmware.scm | 61 ++++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 30 deletions(-)

Toggle diff (84 lines)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index e713aa9ac6..0ee618cbcb 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -1014,36 +1014,37 @@ (define-public ovmf-aarch64
(supported-systems %supported-systems))))

(define-public ovmf-arm
- (package
- (inherit ovmf)
- (name "ovmf-arm")
- (native-inputs
- (append (package-native-inputs ovmf)
- (if (not (string-prefix? "armhf" (%current-system)))
- `(("cross-gcc" ,(cross-gcc "arm-linux-gnueabihf"))
- ("cross-binutils" ,(cross-binutils
"arm-linux-gnueabihf")))
- '())))
- (arguments
- (substitute-keyword-arguments (package-arguments ovmf)
- ((#:phases phases)
- #~(modify-phases #$phases
- #$@(if (string-prefix? "armhf" (%current-system))
- '()
- '((add-before 'configure 'set-env
- (lambda _
- (setenv "GCC49_ARM_PREFIX"
"arm-linux-gnueabihf-")))))
- (replace 'build
- (lambda _
- (invoke "build" "-a" "ARM" "-t" "GCC49"
- "-p" "ArmVirtPkg/ArmVirtQemu.dsc")))
- (delete 'build-x64)
- (replace 'install
- (lambda _
- (let ((fmw (string-append #$output "/share/firmware")))
- (mkdir-p fmw)
- (copy-file
"Build/ArmVirtQemu-ARM/RELEASE_GCC49/FV/QEMU_EFI.fd"
- (string-append fmw
"/ovmf_arm.bin")))))))))
- (supported-systems %supported-systems)))
+ (let ((toolchain-ver "GCC5"))
+ (package
+ (inherit ovmf)
+ (name "ovmf-arm")
+ (native-inputs
+ (append (package-native-inputs ovmf)
+ (if (not (string-prefix? "armhf" (%current-system)))
+ `(("cross-gcc" ,(cross-gcc "arm-linux-gnueabihf"))
+ ("cross-binutils" ,(cross-binutils
"arm-linux-gnueabihf")))
+ '())))
+ (arguments
+ (substitute-keyword-arguments (package-arguments ovmf)
+ ((#:phases phases)
+ #~(modify-phases #$phases
+ #$@(if (string-prefix? "armhf" (%current-system))
+ '()
+ #~((add-before 'configure 'set-env
+ (lambda _
+ (setenv (string-append #$toolchain-ver
"_ARM_PREFIX") "arm-linux-gnueabihf-")))))
+ (replace 'build
+ (lambda _
+ (invoke "build" "-a" "ARM" "-t" #$toolchain-ver
+ "-p" "ArmVirtPkg/ArmVirtQemu.dsc")))
+ (delete 'build-x64)
+ (replace 'install
+ (lambda _
+ (let ((fmw (string-append #$output
"/share/firmware")))
+ (mkdir-p fmw)
+ (copy-file (string-append
"Build/ArmVirtQemu-ARM/RELEASE_" #$toolchain-ver "/FV/QEMU_EFI.fd")
+ (string-append fmw
"/ovmf_arm.bin")))))))))
+ (supported-systems %supported-systems))))

(define* (make-arm-trusted-firmware platform
#:key (triplet
"aarch64-linux-gnu"))
--
2.41.0
L
L
Ludovic Courtès wrote on 11 Dec 2023 23:34
Re: [bug#67119] [PATCH 1/4] gnu: ovmf: Update to 202308.
(address . spacecadet@purge.sh)
875y142wtc.fsf@gnu.org
Hi,

spacecadet@purge.sh skribis:

Toggle quote (3 lines)
> Update package to 202308 and add toolchain-ver variable for the GCC
> version being use in the build.

Cc’ing the ‘embedded’ team so they can take a look.


Ludo’.
E
E
Efraim Flashner wrote on 19 Dec 2023 15:32
(address . spacecadet@purge.sh)(address . 67119-done@debbugs.gnu.org)
ZYGpmtbTDIVrGFkp@3900XT
Thanks. Patches pushed!

--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmWBqZoACgkQQarn3Mo9
g1GTHw//Q/zMBpoh8IJgKOEtkJAUfWikSf6ltRegV+GjMl+E30PBQo5/t4x0r6CO
Z3lQROFME4TukG7mkHMLzNfXlCxzR9jKjsU3jo9j3ffCP+tjBzcgLEWsJUTQ9wn0
iePTXyUfN0pU7JZXyVw9EFXFIXIjKKBmwuuuU1e/UFaHdp2WkqfWLU7NFB1RKYZO
Q6GfiRQ9lEQfZSCDEEi/l7hnlzPubn84Ol939t0+0klOppCLP0S8XfsP2vI+zZDG
f17Jeqv50iWAsq+LnwlalYV2oLqMnmxzYfMyvEhPQ7Kh2E93rLilbi9E0witw0Qf
b5hfBYJrq9YAVywpjcNaSXBDyCvgcaikXNS2FQ+6eeqwjzqs6B7BqF4MOE/glEhw
6f/H8+giwpGhdrNtVbZTux/OJwdzwGBl3dQ0KbU5hjpbaK8Bmdr9NozIuCq9wncH
WLKWRUNrei1ajOmjebxlDTvfb+i7hKCwkbqXeFL8aBrPm/KVwzQs14RktnFMksuP
bQ68AmZcmPaaWpTN0+X9stfEeEjaalSOvF/XZCujpNYWY6qPBbxbh5GMcxEFBwEG
7+fh9rcWg3KTzvZkb89YxJ1JsJyM406t//t7sgQYwk1nCEiwiSI3hewypBQB+M6g
uUFPloogsyWVrXwkCNDdsi6FE786QQt3uDVEmt+xuXxoZvLmn7w=
=ZsU5
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 67119@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 67119
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch