all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: David Craven <david@craven.ch>, guix-devel@gnu.org
Subject: Re: [PATCH 3/5] gnu: Add ovmf.
Date: Fri, 10 Feb 2017 01:15:55 +0100	[thread overview]
Message-ID: <87fujmsxxg.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <20170209190450.29458-6-david@craven.ch>

[-- Attachment #1: Type: text/plain, Size: 5150 bytes --]

David Craven <david@craven.ch> writes:

> * gnu/packages/grub.scm (ovmf): New variable.

I would place this too in firmware.scm.

> ---
>  gnu/packages/grub.scm | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 82 insertions(+)
>
> diff --git a/gnu/packages/grub.scm b/gnu/packages/grub.scm
> index a775e213c..4da01ceb9 100644
> --- a/gnu/packages/grub.scm
> +++ b/gnu/packages/grub.scm
> @@ -22,11 +22,14 @@
>  
>  (define-module (gnu packages grub)
>    #:use-module (guix download)
> +  #:use-module (guix git-download)
>    #:use-module (guix packages)
>    #:use-module (guix utils)
>    #:use-module ((guix licenses) #:prefix license:)
>    #:use-module (guix build-system gnu)
>    #:use-module (gnu packages)
> +  #:use-module (gnu packages admin)
> +  #:use-module (gnu packages assembly)
>    #:use-module (gnu packages flex)
>    #:use-module (gnu packages disk)
>    #:use-module (gnu packages bison)
> @@ -188,3 +191,82 @@ 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+))))
> +
> +;; OVMF is part of the edk2 source tree.
> +(define edk2-commit "13a50a6fe1dcfa6600c38456ee24e0f9ecf51b5f")
> +(define edk2-version (git-version "20170116" "1" edk2-commit))
> +(define edk2-origin
> +  (origin
> +    (method git-fetch)
> +    (uri (git-reference
> +          (url "https://github.com/tianocore/edk2")
> +          (commit edk2-commit)))
> +    (file-name (git-file-name "edk2" edk2-version))
> +    (sha256
> +     (base32
> +      "1gy2332kdqk8bjzpcsripx10896rbvgl0ic7r344kmpiwdgm948b"))))
> +
> +(define-public ovmf
> +  (package
> +    (name "ovmf")
> +    (version edk2-version)
> +    (source edk2-origin)
> +    (build-system gnu-build-system)
> +    (native-inputs
> +     `(("acpica" ,acpica)
> +       ("nasm" ,nasm)
> +       ("python-2" ,python-2)
> +       ("util-linux" ,util-linux)))
> +    (arguments
> +     `(#:tests? #f ; No check target.
> +       #:phases
> +       (modify-phases %standard-phases
> +         (replace 'configure
> +           (lambda _
> +             (let* ((cwd (getcwd))
> +                    (tools (string-append cwd "/BaseTools"))
> +                    (bin (string-append tools "/BinWrappers/PosixLike")))
> +               (setenv "WORKSPACE" cwd)
> +               (setenv "EDK_TOOLS_PATH" tools)
> +               (setenv "PATH" (string-append (getenv "PATH") ":" bin))
> +               (system* "bash" "edksetup.sh" "BaseTools")
> +               (substitute* "Conf/target.txt"
> +                 (("^TARGET[ ]*=.*$") "TARGET = RELEASE\n")
> +                 (("^TOOL_CHAIN_TAG[ ]*=.*$") "TOOL_CHAIN_TAG = GCC49\n")
> +                 (("^MAX_CONCURRENT_THREAD_NUMBER[ ]*=.*$")
> +                  (format #f "MAX_CONCURRENT_THREAD_NUMBER = ~a~%"
> +                          (number->string (parallel-job-count)))))
> +               ;; Build build support.
> +               (setenv "BUILD_CC" "gcc")
> +               (zero? (system* "make" "-C" (string-append tools "/Source/C"))))))
> +         (add-after 'build 'build-ia32

I would simply (replace 'build ...) here, instead of deleting it and
using add-after.

> +           (lambda _
> +             (substitute* "Conf/target.txt"
> +               (("^TARGET_ARCH[ ]*=.*$") "TARGET_ARCH = IA32\n")
> +               (("^ACTIVE_PLATFORM[ ]*=.*$")
> +                "ACTIVE_PLATFORM = OvmfPkg/OvmfPkgIa32.dsc\n"))
> +             (zero? (system* "build"))))
> +         (add-after 'build 'build-x64
> +           (lambda _
> +             (substitute* "Conf/target.txt"
> +               (("^TARGET_ARCH[ ]*=.*$") "TARGET_ARCH = X64\n")
> +               (("^ACTIVE_PLATFORM[ ]*=.*$")
> +                "ACTIVE_PLATFORM = OvmfPkg/OvmfPkgX64.dsc\n"))
> +             (zero? (system* "build"))))
> +         (delete 'build)
> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (fmw (string-append out "/share/firmware")))
> +               (mkdir-p fmw)
> +               (copy-file "Build/OvmfIa32/RELEASE_GCC49/FV/OVMF.fd"
> +                          (string-append fmw "/ovmf_ia32.bin"))
> +               (copy-file "Build/OvmfX64/RELEASE_GCC49/FV/OVMF.fd"
> +                          (string-append fmw "/ovmf_x64.bin")))
> +             #t)))))
> +    (supported-systems '("x86_64-linux" "i686-linux"))

Is it not possible to build this firmware on (not for) other archs?

> +    (home-page "http://www.tianocore.org")
> +    (synopsis "UEFI firmware for QEMU")
> +    (description "OVMF is an EDK II based project to enable UEFI support for
> +Virtual Machines.  OVMF contains a sample UEFI firmware for QEMU and KVM.")
> +    (license license:expat)))

There appears to also be a good number of bsd-{2,3,4} licensed files in
this distribution. I've tested both this and seabios with qemu, great
work! :-)

> -- 
> 2.11.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2017-02-10  0:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-09 19:04 [PATCH] enable debug symbols David Craven
2017-02-09 19:04 ` [PATCH 1/5] gnu: Use 'license:' prefix in (gnu packages grub) David Craven
2017-02-09 23:45   ` Marius Bakke
2017-02-09 19:04 ` [PATCH] update epiphany David Craven
2017-02-10  0:31   ` Mark H Weaver
2017-02-09 19:04 ` [PATCH] update libdrm David Craven
2017-02-09 19:12   ` Marius Bakke
2017-02-09 19:32     ` David Craven
2017-02-10  0:32   ` Mark H Weaver
2017-02-10 12:29     ` David Craven
2017-02-09 19:04 ` [PATCH 2/5] gnu: Add seabios David Craven
2017-02-09 23:55   ` Marius Bakke
2017-02-09 19:04 ` [PATCH 3/5] gnu: Add ovmf David Craven
2017-02-10  0:15   ` Marius Bakke [this message]
2017-02-10 13:18     ` David Craven
2017-02-09 19:04 ` [PATCH 4/5] gnu: Add syslinux David Craven
2017-02-10  1:18   ` Marius Bakke
2017-02-10 14:24     ` David Craven
2017-02-09 19:04 ` [PATCH 5/5] gnu: Move (gnu packages grub) and (gnu packages u-boot) ... to (gnu packages bootloaders) David Craven
2017-02-09 19:07 ` [PATCH] enable debug symbols David Craven
2017-02-09 19:23   ` Marius Bakke
2017-02-09 19:29     ` David Craven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fujmsxxg.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me \
    --to=mbakke@fastmail.com \
    --cc=david@craven.ch \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.