Gentoo Archives: gentoo-commits

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