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/xen/
Date: Wed, 24 Nov 2021 07:44:12
Message-Id: 1637739810.01eab127a243956ce4de2e0b9ce1221352851c86.flow@gentoo
1 commit: 01eab127a243956ce4de2e0b9ce1221352851c86
2 Author: Tomáš Mózes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Wed Nov 24 06:11:59 2021 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 24 07:43:30 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=01eab127
7
8 app-emulation/xen: add 4.14.3-r2 and 4.15.1-r2
9
10 Bug: https://bugs.gentoo.org/825354
11 Bug: https://bugs.gentoo.org/826998
12 Closes: https://bugs.gentoo.org/819408
13 Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
14 Closes: https://github.com/gentoo/gentoo/pull/23064
15 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
16
17 app-emulation/xen/Manifest | 2 +
18 app-emulation/xen/xen-4.14.3-r2.ebuild | 163 +++++++++++++++++++++++++++++++++
19 app-emulation/xen/xen-4.15.1-r2.ebuild | 163 +++++++++++++++++++++++++++++++++
20 3 files changed, 328 insertions(+)
21
22 diff --git a/app-emulation/xen/Manifest b/app-emulation/xen/Manifest
23 index 715314e8899a..55b93cc8c2ba 100644
24 --- a/app-emulation/xen/Manifest
25 +++ b/app-emulation/xen/Manifest
26 @@ -1,4 +1,6 @@
27 DIST xen-4.14.3-upstream-patches-0.tar.xz 3532 BLAKE2B b3e1530a9e14bb1481296f3a878cceb81f1979b1cfb9105d4d1b03681a3449c40cabd1807109acfb3742fd8085c28094c29889d22dab5a99c9bf22443d1e848e SHA512 d6b39830bff83da745279041d144d56c3b153beae09e96fa878397f388575d106509816d710e94fa79dd60a874087921eba98e1316877f6ef4591a12f05846ee
28 +DIST xen-4.14.3-upstream-patches-2.tar.xz 28336 BLAKE2B 45666fd4aa81c5b8d3c13f5fa949f30a3c168c3ece0109f66092a93d1c2c204dda21afdb46357ca836f763cddaa66a9dbe895939294db36ed28a348e0d92d072 SHA512 c80c4e1cf6c5b870d3471b7430478f1180704d55b5327ef0748e2dc5c3bc03eee05003888160a802b439a6a11aa6bd047122f340ea0cdc1b6bfd71371090e827
29 DIST xen-4.14.3.tar.gz 39982036 BLAKE2B 927fd2937f451567238702430cea3a6e5d2db70d5eef10f029bb1d6d030681573c851eb8076c8bad89c97c115f81a19ac8e46e78ca3f0e642565f7300c264ca1 SHA512 b462fcc1549f6e57f7f2a4fd10ce1e957a25a6a7c0319672b62699468f6c4330b9cd0cf2b0231b5cce94f4bb142a957eb8aa58aa0ffb5c85b37211d6b34ccf16
30 DIST xen-4.15.1-upstream-patches-0.tar.xz 3532 BLAKE2B 797f6c4ce44b43c9b43ee27718dc6d0b234588df2148961f8b078b3362b23bec6c2326eb0584255b0f3128c2f8b673ac6b9590596119c5fec82e7b03a1305b2c SHA512 c7d1a21042a3003eb9d968b3eb00aabbbc5c145b8b05fdd9e520cde34d1643d7f4f8f7039f30843a65439b1d40584c751e31ead620b88332d50b10f14fe81c0d
31 +DIST xen-4.15.1-upstream-patches-2.tar.xz 30180 BLAKE2B 675c13cfb4a6f47121dfe125ddea21d98e7e37563f63b91cde96cd92d94eff648eaa65426fec09833ad668102959948b2e684860631db2b5a2a53b2521a01069 SHA512 f0a6c0829068828ac400d67230d3066b2370a90303e537dd5e0761920ac0d584139b59244a72d9dcd2e4cb1a151ab80d3197ba908e642e13817b89b9a33c73fb
32 DIST xen-4.15.1.tar.gz 40800852 BLAKE2B 39475ea33f029fb0e84b82b4a2b13fd613bab01e3ef6c241dfede3d190ee9be53c99b62121d37d83b1e078764b3e4d88d1dfb99be1b5623691e56519850c6798 SHA512 8d3cbdf708f46477e32ee7cbd16a490c82efa855cecd84ee712b8680df4d69c987ba9ab00ff3851f627b98a8ebbc5dab71f92f142ed958ee2bc538bc792cd4b9
33
34 diff --git a/app-emulation/xen/xen-4.14.3-r2.ebuild b/app-emulation/xen/xen-4.14.3-r2.ebuild
35 new file mode 100644
36 index 000000000000..f38b50e88891
37 --- /dev/null
38 +++ b/app-emulation/xen/xen-4.14.3-r2.ebuild
39 @@ -0,0 +1,163 @@
40 +# Copyright 1999-2021 Gentoo Authors
41 +# Distributed under the terms of the GNU General Public License v2
42 +
43 +EAPI=7
44 +
45 +PYTHON_COMPAT=( python3_{8..9} )
46 +
47 +inherit flag-o-matic mount-boot multilib python-any-r1 toolchain-funcs
48 +
49 +MY_PV=${PV/_/-}
50 +MY_P=${PN}-${MY_PV}
51 +
52 +if [[ ${PV} == *9999 ]]; then
53 + inherit git-r3
54 + EGIT_REPO_URI="git://xenbits.xen.org/xen.git"
55 + SRC_URI=""
56 +else
57 + KEYWORDS="~amd64 ~arm -x86"
58 + UPSTREAM_VER=2
59 + SECURITY_VER=
60 + GENTOO_VER=
61 +
62 + [[ -n ${UPSTREAM_VER} ]] && \
63 + UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz
64 + https://github.com/hydrapolic/gentoo-dist/raw/master/xen/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
65 + [[ -n ${SECURITY_VER} ]] && \
66 + SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-security-patches-${SECURITY_VER}.tar.xz"
67 + [[ -n ${GENTOO_VER} ]] && \
68 + GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-gentoo-patches-${GENTOO_VER}.tar.xz"
69 + SRC_URI="https://downloads.xenproject.org/release/xen/${MY_PV}/${MY_P}.tar.gz
70 + ${UPSTREAM_PATCHSET_URI}
71 + ${SECURITY_PATCHSET_URI}
72 + ${GENTOO_PATCHSET_URI}"
73 +fi
74 +
75 +DESCRIPTION="The Xen virtual machine monitor"
76 +HOMEPAGE="https://www.xenproject.org"
77 +LICENSE="GPL-2"
78 +SLOT="0"
79 +IUSE="debug efi flask"
80 +
81 +DEPEND="${PYTHON_DEPS}
82 + efi? ( >=sys-devel/binutils-2.22[multitarget] )
83 + !efi? ( >=sys-devel/binutils-2.22 )
84 + flask? ( sys-apps/checkpolicy )"
85 +RDEPEND=""
86 +PDEPEND="~app-emulation/xen-tools-${PV}"
87 +
88 +# no tests are available for the hypervisor
89 +# prevent the silliness of /usr/lib/debug/usr/lib/debug files
90 +# prevent stripping of the debug info from the /usr/lib/debug/xen-syms
91 +RESTRICT="test splitdebug strip"
92 +
93 +# Approved by QA team in bug #144032
94 +QA_WX_LOAD="boot/xen-syms-${PV}"
95 +
96 +REQUIRED_USE="arm? ( debug )"
97 +
98 +S="${WORKDIR}/${MY_P}"
99 +
100 +pkg_setup() {
101 + python-any-r1_pkg_setup
102 + if [[ -z ${XEN_TARGET_ARCH} ]]; then
103 + if use amd64; then
104 + export XEN_TARGET_ARCH="x86_64"
105 + elif use arm; then
106 + export XEN_TARGET_ARCH="arm32"
107 + elif use arm64; then
108 + export XEN_TARGET_ARCH="arm64"
109 + else
110 + die "Unsupported architecture!"
111 + fi
112 + fi
113 +}
114 +
115 +src_prepare() {
116 + # Upstream's patchset
117 + [[ -n ${UPSTREAM_VER} ]] && eapply "${WORKDIR}"/patches-upstream
118 +
119 + # Security patchset
120 + if [[ -n ${SECURITY_VER} ]]; then
121 + einfo "Try to apply Xen Security patch set"
122 + # apply main xen patches
123 + # Two parallel systems, both work side by side
124 + # Over time they may concdense into one. This will suffice for now
125 + source "${WORKDIR}"/patches-security/${PV}.conf
126 +
127 + local i
128 + for i in ${XEN_SECURITY_MAIN}; do
129 + eapply "${WORKDIR}"/patches-security/xen/$i
130 + done
131 + fi
132 +
133 + # Gentoo's patchset
134 + [[ -n ${GENTOO_VER} ]] && eapply "${WORKDIR}"/patches-gentoo
135 +
136 + # Symlinks do not work on fat32 volumes
137 + eapply "${FILESDIR}"/${PN}-4.14-efi.patch
138 +
139 + # Enable XSM-FLASK
140 + use flask && eapply "${FILESDIR}"/${PN}-4.15-flask.patch
141 +
142 + # Workaround new gcc-11 options
143 + sed -e '/^CFLAGS/s/-Werror//g' -i xen/Makefile || die
144 +
145 + # Drop .config
146 + sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
147 +
148 + if use efi; then
149 + export EFI_VENDOR="gentoo"
150 + export EFI_MOUNTPOINT="/boot"
151 + fi
152 +
153 + default
154 +}
155 +
156 +src_configure() {
157 + use arm && myopt="${myopt} CONFIG_EARLY_PRINTK=sun7i"
158 + use debug && myopt="${myopt} debug=y"
159 +
160 + # remove flags
161 + unset CFLAGS
162 + unset LDFLAGS
163 + unset ASFLAGS
164 +
165 + tc-ld-disable-gold # Bug 700374
166 +}
167 +
168 +src_compile() {
169 + # Send raw LDFLAGS so that --as-needed works
170 + emake V=1 CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
171 +}
172 +
173 +src_install() {
174 + local myopt
175 + use debug && myopt="${myopt} debug=y"
176 +
177 + # The 'make install' doesn't 'mkdir -p' the subdirs
178 + if use efi; then
179 + mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
180 + fi
181 +
182 + emake LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" DESTDIR="${D}" -C xen ${myopt} install
183 +
184 + # make install likes to throw in some extra EFI bits if it built
185 + use efi || rm -rf "${D}/usr/$(get_libdir)/efi"
186 +}
187 +
188 +pkg_postinst() {
189 + elog "Official Xen Guide:"
190 + elog " https://wiki.gentoo.org/wiki/Xen"
191 +
192 + use efi && einfo "The efi executable is installed in /boot/efi/gentoo"
193 +
194 + ewarn
195 + ewarn "Xen 4.12+ changed the default scheduler to credit2 which can cause"
196 + ewarn "domU lockups on multi-cpu systems. The legacy credit scheduler seems"
197 + ewarn "to work fine."
198 + ewarn
199 + ewarn "Add sched=credit to xen command line options to use the legacy scheduler."
200 + ewarn
201 + ewarn "https://wiki.gentoo.org/wiki/Xen#Xen_domU_hanging_with_Xen_4.12.2B"
202 +}
203
204 diff --git a/app-emulation/xen/xen-4.15.1-r2.ebuild b/app-emulation/xen/xen-4.15.1-r2.ebuild
205 new file mode 100644
206 index 000000000000..e399512a5723
207 --- /dev/null
208 +++ b/app-emulation/xen/xen-4.15.1-r2.ebuild
209 @@ -0,0 +1,163 @@
210 +# Copyright 1999-2021 Gentoo Authors
211 +# Distributed under the terms of the GNU General Public License v2
212 +
213 +EAPI=7
214 +
215 +PYTHON_COMPAT=( python3_{8..9} )
216 +
217 +inherit flag-o-matic mount-boot multilib python-any-r1 toolchain-funcs
218 +
219 +MY_PV=${PV/_/-}
220 +MY_P=${PN}-${MY_PV}
221 +
222 +if [[ ${PV} == *9999 ]]; then
223 + inherit git-r3
224 + EGIT_REPO_URI="git://xenbits.xen.org/xen.git"
225 + SRC_URI=""
226 +else
227 + KEYWORDS="~amd64 ~arm -x86"
228 + UPSTREAM_VER=2
229 + SECURITY_VER=
230 + GENTOO_VER=
231 +
232 + [[ -n ${UPSTREAM_VER} ]] && \
233 + UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz
234 + https://github.com/hydrapolic/gentoo-dist/raw/master/xen/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
235 + [[ -n ${SECURITY_VER} ]] && \
236 + SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-security-patches-${SECURITY_VER}.tar.xz"
237 + [[ -n ${GENTOO_VER} ]] && \
238 + GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-gentoo-patches-${GENTOO_VER}.tar.xz"
239 + SRC_URI="https://downloads.xenproject.org/release/xen/${MY_PV}/${MY_P}.tar.gz
240 + ${UPSTREAM_PATCHSET_URI}
241 + ${SECURITY_PATCHSET_URI}
242 + ${GENTOO_PATCHSET_URI}"
243 +fi
244 +
245 +DESCRIPTION="The Xen virtual machine monitor"
246 +HOMEPAGE="https://www.xenproject.org"
247 +LICENSE="GPL-2"
248 +SLOT="0"
249 +IUSE="debug efi flask"
250 +
251 +DEPEND="${PYTHON_DEPS}
252 + efi? ( >=sys-devel/binutils-2.22[multitarget] )
253 + !efi? ( >=sys-devel/binutils-2.22 )
254 + flask? ( sys-apps/checkpolicy )"
255 +RDEPEND=""
256 +PDEPEND="~app-emulation/xen-tools-${PV}"
257 +
258 +# no tests are available for the hypervisor
259 +# prevent the silliness of /usr/lib/debug/usr/lib/debug files
260 +# prevent stripping of the debug info from the /usr/lib/debug/xen-syms
261 +RESTRICT="test splitdebug strip"
262 +
263 +# Approved by QA team in bug #144032
264 +QA_WX_LOAD="boot/xen-syms-${PV}"
265 +
266 +REQUIRED_USE="arm? ( debug )"
267 +
268 +S="${WORKDIR}/${MY_P}"
269 +
270 +pkg_setup() {
271 + python-any-r1_pkg_setup
272 + if [[ -z ${XEN_TARGET_ARCH} ]]; then
273 + if use amd64; then
274 + export XEN_TARGET_ARCH="x86_64"
275 + elif use arm; then
276 + export XEN_TARGET_ARCH="arm32"
277 + elif use arm64; then
278 + export XEN_TARGET_ARCH="arm64"
279 + else
280 + die "Unsupported architecture!"
281 + fi
282 + fi
283 +}
284 +
285 +src_prepare() {
286 + # Upstream's patchset
287 + [[ -n ${UPSTREAM_VER} ]] && eapply "${WORKDIR}"/patches-upstream
288 +
289 + # Security patchset
290 + if [[ -n ${SECURITY_VER} ]]; then
291 + einfo "Try to apply Xen Security patch set"
292 + # apply main xen patches
293 + # Two parallel systems, both work side by side
294 + # Over time they may concdense into one. This will suffice for now
295 + source "${WORKDIR}"/patches-security/${PV}.conf
296 +
297 + local i
298 + for i in ${XEN_SECURITY_MAIN}; do
299 + eapply "${WORKDIR}"/patches-security/xen/$i
300 + done
301 + fi
302 +
303 + # Gentoo's patchset
304 + [[ -n ${GENTOO_VER} ]] && eapply "${WORKDIR}"/patches-gentoo
305 +
306 + # Symlinks do not work on fat32 volumes
307 + eapply "${FILESDIR}"/${PN}-4.15-efi.patch
308 +
309 + # Enable XSM-FLASK
310 + use flask && eapply "${FILESDIR}"/${PN}-4.15-flask.patch
311 +
312 + # Workaround new gcc-11 options
313 + sed -e '/^CFLAGS/s/-Werror//g' -i xen/Makefile || die
314 +
315 + # Drop .config
316 + sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
317 +
318 + if use efi; then
319 + export EFI_VENDOR="gentoo"
320 + export EFI_MOUNTPOINT="/boot"
321 + fi
322 +
323 + default
324 +}
325 +
326 +src_configure() {
327 + use arm && myopt="${myopt} CONFIG_EARLY_PRINTK=sun7i"
328 + use debug && myopt="${myopt} debug=y"
329 +
330 + # remove flags
331 + unset CFLAGS
332 + unset LDFLAGS
333 + unset ASFLAGS
334 +
335 + tc-ld-disable-gold # Bug 700374
336 +}
337 +
338 +src_compile() {
339 + # Send raw LDFLAGS so that --as-needed works
340 + emake V=1 CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
341 +}
342 +
343 +src_install() {
344 + local myopt
345 + use debug && myopt="${myopt} debug=y"
346 +
347 + # The 'make install' doesn't 'mkdir -p' the subdirs
348 + if use efi; then
349 + mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
350 + fi
351 +
352 + emake LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" DESTDIR="${D}" -C xen ${myopt} install
353 +
354 + # make install likes to throw in some extra EFI bits if it built
355 + use efi || rm -rf "${D}/usr/$(get_libdir)/efi"
356 +}
357 +
358 +pkg_postinst() {
359 + elog "Official Xen Guide:"
360 + elog " https://wiki.gentoo.org/wiki/Xen"
361 +
362 + use efi && einfo "The efi executable is installed in /boot/efi/gentoo"
363 +
364 + ewarn
365 + ewarn "Xen 4.12+ changed the default scheduler to credit2 which can cause"
366 + ewarn "domU lockups on multi-cpu systems. The legacy credit scheduler seems"
367 + ewarn "to work fine."
368 + ewarn
369 + ewarn "Add sched=credit to xen command line options to use the legacy scheduler."
370 + ewarn
371 + ewarn "https://wiki.gentoo.org/wiki/Xen#Xen_domU_hanging_with_Xen_4.12.2B"
372 +}