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: Tue, 05 Jul 2022 16:23:13
Message-Id: 1657038056.ad56bccb7e7bfbd2bdb78203bd28d692034fb448.flow@gentoo
1 commit: ad56bccb7e7bfbd2bdb78203bd28d692034fb448
2 Author: Florian Schmaus <flow <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jul 4 10:30:07 2022 +0000
4 Commit: Florian Schmaus <flow <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 5 16:20:56 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad56bccb
7
8 app-emulation/xen: add 4.16.1, 4.16.2_pre1
9
10 This introduces a new approach to handle Xen patching and versioning. We
11 now consume the upstream patches from a repository called
12 xen-upstream-patches, which will ultimately be hosted by Gentoo
13 infra (e.g. available under gitweb.gentoo.org). The Gentoo patchset now
14 lives in a repository called xen-gentoo-patches, which will also be
15 hosted on Gentoo infra.
16
17 Furthermore we now follow upstreams versioning scheme. Previously we
18 would sell Xen 4.16.2-pre, which is from the staging-4.16 branch
19 containing security fixes, as Xen 4.16.1. To avoid confusion, we will
20 label the Xen versions as such, and Xen 4.16.1 will what is tagged
21 upstream as RELEASE-4.16.1 (+ the few Gentoo specific patches).
22
23 Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
24
25 app-emulation/xen/Manifest | 3 +
26 app-emulation/xen/xen-4.16.1.ebuild | 185 +++++++++++++++++++++++++++++++
27 app-emulation/xen/xen-4.16.2_pre1.ebuild | 185 +++++++++++++++++++++++++++++++
28 3 files changed, 373 insertions(+)
29
30 diff --git a/app-emulation/xen/Manifest b/app-emulation/xen/Manifest
31 index 76e074719419..0c9876da5844 100644
32 --- a/app-emulation/xen/Manifest
33 +++ b/app-emulation/xen/Manifest
34 @@ -2,3 +2,6 @@ DIST xen-4.15.2-upstream-patches-2.tar.xz 93208 BLAKE2B 5b01953ba93551830e533cf7
35 DIST xen-4.15.2.tar.gz 40773378 BLAKE2B 7c3e3bb066505f9838cd7c56d85debc64e5ed32cf4d4edf699ff843db49bee916e6eb46d07e5cd9021c2644bba0628a2aa567f60ace26c6d7ee5922643e04104 SHA512 1cbf988fa8ed38b7ad724978958092ca0e5506e38c709c7d1af196fb8cb8ec0197a79867782761ef230b268624b3d7a0d5d0cd186f37d25f495085c71bf70d54
36 DIST xen-4.16.0-upstream-patches-2.tar.xz 111668 BLAKE2B e8bbedb7cc50f7a6cb1a3869f0165cce3d02c33f04b935384e770aa5206e6aa6cb51329c5d69375391a8781ba23f20c35e06406d5164720d253b405a77f5aee9 SHA512 6b6770117e81ae407e3ded0e366b14f3fa2411cc93a95187db27548c3dd17a1f85e60fc3971b008693297ad97aa0c5fa7b4d88e01d67a972f39e51bf0a2cf39d
37 DIST xen-4.16.0.tar.gz 44982322 BLAKE2B 7e16a93b3f1131e2b10307fabc10641a9c5983173155b9a35eaf6ff317b6a747bccf6b8c87c06686830acc2c4bd3e19e5867eb443eabac9a1e4ee59124dfa87f SHA512 2869ed90d1779c9754d7f2397f5fc67a655304d9c32953ac20655ef96cb154521d8fce9f23915ac0c91f984dc54f72c67e5e619e2da318b5997748f44cf21b87
38 +DIST xen-4.16.1.tar.gz 44964667 BLAKE2B 190d9c330b5dcdd47bae26b6ef42111c9c63b71b8b92e20eae268054c6b40aaabadef78c0c9634cb3c3b1bde32a746cbb1404b5eed2a82ab829ba10632103856 SHA512 eeabba9c263cd2425bca083e32b5ebfc6c716c00553759c144fd4b6f64a89836b260787fa25ba22c1f5c4ea65aaad7c95b8c2c1070d3377b1c43c9517aa7032a
39 +DIST xen-gentoo-patches-4.16.1-gentoo-patchset-0.tar.gz 5289 BLAKE2B 4946056ee631ec0fa4d29f1cd643f66b491ef3ea049755d10d7b8e189f02816b990e53bffbeeeae0a61fb4e20aa877f5903a8aadfb26d0c78566a0e9fde540c7 SHA512 59d4101879bd18e828349db3814a9082b85c5ba8203ce98e5082491a9ede9c832a02ac7e4d7a0a51a52e38b72e5cce1eea6a09d6c5202e96bfe2aa4d47e12e65
40 +DIST xen-upstream-patches-4.16.2-pre-patchset-0.tar.gz 46026 BLAKE2B 57bca21962c9a451316f486f5db94e9c1b98b5e029a15dbd702007d573fe02571e648866c9ddbc293e53ceb5de92122b13d21e28c8879d918129134725c9ff91 SHA512 f665640fc686dfc5f718531601f66e3f30c4c8c7cb78293b6a615fe9f53a3763f2c864642a19336bb077d432b776ab1c9fa39e6fa5857ca3360e4d1b1ce63f50
41
42 diff --git a/app-emulation/xen/xen-4.16.1.ebuild b/app-emulation/xen/xen-4.16.1.ebuild
43 new file mode 100644
44 index 000000000000..e4073b7cad14
45 --- /dev/null
46 +++ b/app-emulation/xen/xen-4.16.1.ebuild
47 @@ -0,0 +1,185 @@
48 +# Copyright 1999-2022 Gentoo Authors
49 +# Distributed under the terms of the GNU General Public License v2
50 +
51 +EAPI=8
52 +
53 +PYTHON_COMPAT=( python3_{8..10} )
54 +
55 +inherit flag-o-matic mount-boot python-any-r1 toolchain-funcs
56 +
57 +if [[ ${PV} == *9999 ]]; then
58 + inherit git-r3
59 + EGIT_REPO_URI="git://xenbits.xen.org/xen.git"
60 + SRC_URI=""
61 +else
62 + KEYWORDS="~amd64 ~arm -x86"
63 +
64 + XEN_PRE_PATCHSET_NUM=
65 + XEN_GENTOO_PATCHSET_NUM=0
66 + XEN_PRE_VERSION_BASE=
67 +
68 + XEN_BASE_PV="${PV}"
69 + if [[ -n "${XEN_PRE_VERSION_BASE}" ]]; then
70 + XEN_BASE_PV="${XEN_PRE_VERSION_BASE}"
71 + fi
72 +
73 + SRC_URI="https://downloads.xenproject.org/release/xen/${XEN_BASE_PV}/xen-${XEN_BASE_PV}.tar.gz"
74 +
75 + if [[ -n "${XEN_PRE_PATCHSET_NUM}" ]]; then
76 + XEN_UPSTREAM_PATCHES_TAG="$(ver_cut 1-3)-pre-patchset-${XEN_PRE_PATCHSET_NUM}"
77 + XEN_UPSTREAM_PATCHES_NAME="xen-upstream-patches-${XEN_UPSTREAM_PATCHES_TAG}"
78 + SRC_URI+=" https://github.com/Flowdalic/xen-upstream-patches/archive/refs/tags/${XEN_UPSTREAM_PATCHES_TAG}.tar.gz -> ${XEN_UPSTREAM_PATCHES_NAME}.tar.gz"
79 + XEN_UPSTREAM_PATCHES_DIR="${WORKDIR}/${XEN_UPSTREAM_PATCHES_NAME}"
80 + fi
81 + if [[ -n "${XEN_GENTOO_PATCHSET_NUM}" ]]; then
82 + XEN_GENTOO_PATCHES_TAG="$(ver_cut 1-3 ${XEN_BASE_PV})-gentoo-patchset-${XEN_GENTOO_PATCHSET_NUM}"
83 + XEN_GENTOO_PATCHES_NAME="xen-gentoo-patches-${XEN_GENTOO_PATCHES_TAG}"
84 + SRC_URI+=" https://github.com/Flowdalic/xen-gentoo-patches/archive/refs/tags/${XEN_GENTOO_PATCHES_TAG}.tar.gz -> ${XEN_GENTOO_PATCHES_NAME}.tar.gz"
85 + XEN_GENTOO_PATCHES_DIR="${WORKDIR}/${XEN_GENTOO_PATCHES_NAME}"
86 + fi
87 +fi
88 +
89 +DESCRIPTION="The Xen virtual machine monitor"
90 +HOMEPAGE="https://xenproject.org"
91 +
92 +S="${WORKDIR}/xen-$(ver_cut 1-3 ${XEN_BASE_PV})"
93 +
94 +LICENSE="GPL-2"
95 +SLOT="0"
96 +IUSE="+boot-symlinks debug efi flask"
97 +REQUIRED_USE="arm? ( debug )"
98 +
99 +DEPEND="${PYTHON_DEPS}
100 + efi? ( >=sys-devel/binutils-2.22[multitarget] )
101 + !efi? ( >=sys-devel/binutils-2.22 )
102 + flask? ( sys-apps/checkpolicy )"
103 +RDEPEND=""
104 +PDEPEND="~app-emulation/xen-tools-${PV}"
105 +
106 +# no tests are available for the hypervisor
107 +# prevent the silliness of /usr/lib/debug/usr/lib/debug files
108 +# prevent stripping of the debug info from the /usr/lib/debug/xen-syms
109 +RESTRICT="test splitdebug strip"
110 +
111 +# Approved by QA team in bug #144032
112 +QA_WX_LOAD="boot/xen-syms-${PV}"
113 +
114 +pkg_setup() {
115 + python-any-r1_pkg_setup
116 + if [[ -z ${XEN_TARGET_ARCH} ]]; then
117 + if use amd64; then
118 + export XEN_TARGET_ARCH="x86_64"
119 + elif use arm; then
120 + export XEN_TARGET_ARCH="arm32"
121 + elif use arm64; then
122 + export XEN_TARGET_ARCH="arm64"
123 + else
124 + die "Unsupported architecture!"
125 + fi
126 + fi
127 +}
128 +
129 +src_prepare() {
130 + if [[ -v XEN_UPSTREAM_PATCHES_DIR ]]; then
131 + eapply "${XEN_UPSTREAM_PATCHES_DIR}"
132 + fi
133 +
134 + if [[ -v XEN_GENTOO_PATCHES_DIR ]]; then
135 + eapply "${XEN_GENTOO_PATCHES_DIR}"
136 + fi
137 +
138 + eapply "${FILESDIR}"/${PN}-4.16-efi.patch
139 +
140 + # Symlinks do not work on fat32 volumes # 829765
141 + if ! use boot-symlinks || use efi; then
142 + eapply "${FILESDIR}"/${PN}-4.16-no-symlink.patch
143 + fi
144 +
145 + # Workaround new gcc-11 options
146 + sed -e '/^CFLAGS/s/-Werror//g' -i xen/Makefile || die
147 +
148 + # Drop .config
149 + sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
150 +
151 + if use efi; then
152 + export EFI_VENDOR="gentoo"
153 + export EFI_MOUNTPOINT="/boot"
154 + fi
155 +
156 + default
157 +}
158 +
159 +xen_make() {
160 + # Setting clang to either 'y' or 'n' tells Xen's build system
161 + # whether or not clang is used.
162 + local clang=n
163 + if tc-is-clang; then
164 + clang=y
165 + fi
166 +
167 + # Send raw LDFLAGS so that --as-needed works
168 + emake \
169 + V=1 \
170 + LDFLAGS="$(raw-ldflags)" \
171 + HOSTCC="$(tc-getBUILD_CC)" \
172 + HOSTCXX="$(tc-getBUILD_CXX)" \
173 + clang="${clang}" \
174 + "$@"
175 +}
176 +
177 +src_configure() {
178 + cd xen || die
179 +
180 + touch gentoo-config || die
181 + if use arm; then
182 + echo "CONFIG_EARLY_PRINTK=sun7i" >> gentoo-config || die
183 + fi
184 + if use debug; then
185 + cat <<-EOF >> gentoo-config || die
186 + CONFIG_DEBUG=y
187 + CONFIG_CRASH_DEBUG=y
188 +EOF
189 + fi
190 + if use flask; then
191 + echo "CONFIG_XSM=y" >> gentoo-config || die
192 + fi
193 +
194 + # remove flags
195 + unset CFLAGS
196 +
197 + tc-ld-disable-gold # Bug 700374
198 +
199 + xen_make KCONFIG_ALLCONFIG=gentoo-config alldefconfig
200 +}
201 +
202 +src_compile() {
203 + xen_make -C xen
204 +}
205 +
206 +src_install() {
207 + # The 'make install' doesn't 'mkdir -p' the subdirs
208 + if use efi; then
209 + mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
210 + fi
211 +
212 + xen_make DESTDIR="${D}" -C xen install
213 +
214 + # make install likes to throw in some extra EFI bits if it built
215 + use efi || rm -rf "${D}/usr/$(get_libdir)/efi"
216 +}
217 +
218 +pkg_postinst() {
219 + elog "Official Xen Guide:"
220 + elog " https://wiki.gentoo.org/wiki/Xen"
221 +
222 + use efi && einfo "The efi executable is installed in /boot/efi/gentoo"
223 +
224 + ewarn
225 + ewarn "Xen 4.12+ changed the default scheduler to credit2 which can cause"
226 + ewarn "domU lockups on multi-cpu systems. The legacy credit scheduler seems"
227 + ewarn "to work fine."
228 + ewarn
229 + ewarn "Add sched=credit to xen command line options to use the legacy scheduler."
230 + ewarn
231 + ewarn "https://wiki.gentoo.org/wiki/Xen#Xen_domU_hanging_with_Xen_4.12.2B"
232 +}
233
234 diff --git a/app-emulation/xen/xen-4.16.2_pre1.ebuild b/app-emulation/xen/xen-4.16.2_pre1.ebuild
235 new file mode 100644
236 index 000000000000..2e8dbf6d958b
237 --- /dev/null
238 +++ b/app-emulation/xen/xen-4.16.2_pre1.ebuild
239 @@ -0,0 +1,185 @@
240 +# Copyright 1999-2022 Gentoo Authors
241 +# Distributed under the terms of the GNU General Public License v2
242 +
243 +EAPI=8
244 +
245 +PYTHON_COMPAT=( python3_{8..10} )
246 +
247 +inherit flag-o-matic mount-boot python-any-r1 toolchain-funcs
248 +
249 +if [[ ${PV} == *9999 ]]; then
250 + inherit git-r3
251 + EGIT_REPO_URI="git://xenbits.xen.org/xen.git"
252 + SRC_URI=""
253 +else
254 + KEYWORDS="~amd64 ~arm -x86"
255 +
256 + XEN_PRE_PATCHSET_NUM=0
257 + XEN_GENTOO_PATCHSET_NUM=0
258 + XEN_PRE_VERSION_BASE=4.16.1
259 +
260 + XEN_BASE_PV="${PV}"
261 + if [[ -n "${XEN_PRE_VERSION_BASE}" ]]; then
262 + XEN_BASE_PV="${XEN_PRE_VERSION_BASE}"
263 + fi
264 +
265 + SRC_URI="https://downloads.xenproject.org/release/xen/${XEN_BASE_PV}/xen-${XEN_BASE_PV}.tar.gz"
266 +
267 + if [[ -n "${XEN_PRE_PATCHSET_NUM}" ]]; then
268 + XEN_UPSTREAM_PATCHES_TAG="$(ver_cut 1-3)-pre-patchset-${XEN_PRE_PATCHSET_NUM}"
269 + XEN_UPSTREAM_PATCHES_NAME="xen-upstream-patches-${XEN_UPSTREAM_PATCHES_TAG}"
270 + SRC_URI+=" https://github.com/Flowdalic/xen-upstream-patches/archive/refs/tags/${XEN_UPSTREAM_PATCHES_TAG}.tar.gz -> ${XEN_UPSTREAM_PATCHES_NAME}.tar.gz"
271 + XEN_UPSTREAM_PATCHES_DIR="${WORKDIR}/${XEN_UPSTREAM_PATCHES_NAME}"
272 + fi
273 + if [[ -n "${XEN_GENTOO_PATCHSET_NUM}" ]]; then
274 + XEN_GENTOO_PATCHES_TAG="$(ver_cut 1-3 ${XEN_BASE_PV})-gentoo-patchset-${XEN_GENTOO_PATCHSET_NUM}"
275 + XEN_GENTOO_PATCHES_NAME="xen-gentoo-patches-${XEN_GENTOO_PATCHES_TAG}"
276 + SRC_URI+=" https://github.com/Flowdalic/xen-gentoo-patches/archive/refs/tags/${XEN_GENTOO_PATCHES_TAG}.tar.gz -> ${XEN_GENTOO_PATCHES_NAME}.tar.gz"
277 + XEN_GENTOO_PATCHES_DIR="${WORKDIR}/${XEN_GENTOO_PATCHES_NAME}"
278 + fi
279 +fi
280 +
281 +DESCRIPTION="The Xen virtual machine monitor"
282 +HOMEPAGE="https://xenproject.org"
283 +
284 +S="${WORKDIR}/xen-$(ver_cut 1-3 ${XEN_BASE_PV})"
285 +
286 +LICENSE="GPL-2"
287 +SLOT="0"
288 +IUSE="+boot-symlinks debug efi flask"
289 +REQUIRED_USE="arm? ( debug )"
290 +
291 +DEPEND="${PYTHON_DEPS}
292 + efi? ( >=sys-devel/binutils-2.22[multitarget] )
293 + !efi? ( >=sys-devel/binutils-2.22 )
294 + flask? ( sys-apps/checkpolicy )"
295 +RDEPEND=""
296 +PDEPEND="~app-emulation/xen-tools-${PV}"
297 +
298 +# no tests are available for the hypervisor
299 +# prevent the silliness of /usr/lib/debug/usr/lib/debug files
300 +# prevent stripping of the debug info from the /usr/lib/debug/xen-syms
301 +RESTRICT="test splitdebug strip"
302 +
303 +# Approved by QA team in bug #144032
304 +QA_WX_LOAD="boot/xen-syms-${PV}"
305 +
306 +pkg_setup() {
307 + python-any-r1_pkg_setup
308 + if [[ -z ${XEN_TARGET_ARCH} ]]; then
309 + if use amd64; then
310 + export XEN_TARGET_ARCH="x86_64"
311 + elif use arm; then
312 + export XEN_TARGET_ARCH="arm32"
313 + elif use arm64; then
314 + export XEN_TARGET_ARCH="arm64"
315 + else
316 + die "Unsupported architecture!"
317 + fi
318 + fi
319 +}
320 +
321 +src_prepare() {
322 + if [[ -v XEN_UPSTREAM_PATCHES_DIR ]]; then
323 + eapply "${XEN_UPSTREAM_PATCHES_DIR}"
324 + fi
325 +
326 + if [[ -v XEN_GENTOO_PATCHES_DIR ]]; then
327 + eapply "${XEN_GENTOO_PATCHES_DIR}"
328 + fi
329 +
330 + eapply "${FILESDIR}"/${PN}-4.16-efi.patch
331 +
332 + # Symlinks do not work on fat32 volumes # 829765
333 + if ! use boot-symlinks || use efi; then
334 + eapply "${FILESDIR}"/${PN}-4.16-no-symlink.patch
335 + fi
336 +
337 + # Workaround new gcc-11 options
338 + sed -e '/^CFLAGS/s/-Werror//g' -i xen/Makefile || die
339 +
340 + # Drop .config
341 + sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
342 +
343 + if use efi; then
344 + export EFI_VENDOR="gentoo"
345 + export EFI_MOUNTPOINT="/boot"
346 + fi
347 +
348 + default
349 +}
350 +
351 +xen_make() {
352 + # Setting clang to either 'y' or 'n' tells Xen's build system
353 + # whether or not clang is used.
354 + local clang=n
355 + if tc-is-clang; then
356 + clang=y
357 + fi
358 +
359 + # Send raw LDFLAGS so that --as-needed works
360 + emake \
361 + V=1 \
362 + LDFLAGS="$(raw-ldflags)" \
363 + HOSTCC="$(tc-getBUILD_CC)" \
364 + HOSTCXX="$(tc-getBUILD_CXX)" \
365 + clang="${clang}" \
366 + "$@"
367 +}
368 +
369 +src_configure() {
370 + cd xen || die
371 +
372 + touch gentoo-config || die
373 + if use arm; then
374 + echo "CONFIG_EARLY_PRINTK=sun7i" >> gentoo-config || die
375 + fi
376 + if use debug; then
377 + cat <<-EOF >> gentoo-config || die
378 + CONFIG_DEBUG=y
379 + CONFIG_CRASH_DEBUG=y
380 +EOF
381 + fi
382 + if use flask; then
383 + echo "CONFIG_XSM=y" >> gentoo-config || die
384 + fi
385 +
386 + # remove flags
387 + unset CFLAGS
388 +
389 + tc-ld-disable-gold # Bug 700374
390 +
391 + xen_make KCONFIG_ALLCONFIG=gentoo-config alldefconfig
392 +}
393 +
394 +src_compile() {
395 + xen_make -C xen
396 +}
397 +
398 +src_install() {
399 + # The 'make install' doesn't 'mkdir -p' the subdirs
400 + if use efi; then
401 + mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
402 + fi
403 +
404 + xen_make DESTDIR="${D}" -C xen install
405 +
406 + # make install likes to throw in some extra EFI bits if it built
407 + use efi || rm -rf "${D}/usr/$(get_libdir)/efi"
408 +}
409 +
410 +pkg_postinst() {
411 + elog "Official Xen Guide:"
412 + elog " https://wiki.gentoo.org/wiki/Xen"
413 +
414 + use efi && einfo "The efi executable is installed in /boot/efi/gentoo"
415 +
416 + ewarn
417 + ewarn "Xen 4.12+ changed the default scheduler to credit2 which can cause"
418 + ewarn "domU lockups on multi-cpu systems. The legacy credit scheduler seems"
419 + ewarn "to work fine."
420 + ewarn
421 + ewarn "Add sched=credit to xen command line options to use the legacy scheduler."
422 + ewarn
423 + ewarn "https://wiki.gentoo.org/wiki/Xen#Xen_domU_hanging_with_Xen_4.12.2B"
424 +}