Gentoo Archives: gentoo-commits

From: Yixun Lan <dlan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/xen/
Date: Fri, 03 Nov 2017 10:08:33
Message-Id: 1509703660.9f5090c0542f03940ace5c25954ddbed4aa6256f.dlan@gentoo
1 commit: 9f5090c0542f03940ace5c25954ddbed4aa6256f
2 Author: Yixun Lan <dlan <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 3 10:02:43 2017 +0000
4 Commit: Yixun Lan <dlan <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 3 10:07:40 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f5090c0
7
8 app-emulation/xen: security bump
9
10 fix XSA-236
11
12 Package-Manager: Portage-2.3.10, Repoman-2.3.3
13
14 app-emulation/xen/Manifest | 1 +
15 app-emulation/xen/xen-4.8.2-r2.ebuild | 184 ++++++++++++++++++++++++++++++++++
16 2 files changed, 185 insertions(+)
17
18 diff --git a/app-emulation/xen/Manifest b/app-emulation/xen/Manifest
19 index 0f0adafe265..63726379fae 100644
20 --- a/app-emulation/xen/Manifest
21 +++ b/app-emulation/xen/Manifest
22 @@ -3,5 +3,6 @@ DIST xen-4.7.2.tar.gz 20714281 SHA256 61494a56d9251e2108080f95b0dc8e3d175f1ba4da
23 DIST xen-4.7.3.tar.gz 20722625 SHA256 5b5385b476e59e4cf31ecc6dd605df38814b83432b8e8d917f18c8edfdfb708f SHA512 df596bef7f0f0e7f35246fb025913721dae5aa91da27f1b47a49256e9faa8f7dcb80e8c4679345c19614093c02059b6ced54fc51e6900a372b0e76b4ad827126 WHIRLPOOL 9e88db149e216651711cd56830fba33d587de60d57d53fd3ab3db231319f74e4e88222bf1b2bb9b20fea68739bccd4b26304c73a0ae25aad6dbbac64681e3a62
24 DIST xen-4.8.2-upstream-patches-0.tar.xz 7540 SHA256 d4bd4ce76097c49ebbad67a64814b9b41af0528b390ade15814cf0fb144e5e77 SHA512 34118ac114773cfc01a464de2a93b14905d3fb5edd62ae093f6cb40758f89c7fdc8449d0b7e9bfbaaee812b6f32b0c21860adeebb609376a22ce231e405b0837 WHIRLPOOL 0ff8c2fe3c349e6dc85e98644a813dd590c42bc78c6bbf98cdf77ed516e73fe5ca72a44935eae77f6ff9dcba8fef5d24c181d24b63b15bc470e7ed59098d5808
25 DIST xen-4.8.2-upstream-patches-1.tar.xz 29608 SHA256 7b1833eede01b7c8ae607614afd35c66ff009518cca972e2653d5828fb632aa6 SHA512 3ea002c37a0e2189f1846548a4aa607c42041cf093ec9a57509692dabe5c0b718151d183f5714443403d5cf8d4ab010a8f3893207bebf81cb85793282c30b457 WHIRLPOOL 0659a56e419918cb091ff0d87bf69a03464d2a0a0b4c6bad87521e83c40b48e210582d5fab2d9686b22b4ba839041be6e8aa39ab306a86ce18461d99c36be439
26 +DIST xen-4.8.2-upstream-patches-2.tar.xz 38852 SHA256 12c1f1fd2adba22b923d2ee944e6e66794701393966f9e9e2079961e202f6d64 SHA512 536823eabf03e92585a8c5cde90ce502672dd1ec080b28b39411d6a778b899436a57bfb633f11c94d48d2f963848b7771e469f5ea53e84b580976f631f69cc5d WHIRLPOOL 5baf92709da895eccbe8b154c1d1cdf4c2f0faf5166ef2e4bbf32ca6899d8b88aa67ccd765a15a2f9a6d5200d4a1eb832775891d41c00a950855e5d1d4358e35
27 DIST xen-4.8.2.tar.gz 22522336 SHA256 cb1cc2f0985e3d8651215e5d24c1fcc3036994fa7cc495a5091a2c85ece2aff9 SHA512 7805531f73d23ecfff3439770e62d387f4254a444875670d53a0a739323e5d4d8f8fcc478f8936ee1ae8aff3e0229549e47c01c606365a8ce060dd5c503e87da WHIRLPOOL 8e54e79219f89640162673da471a02ee8a39bb884e2376a79a09226462903185b49a771fef51ceca54c4dd42a110ee1214db6dbf94235a156a17d6c597634c3d
28 DIST xen-security-patches-26.tar.xz 8276 SHA256 2a21ec429f8952875f7d95f24697600e606326f1a16d5622cee73628cd0401c1 SHA512 f54fc7e720a70258263d29cc482b8269386818ad75792de87b0d0357fdb6af81f2102e5983100db47563435fa28f875a84e8c6d73d44797aadaf0c469d9fb0ec WHIRLPOOL b31667d8415dc1fbcd60160fdbc2fe0ad4de9bd2171fda875f5585b8d7821c4c035b029dbf382abacf4b6be745aeeb708f419fdcabdd86f78ff1c13703802e3f
29
30 diff --git a/app-emulation/xen/xen-4.8.2-r2.ebuild b/app-emulation/xen/xen-4.8.2-r2.ebuild
31 new file mode 100644
32 index 00000000000..9ddd4bb969c
33 --- /dev/null
34 +++ b/app-emulation/xen/xen-4.8.2-r2.ebuild
35 @@ -0,0 +1,184 @@
36 +# Copyright 1999-2017 Gentoo Foundation
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +
41 +PYTHON_COMPAT=( python2_7 )
42 +
43 +inherit eutils flag-o-matic mount-boot multilib python-any-r1 toolchain-funcs
44 +
45 +MY_PV=${PV/_/-}
46 +MY_P=${PN}-${MY_PV}
47 +
48 +if [[ $PV == *9999 ]]; then
49 + inherit git-r3
50 + KEYWORDS=""
51 + EGIT_REPO_URI="git://xenbits.xen.org/xen.git"
52 + SRC_URI=""
53 +else
54 + KEYWORDS="~amd64 ~arm -x86"
55 + UPSTREAM_VER=2
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 + [[ -n ${SECURITY_VER} ]] && \
62 + SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-security-patches-${SECURITY_VER}.tar.xz"
63 + [[ -n ${GENTOO_VER} ]] && \
64 + GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-gentoo-patches-${GENTOO_VER}.tar.xz"
65 + SRC_URI="https://downloads.xenproject.org/release/xen/${MY_PV}/${MY_P}.tar.gz
66 + ${UPSTREAM_PATCHSET_URI}
67 + ${SECURITY_PATCHSET_URI}
68 + ${GENTOO_PATCHSET_URI}"
69 +fi
70 +
71 +DESCRIPTION="The Xen virtual machine monitor"
72 +HOMEPAGE="http://xen.org/"
73 +HOMEPAGE="https://www.xenproject.org"
74 +LICENSE="GPL-2"
75 +SLOT="0"
76 +IUSE="custom-cflags 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 + if [[ -n ${UPSTREAM_VER} ]]; then
119 + EPATCH_SUFFIX="patch" \
120 + EPATCH_FORCE="yes" \
121 + EPATCH_OPTS="-p1" \
122 + epatch "${WORKDIR}"/patches-upstream
123 + fi
124 +
125 + # Security patchset
126 + if [[ -n ${SECURITY_VER} ]]; then
127 + einfo "Try to apply Xen Security patch set"
128 + # apply main xen patches
129 + # Two parallel systems, both work side by side
130 + # Over time they may concdense into one. This will suffice for now
131 + EPATCH_SUFFIX="patch"
132 + EPATCH_FORCE="yes"
133 +
134 + source "${WORKDIR}"/patches-security/${PV}.conf
135 +
136 + local i
137 + for i in ${XEN_SECURITY_MAIN}; do
138 + epatch "${WORKDIR}"/patches-security/xen/$i
139 + done
140 + fi
141 +
142 + # Gentoo's patchset
143 + if [[ -n ${GENTOO_VER} ]]; then
144 + EPATCH_SUFFIX="patch" \
145 + EPATCH_FORCE="yes" \
146 + epatch "${WORKDIR}"/patches-gentoo
147 + fi
148 +
149 + epatch "${FILESDIR}"/${PN}-4.6-efi.patch
150 +
151 + # Drop .config
152 + sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"
153 +
154 + if use efi; then
155 + export EFI_VENDOR="gentoo"
156 + export EFI_MOUNTPOINT="boot"
157 + fi
158 +
159 + # if the user *really* wants to use their own custom-cflags, let them
160 + if use custom-cflags; then
161 + einfo "User wants their own CFLAGS - removing defaults"
162 + # try and remove all the default custom-cflags
163 + find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
164 + -e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
165 + -e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
166 + -e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
167 + -e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
168 + -e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
169 + -i {} \; || die "failed to re-set custom-cflags"
170 + fi
171 +
172 + default
173 +}
174 +
175 +src_configure() {
176 + use arm && myopt="${myopt} CONFIG_EARLY_PRINTK=sun7i"
177 +
178 + use debug && myopt="${myopt} debug=y"
179 +
180 + if use custom-cflags; then
181 + filter-flags -fPIE -fstack-protector
182 + replace-flags -O3 -O2
183 + else
184 + unset CFLAGS
185 + unset LDFLAGS
186 + unset ASFLAGS
187 + fi
188 +}
189 +
190 +src_compile() {
191 + # Send raw LDFLAGS so that --as-needed works
192 + emake V=1 CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
193 +}
194 +
195 +src_install() {
196 + local myopt
197 + use debug && myopt="${myopt} debug=y"
198 +
199 + # The 'make install' doesn't 'mkdir -p' the subdirs
200 + if use efi; then
201 + mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
202 + fi
203 +
204 + emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
205 +
206 + # make install likes to throw in some extra EFI bits if it built
207 + use efi || rm -rf "${D}/usr/$(get_libdir)/efi"
208 +}
209 +
210 +pkg_postinst() {
211 + elog "Official Xen Guide:"
212 + elog " https://wiki.gentoo.org/wiki/Xen"
213 +
214 + use efi && einfo "The efi executable is installed in boot/efi/gentoo"
215 +
216 + elog "You can optionally block the installation of /boot/xen-syms by an entry"
217 + elog "in folder /etc/portage/env using the portage's feature INSTALL_MASK"
218 + elog "e.g. echo ${msg} > /etc/portage/env/xen.conf"
219 +}