diff options
Diffstat (limited to 'app-emulation/grub-xen-host')
-rw-r--r-- | app-emulation/grub-xen-host/Manifest | 3 | ||||
-rw-r--r-- | app-emulation/grub-xen-host/grub-xen-host-1.0-r1.ebuild | 98 | ||||
-rw-r--r-- | app-emulation/grub-xen-host/metadata.xml | 3 |
3 files changed, 103 insertions, 1 deletions
diff --git a/app-emulation/grub-xen-host/Manifest b/app-emulation/grub-xen-host/Manifest index a1363b0097e0..dfe92eda0d98 100644 --- a/app-emulation/grub-xen-host/Manifest +++ b/app-emulation/grub-xen-host/Manifest @@ -1,2 +1,3 @@ +EBUILD grub-xen-host-1.0-r1.ebuild 2054 BLAKE2B e9e3dec0b91d9e60395bf772486e725ae18e32981a38279e3255dad19c0860f6323ca006243be22ca3dba07a797983ffe60b50ca01a22f96ca6302f5ab719507 SHA512 d8b5bbbfe0e95afa3c44b8e3b8f323e5bb2f49ec86b32c81d0e6021feef7c959dbcda83e8d43f7e79353bd6fc406b624c52215a745eb551ebf7c808cf05e3a2e EBUILD grub-xen-host-1.0.ebuild 1682 BLAKE2B 3d718f06ccef3a0fc4d3d39d64e8fb39af24f558793e4f7c96ec616585cf95371091737287bbc282476c1a649bd390e0a4eda0da168c8c40b5c9294e24eded8f SHA512 08e24d2b9b0c45af8cc757fe8c7dd29d5e69803b953897c2e552053f09358a8ae1a328402f148337ba738476c14e1c6db4fa4f37d68d04a4c65b7cdc208bb83c -MISC metadata.xml 437 BLAKE2B 632a6d7b1d99a24f04d533cd82c0c95bc851b912865f3d12f6dd1b187abbd76070657c1b93e3046f20ba32a42d51c25716843635414e651223621dafefda2d46 SHA512 dbca261ad36e310a76bc56464c25142647625f6696d987ab3af5dc834a0da6e189f6bfa133713137fb8481ef429f074b574bfebe7c12ee93e2b898c4c116a17c +MISC metadata.xml 516 BLAKE2B f9183f3e1f7b6de089e478a77b9ff6282cdffc9cad59ed045488025ea05a12997ac18506f089396e99320d98159d8c1631d5ee8a81debc0647b24b66f253e9d3 SHA512 495b6a380e366760ce97f8d865c2ae118ed6a7c189983d871c6517b08e1a86e8d6a47fb43b85c2f175a10a234e1895fbabc98c4806eb79aade14955841a90813 diff --git a/app-emulation/grub-xen-host/grub-xen-host-1.0-r1.ebuild b/app-emulation/grub-xen-host/grub-xen-host-1.0-r1.ebuild new file mode 100644 index 000000000000..288e12680781 --- /dev/null +++ b/app-emulation/grub-xen-host/grub-xen-host-1.0-r1.ebuild @@ -0,0 +1,98 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +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="pvh" + +DEPEND="sys-boot/grub:2=[grub_platforms_xen] + pvh? ( >=sys-boot/grub-2.04:2=[grub_platforms_xen-pvh] ) + app-emulation/xen-tools:=" +RDEPEND="${DEPEND}" + +S="${WORKDIR}" + +RESTRICT="binchecks strip test" + +src_configure() { + : +} + +src_compile() { + cat > "${S}/grub-bootstrap.cfg" <<- EOF || die + normal (memdisk)/grub.cfg + EOF + + cat > "${S}/grub.cfg" <<- EOF || die + 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" + + local grub_mkimage=grub-mkimage + if type grub2-mkimage &> /dev/null; then + grub_mkimage=grub2-mkimage + fi + + local args=( + "${grub_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 + ) + + echo "${args[@]}" + "${args[@]}" || die "failed to grub-mkimage" + + if use pvh; then + local args=( + "${grub_mkimage}" + -O i386-xen_pvh + -c grub-bootstrap.cfg + -m memdisk.tar + -o grub-i386-xen_pvh.bin + /usr/lib/grub/i386-xen_pvh/*.mod + ) + + echo "${args[@]}" + "${args[@]}" || die "failed to grub-mkimage" + fi + +} + +src_install() { + exeinto /usr/libexec/xen/bin + doexe grub-x86_64-xen.bin + if use pvh; then + doexe grub-i386-xen_pvh.bin + fi +} diff --git a/app-emulation/grub-xen-host/metadata.xml b/app-emulation/grub-xen-host/metadata.xml index 212093a6f10e..485b9cd416b6 100644 --- a/app-emulation/grub-xen-host/metadata.xml +++ b/app-emulation/grub-xen-host/metadata.xml @@ -9,4 +9,7 @@ a guest installed PV grub (grub legacy or grub 2) or handle a guest supplied grub 2 config file. </longdescription> + <use> + <flag name="pvh">Build an additional grub bin for pvh.</flag> + </use> </pkgmetadata> |