summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2016-01-03 14:16:07 -0600
committerDoug Goldstein <cardoe@gentoo.org>2016-02-06 15:42:44 -0600
commit3387c0a6f28f10d691dee9c96cca9c17c17b62f8 (patch)
treec3ee76bfc293af6ce1f57628f1d390549a22c6a8 /app-emulation/grub-xen-host
parentdev-ruby/rkelly-remix: metasploit users are stuck with 0.0.6 and may want rub... (diff)
downloadgentoo-3387c0a6f28f10d691dee9c96cca9c17c17b62f8.tar.gz
gentoo-3387c0a6f28f10d691dee9c96cca9c17c17b62f8.tar.bz2
gentoo-3387c0a6f28f10d691dee9c96cca9c17c17b62f8.zip
app-emulation/grub-xen-host: initial version
Initial version to provide a dom0 host PV grub based on grub 2. Package-Manager: portage-2.2.26 Signed-off-by: Doug Goldstein <cardoe@gentoo.org>
Diffstat (limited to 'app-emulation/grub-xen-host')
-rw-r--r--app-emulation/grub-xen-host/grub-xen-host-1.0.ebuild74
-rw-r--r--app-emulation/grub-xen-host/metadata.xml15
2 files changed, 89 insertions, 0 deletions
diff --git a/app-emulation/grub-xen-host/grub-xen-host-1.0.ebuild b/app-emulation/grub-xen-host/grub-xen-host-1.0.ebuild
new file mode 100644
index 000000000000..292c3380101d
--- /dev/null
+++ b/app-emulation/grub-xen-host/grub-xen-host-1.0.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+DESCRIPTION="Grub2 built as a PV grub per the Xen PV Boot Protocol"
+HOMEPAGE="https://blog.xenproject.org/2015/01/07/using-grub-2-as-a-bootloader-for-xen-pv-guests/"
+SRC_URI=""
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="amd64"
+IUSE=""
+
+DEPEND="sys-boot/grub:2=[grub_platforms_xen]
+ app-emulation/xen-tools:="
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}"
+
+STRIP_MASK="usr/libexec/xen/bin/grub-x86_64-xen.bin"
+QA_EXECSTACK="usr/libexec/xen/bin/grub-x86_64-xen.bin"
+QA_WX_LOAD="usr/libexec/xen/bin/grub-x86_64-xen.bin"
+QA_PRESTRIPPED="usr/libexec/xen/bin/grub-x86_64-xen.bin"
+RESTRICT="test"
+
+src_configure() {
+ :
+}
+
+src_compile() {
+ cat > "${S}/grub-bootstrap.cfg" <<- EOF
+ normal (memdisk)/grub.cfg
+ EOF
+
+ cat > "${S}/grub.cfg" <<- EOF
+ if search -s -f /boot/xen/pvboot-x86_64.elf ; then
+ echo "Chainloading (${root})/boot/xen/pvboot-x86_64.elf"
+ multiboot "/boot/xen/pvboot-x86_64.elf"
+ boot
+ fi
+
+ if search -s -f /xen/pvboot-x86_64.elf ; then
+ echo "Chainloading (${root})/xen/pvboot-x86_64.elf"
+ multiboot "/xen/pvboot-x86_64.elf"
+ boot
+ fi
+
+ if search -s -f /boot/grub/grub.cfg ; then
+ echo "Reading (${root})/boot/grub/grub.cfg"
+ configfile /boot/grub/grub.cfg
+ fi
+
+ if search -s -f /grub/grub.cfg ; then
+ echo "Reading (${root})/grub/grub.cfg"
+ configfile /grub/grub.cfg
+ fi
+ EOF
+
+ tar cf memdisk.tar grub.cfg || die "failed to tar"
+
+ grub2-mkimage -O x86_64-xen \
+ -c grub-bootstrap.cfg \
+ -m memdisk.tar \
+ -o grub-x86_64-xen.bin \
+ /usr/lib/grub/x86_64-xen/*.mod \
+ || die "failed to grub-mkimage"
+}
+
+src_install() {
+ exeinto /usr/libexec/xen/bin
+ doexe grub-x86_64-xen.bin
+}
diff --git a/app-emulation/grub-xen-host/metadata.xml b/app-emulation/grub-xen-host/metadata.xml
new file mode 100644
index 000000000000..d1cd7801fdce
--- /dev/null
+++ b/app-emulation/grub-xen-host/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>xen@gentoo.org</email>
+ </maintainer>
+ <maintainer>
+ <email>cardoe@gentoo.org</email>
+ </maintainer>
+ <longdescription lang="en">
+ A grub 2 built to run in dom0 which is a PV grub that can chain load
+ a guest installed PV grub (grub legacy or grub 2) or handle a guest
+ supplied grub 2 config file.
+ </longdescription>
+</pkgmetadata>