Gentoo Archives: gentoo-commits

From: Ian Delaney <idella4@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/xen/
Date: Sun, 03 Jan 2016 00:20:26
Message-Id: 1451780408.90cee9f2f3a8d12c68523e814f4fd4ab79311683.idella4@gentoo
1 commit: 90cee9f2f3a8d12c68523e814f4fd4ab79311683
2 Author: Ian Delaney <idella4 <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 3 00:19:36 2016 +0000
4 Commit: Ian Delaney <idella4 <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 3 00:20:08 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90cee9f2
7
8 app-emulation/xen: revbump to vn. 4.6.0-r5
9
10 wrt security patch in the gentoo bug
11
12 Gentoo bug: #569554
13
14 Package-Manager: portage-2.2.26
15
16 app-emulation/xen/Manifest | 1 +
17 app-emulation/xen/xen-4.6.0-r5.ebuild | 190 ++++++++++++++++++++++++++++++++++
18 2 files changed, 191 insertions(+)
19
20 diff --git a/app-emulation/xen/Manifest b/app-emulation/xen/Manifest
21 index 46d8b48..df9efb1 100644
22 --- a/app-emulation/xen/Manifest
23 +++ b/app-emulation/xen/Manifest
24 @@ -9,4 +9,5 @@ DIST xen-security-patches-1.tar.gz 7040 SHA256 30733e9ca71bf4291ff212eb191afb226
25 DIST xen-security-patches-2.tar.gz 7370 SHA256 f24bf4b0cba29b51ee71f6ef82654cddf157c63d62fc1119f17255b2388e03ab SHA512 209dea670467ff1df18428c15b25229c05d676d1a2f646cddb221544ae888241ade48a22be037f97dce249ac322c1f30bb477675e5e2cc04a2fbd839e02f1f57 WHIRLPOOL ae66a2fbc0d0f0a555d407ebd3198fa58ee043515fb9821d7b9eda46d088bc87b3de16fe015fd1142294429dd2c1c7826e414a55980e27123185c1a86fb0a8a6
26 DIST xen-security-patches-3.tar.gz 7349 SHA256 a1876b918c0a608618f349deed11b547a65c5909c31d72a89340d4908c572f46 SHA512 f5e8e7ab5d9be6aa036e52627931f1b2648de642664b2922f9cab64f44d19ac8682f5beb7fdbcb842ee19346202093fade3f10e39ba60fcb12a101deb4408818 WHIRLPOOL 14ee65babe4edd901914c8b8ddb5d7b54e6738d77642514fe611bf84541ae0a932bcb48f86179d5e7a6741135b9c7b129e8244cc22922c4e592604a696b6082f
27 DIST xen-security-patches-3.tar.xz 17028 SHA256 fb6301beb9a5c2d1e5d4de8783d8670e382b1bef48ec61e73d2d9be6901d289f SHA512 787fee8f7822577c6de91c4cf4d56d0e73ce46bac5524537ff66a718b6d7eae9d362265515743e8577b2c75f2841baed9837f71467b3b7b91a3111220da5f236 WHIRLPOOL 5c136289e654776bf918fe125fbecba7dac0929b236f7ae8158026a6bd6be12bc786a5ec96cb4022c18a5e7ffde82155deb57eb9639600e4c42c9c209f4a2ed6
28 +DIST xen-security-patches-4.tar.gz 7731 SHA256 b51c6616a303b4d5123fed1e58240163c8e0cf8e0de32db58c11a40a48124d52 SHA512 cef89bb68bdb4a5f947d6be8ae7a799276fd187e396c5ba85f8aa2b0b5349ba606d3742d5b8d8212df6da38f8af9711416d9a25176e713240a0a7f2194d84fc5 WHIRLPOOL 912dc869fa4eb355a86023133adcb818e87f4979d537a885b3f1c6e35ff141b7d7a33e81105dcddf34aafa4c306df79a210346f5037337173923e1dc8280ac47
29 DIST xen-security-patches-7.tar.xz 22604 SHA256 e831c71f830316f452eb8645a5e7ca497264587aa8b353945fd9535f485166e3 SHA512 051769f4118f5c6d5d961759f547526d3fb0e86a4c1dee265a7f0224f10a88e2217b5b5fcf8dbfc706a1ec3c8d1632ab688d3f70dfd89d830261dc7391dd41c2 WHIRLPOOL 8e6dfb4e1700a07e3e3207b67afaddc5d6aa6fd84db9b3e76bd9ff54f682740fed01070e5860bb5378d50903d5777b55dff88eb3444d45bdd63dba657889393d
30
31 diff --git a/app-emulation/xen/xen-4.6.0-r5.ebuild b/app-emulation/xen/xen-4.6.0-r5.ebuild
32 new file mode 100644
33 index 0000000..f3e0d76
34 --- /dev/null
35 +++ b/app-emulation/xen/xen-4.6.0-r5.ebuild
36 @@ -0,0 +1,190 @@
37 +# Copyright 1999-2015 Gentoo Foundation
38 +# Distributed under the terms of the GNU General Public License v2
39 +# $Id$
40 +
41 +EAPI=5
42 +
43 +PYTHON_COMPAT=( python2_7 )
44 +
45 +inherit eutils multilib mount-boot flag-o-matic python-any-r1 toolchain-funcs
46 +
47 +MY_PV=${PV/_/-}
48 +MY_P=${PN}-${PV/_/-}
49 +
50 +if [[ $PV == *9999 ]]; then
51 + inherit git-r3
52 + KEYWORDS=""
53 + EGIT_REPO_URI="git://xenbits.xen.org/xen.git"
54 + SRC_URI=""
55 +else
56 + KEYWORDS="~amd64 ~arm ~arm64 -x86"
57 + UPSTREAM_VER=0
58 + SECURITY_VER=0
59 + # var set to reflect https://dev.gentoo.org/~idella4/
60 + SEC_VER=4
61 + GENTOO_VER=
62 +
63 + [[ -n ${UPSTREAM_VER} ]] && \
64 + UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
65 + [[ -n ${SECURITY_VER} ]] && \
66 + SECURITY_PATCHSET_URI="https://dev.gentoo.org/~idella4/distfiles/${PN/-tools}-security-patches-${SECURITY_VER}.tar.xz
67 + https://dev.gentoo.org/~idella4/distfiles/${PN/-tools}-security-patches-${SEC_VER}.tar.gz"
68 + [[ -n ${GENTOO_VER} ]] && \
69 + GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-gentoo-patches-${GENTOO_VER}.tar.xz"
70 + SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV}/${MY_P}.tar.gz
71 + ${UPSTREAM_PATCHSET_URI}
72 + ${SECURITY_PATCHSET_URI}
73 + ${GENTOO_PATCHSET_URI}"
74 +fi
75 +
76 +DESCRIPTION="The Xen virtual machine monitor"
77 +HOMEPAGE="http://xen.org/"
78 +LICENSE="GPL-2"
79 +SLOT="0"
80 +IUSE="custom-cflags debug efi flask"
81 +
82 +DEPEND="${PYTHON_DEPS}
83 + efi? ( >=sys-devel/binutils-2.22[multitarget] )
84 + !efi? ( >=sys-devel/binutils-2.22 )"
85 +RDEPEND=""
86 +PDEPEND="~app-emulation/xen-tools-${PV}"
87 +
88 +RESTRICT="test"
89 +
90 +# Approved by QA team in bug #144032
91 +QA_WX_LOAD="boot/xen-syms-${PV}"
92 +
93 +REQUIRED_USE="arm? ( debug )"
94 +
95 +S="${WORKDIR}/${MY_P}"
96 +
97 +pkg_setup() {
98 + python-any-r1_pkg_setup
99 + if [[ -z ${XEN_TARGET_ARCH} ]]; then
100 + if use amd64; then
101 + export XEN_TARGET_ARCH="x86_64"
102 + elif use arm; then
103 + export XEN_TARGET_ARCH="arm32"
104 + elif use arm64; then
105 + export XEN_TARGET_ARCH="arm64"
106 + else
107 + die "Unsupported architecture!"
108 + fi
109 + fi
110 +
111 + if use flask ; then
112 + export "XSM_ENABLE=y"
113 + export "FLASK_ENABLE=y"
114 + fi
115 +}
116 +
117 +src_prepare() {
118 + # Upstream's patchset
119 + if [[ -n ${UPSTREAM_VER} ]]; then
120 + EPATCH_SUFFIX="patch" \
121 + EPATCH_FORCE="yes" \
122 + EPATCH_OPTS="-p1" \
123 + epatch "${WORKDIR}"/patches-upstream
124 + fi
125 +
126 + if [[ -n ${SECURITY_VER} ]]; then
127 + einfo "Try to apply Xen Security patcheset"
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 + for i in ${XEN_SECURITY_MAIN}; do
134 + epatch "${WORKDIR}"/patches-security/xen/$i
135 + done
136 +
137 + for i in "${WORKDIR}"/xen-sec/xsa*.patch; do
138 + epatch $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 + # remove -Werror for gcc-4.6's sake
173 + find "${S}" -name 'Makefile*' -o -name '*.mk' -o -name 'common.make' | \
174 + xargs sed -i 's/ *-Werror */ /'
175 + # not strictly necessary to fix this
176 + sed -i 's/, "-Werror"//' "${S}/tools/python/setup.py" || die "failed to re-set setup.py"
177 +
178 + epatch_user
179 +}
180 +
181 +src_configure() {
182 + use arm && myopt="${myopt} CONFIG_EARLY_PRINTK=sun7i"
183 +
184 + use debug && myopt="${myopt} debug=y"
185 +
186 + if use custom-cflags; then
187 + filter-flags -fPIE -fstack-protector
188 + replace-flags -O3 -O2
189 + else
190 + unset CFLAGS
191 + unset LDFLAGS
192 + unset ASFLAGS
193 + fi
194 +}
195 +
196 +src_compile() {
197 + # Send raw LDFLAGS so that --as-needed works
198 + emake V=1 CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
199 +}
200 +
201 +src_install() {
202 + local myopt
203 + use debug && myopt="${myopt} debug=y"
204 +
205 + # The 'make install' doesn't 'mkdir -p' the subdirs
206 + if use efi; then
207 + mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
208 + fi
209 +
210 + emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install
211 +
212 + # make install likes to throw in some extra EFI bits if it built
213 + use efi || rm -rf "${D}/usr/$(get_libdir)/efi"
214 +}
215 +
216 +pkg_postinst() {
217 + elog "Official Xen Guide and the unoffical wiki page:"
218 + elog " https://wiki.gentoo.org/wiki/Xen"
219 + elog " http://en.gentoo-wiki.com/wiki/Xen/"
220 +
221 + use efi && einfo "The efi executable is installed in boot/efi/gentoo"
222 +
223 + elog "You can optionally block the installation of /boot/xen-syms by an entry"
224 + elog "in folder /etc/portage/env using the portage's feature INSTALL_MASK"
225 + elog "e.g. echo ${msg} > /etc/portage/env/xen.conf"
226 +}