Gentoo Archives: gentoo-commits

From: Florian Schmaus <flow@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/grub-xen-host/
Date: Sun, 05 Jun 2022 15:57:16
Message-Id: 1654444630.2d02799150c0c14511a861f3493bc813f6434d25.flow@gentoo
1 commit: 2d02799150c0c14511a861f3493bc813f6434d25
2 Author: Florian Schmaus <flow <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 5 15:56:28 2022 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 5 15:57:10 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d027991
7
8 app-emulation/grub-xen-host: update EAPI 7 -> 8
9
10 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
11
12 .../grub-xen-host/grub-xen-host-1.0-r2.ebuild | 98 ++++++++++++++++++++++
13 1 file changed, 98 insertions(+)
14
15 diff --git a/app-emulation/grub-xen-host/grub-xen-host-1.0-r2.ebuild b/app-emulation/grub-xen-host/grub-xen-host-1.0-r2.ebuild
16 new file mode 100644
17 index 000000000000..b8d6cc67d3e4
18 --- /dev/null
19 +++ b/app-emulation/grub-xen-host/grub-xen-host-1.0-r2.ebuild
20 @@ -0,0 +1,98 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=8
25 +
26 +DESCRIPTION="Grub2 built as a PV grub per the Xen PV Boot Protocol"
27 +HOMEPAGE="https://wiki.xenproject.org/wiki/PvGrub2"
28 +
29 +LICENSE="BSD-2"
30 +SLOT="0"
31 +KEYWORDS="~amd64"
32 +IUSE="pvh"
33 +
34 +DEPEND="
35 + sys-boot/grub:2=[grub_platforms_xen]
36 + pvh? ( >=sys-boot/grub-2.04:2=[grub_platforms_xen-pvh] )
37 +"
38 +RDEPEND="${DEPEND}"
39 +
40 +S="${WORKDIR}"
41 +
42 +RESTRICT="binchecks strip test"
43 +
44 +src_configure() {
45 + :
46 +}
47 +
48 +src_compile() {
49 + cat > "${S}/grub-bootstrap.cfg" <<- EOF || die
50 + normal (memdisk)/grub.cfg
51 + EOF
52 +
53 + cat > "${S}/grub.cfg" <<- EOF || die
54 + if search -s -f /boot/xen/pvboot-x86_64.elf ; then
55 + echo "Chainloading (${root})/boot/xen/pvboot-x86_64.elf"
56 + multiboot "/boot/xen/pvboot-x86_64.elf"
57 + boot
58 + fi
59 +
60 + if search -s -f /xen/pvboot-x86_64.elf ; then
61 + echo "Chainloading (${root})/xen/pvboot-x86_64.elf"
62 + multiboot "/xen/pvboot-x86_64.elf"
63 + boot
64 + fi
65 +
66 + if search -s -f /boot/grub/grub.cfg ; then
67 + echo "Reading (${root})/boot/grub/grub.cfg"
68 + configfile /boot/grub/grub.cfg
69 + fi
70 +
71 + if search -s -f /grub/grub.cfg ; then
72 + echo "Reading (${root})/grub/grub.cfg"
73 + configfile /grub/grub.cfg
74 + fi
75 + EOF
76 +
77 + tar cf memdisk.tar grub.cfg || die "failed to tar"
78 +
79 + local grub_mkimage=grub-mkimage
80 + if type grub2-mkimage &> /dev/null; then
81 + grub_mkimage=grub2-mkimage
82 + fi
83 +
84 + local args=(
85 + "${grub_mkimage}"
86 + -O x86_64-xen
87 + -c grub-bootstrap.cfg
88 + -m memdisk.tar
89 + -p "${EPREFIX}"/usr/lib/grub/x86_64-xen/*.mod
90 + -o grub-x86_64-xen.bin
91 + )
92 +
93 + echo "${args[@]}"
94 + "${args[@]}" || die "failed to grub-mkimage"
95 +
96 + if use pvh; then
97 + local args=(
98 + "${grub_mkimage}"
99 + -O i386-xen_pvh
100 + -c grub-bootstrap.cfg
101 + -m memdisk.tar
102 + -p "${EPREFIX}"/usr/lib/grub/i386-xen_pvh/*.mod
103 + -o grub-i386-xen_pvh.bin
104 + )
105 +
106 + echo "${args[@]}"
107 + "${args[@]}" || die "failed to grub-mkimage"
108 + fi
109 +
110 +}
111 +
112 +src_install() {
113 + exeinto /usr/libexec/xen/bin
114 + doexe grub-x86_64-xen.bin
115 + if use pvh; then
116 + doexe grub-i386-xen_pvh.bin
117 + fi
118 +}