summaryrefslogtreecommitdiff
blob: caa0be068b49ace8bf2266b0d2c250f170f0752a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

DESCRIPTION="Binaries for the EDK2 plattform (UEFI tools)"
HOMEPAGE="http://sourceforge.net/apps/mediawiki/tianocore"
SRC_URI="http://pentoo-uefi.googlecode.com/files/${PF}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE="hello-world kvm shell"
REQUIRED_USE="|| ( hello-world kvm shell )"

DEPEND=""
RDEPEND="kvm? ( >=app-emulation/qemu-0.9.1 )"

# S="$(dirname ${S})"
S="${WORKDIR}/${PF}"

src_install(){
	if use hello-world; then
		insinto "/usr/share/${PN}/hello-world"
		doins "HelloWorld.efi"
		doins "startup.nsh"
	fi

	if use kvm; then
		insinto "/usr/share/${PN}/kvm"
		newins OVMF.fd uefibios.bin
		newins CirrusLogic5446.rom vgabios-cirrus.bin
		dosym "../${PN}/kvm/uefibios.bin" /usr/share/qemu/uefibios-bin.bin
	fi

	if use shell; then
		insinto "/usr/share/${PN}/shell"
		newins Shell.efi Shellx64.efi
	fi
}

pkg_postinst() {
	use kvm && einfo "To use uefi with qemu, start it with '-bios uefibios.bin'"
	if use hello-world; then
		einfo "A sample HelloWorld.efi was installed in /usr/share/${PN}/hello-world."
		if use kvm; then
			einfo "To test the uefi support in kvm, simply run:"
			einfo "	qemu-kvm -hda fat:/usr/share/${PN}/hello-world -bios uefibios-bin.bin"
			einfo "and await the message 'UEFI Hello World!' before the shell prompt appears."
		fi
	fi
}