add(sys-firmware/edk2-ovmf): Add UEFI firmware for QEMU

To use either run qemu with:
  -bios efi-bios.bin
Or:
  -L path/to/usr/share/edk2-ovmf

The latter is useful if you want to use the OVMF built by the SDK
outside of the SDK. Using UEFI with the QEMU instance inside the CoreOS
SDK is kinda awkward because serial doesn't work and UEFI uses a VGA
graphics framebuffer mode, not VGA text mode so -curses doesn't work
either. In any case, it is a start.
This commit is contained in:
Michael Marineau 2014-01-07 23:04:07 -08:00
parent b0beaa285e
commit 486057cfb0
3 changed files with 73 additions and 0 deletions

View File

@ -0,0 +1 @@
DIST edk2-15046.tar.xz 21148204 SHA256 3764f113b04d9d3af9a1152a81866c802885329e6f8bc41dda32b70900fa26f9 SHA512 7073d0f3809dc0f39e7283ffa53201b4d2e30e912f1e50f2e17083181e4867d15535beac192f65575deef0649257378b2ec507772891aec11f9fc99bba4c4c80 WHIRLPOOL 91b78c5c3c805fb207cdc6cfeb52fe5478c0fa914101ef27b5272dc2e6f0b431ff08a1d354e5dd7fba75bfdd2e52a4d05ce014d66b9606f878eee21d65a5407b

View File

@ -0,0 +1 @@
edk2-ovmf-99999.ebuild

View File

@ -0,0 +1,71 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
inherit multiprocessing toolchain-funcs
DESCRIPTION="EDK II Open Source UEFI Firmware"
HOMEPAGE="http://tianocore.sourceforge.net"
LICENSE="BSD-2"
SLOT="0"
IUSE="+qemu"
if [[ ${PV} == 99999 ]]; then
inherit subversion
ESVN_REPO_URI="https://svn.code.sf.net/p/edk2/code/trunk/edk2"
KEYWORDS="-* ~amd64"
else
MY_P="edk2-${PV}"
S="${WORKDIR}/${MY_P}"
SRC_URI="http://storage.core-os.net/mirror/snapshots/${MY_P}.tar.xz"
KEYWORDS="-* amd64"
fi
DEPEND="sys-power/iasl"
RDEPEND="qemu? ( app-emulation/qemu )"
edk_build() {
local package="$1"
# Use a subshell since edksetup.sh expects to be sourced.
( export WORKSPACE="${S}" EDK_TOOLS_PATH="${S}/BaseTools"
source edksetup.sh BaseTools || exit $?
build -p "${package}" \
-a "${TARGET_ARCH}" \
-b "${TARGET_NAME}" \
-t "${TARGET_TOOLS}" \
-n "${BUILD_JOBS}" || exit $?
) || die "Building EDK package ${package} failed"
}
src_configure() {
./edksetup.sh || die
BUILD_JOBS=$(makeopts_jobs)
TARGET_NAME="RELEASE"
TARGET_TOOLS="GCC$(gcc-version | tr -d .)"
case $ARCH in
amd64) TARGET_ARCH=X64 ;;
#x86) TARGET_ARCH=IA32 ;;
*) die "Unsupported $ARCH" ;;
esac
}
src_compile() {
emake ARCH=${TARGET_ARCH} -C BaseTools -j1
edk_build OvmfPkg/OvmfPkgX64.dsc
}
src_install() {
insinto /usr/share/${PN}
doins Build/OvmfX64/${TARGET_NAME}_${TARGET_TOOLS}/FV/OVMF.fd
dosym OVMF.fd /usr/share/${PN}/bios.bin
if use qemu; then
dosym ../${PN}/OVMF.fd /usr/share/qemu/efi-bios.bin
fi
}