Skip to content

Commit

Permalink
app-emulation/xen: version bump, 4.8.2
Browse files Browse the repository at this point in the history
this bump also fix security issue
XSA-231,232,233,234

Package-Manager: Portage-2.3.10, Repoman-2.3.3
  • Loading branch information
dlan17 committed Sep 30, 2017
1 parent 47829b7 commit bc9bced
Show file tree
Hide file tree
Showing 2 changed files with 194 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app-emulation/xen/Manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ DIST xen-4.7.3.tar.gz 20722625 SHA256 5b5385b476e59e4cf31ecc6dd605df38814b83432b
DIST xen-4.8.1-upstream-patches-0.tar.xz 57132 SHA256 6a6d466e74b28e50cc8ffcf56f6e3853dff73a5d936374404a2aab9dadb54566 SHA512 bcf43f7f9c15016576f225146a34e26122a6e35d953ca8df05d6d3b6b2465bd8e237e824d3d84dfd892f440b40d6e6b3bb7c16c3c79b8e04534b2bed60877f53 WHIRLPOOL 4470d244bed58f9b71a031da19cfe38a79badf426300637211c3e8dfdab02f2b87ed21d9a5340af267685aafd627451f8750b85d9afc73ed2a550c52b43c31ab
DIST xen-4.8.1-upstream-patches-1.tar.xz 59600 SHA256 c2072f96e9c3acfac89b758fca31ed6dfa247c320a32359ed52dbe1c01865291 SHA512 962394f2ac891a64233436e49b3b8a94ecd0150d1a009912ab6264c39934585476e1720ead20b9bbf067fee4d67d76b960990c5d2001f26a883a05cf8650a359 WHIRLPOOL fc5409d426ed833039af6b690aa731a7853966930c03db1f59b34d7bcdba06c844860f08e8cbf770180b3a4a0e6e60e844a2f09d6b3798808c2d242ff648cd56
DIST xen-4.8.1.tar.gz 22516631 SHA256 1d69153b94561429293015f66463ee17c26404d1c014e646ecbcca6078581395 SHA512 9f535b4bb57d285dfb92c974d55513505cf485b2d7218fe8f6ed62768e2cee7f225b08adf6706590b2c0a04feca16e10915297c33b98e1b110f8ea7035f46c15 WHIRLPOOL ea367d4d08eaa464417f6c5e7143a52e085a8d0e515c99cbb49ac3ccd5c189aa79947d233754177698a076c28abf7a32c83ae29019ca70c6300839b09ca67bad
DIST xen-4.8.2-upstream-patches-0.tar.xz 7540 SHA256 d4bd4ce76097c49ebbad67a64814b9b41af0528b390ade15814cf0fb144e5e77 SHA512 34118ac114773cfc01a464de2a93b14905d3fb5edd62ae093f6cb40758f89c7fdc8449d0b7e9bfbaaee812b6f32b0c21860adeebb609376a22ce231e405b0837 WHIRLPOOL 0ff8c2fe3c349e6dc85e98644a813dd590c42bc78c6bbf98cdf77ed516e73fe5ca72a44935eae77f6ff9dcba8fef5d24c181d24b63b15bc470e7ed59098d5808
DIST xen-4.8.2.tar.gz 22522336 SHA256 cb1cc2f0985e3d8651215e5d24c1fcc3036994fa7cc495a5091a2c85ece2aff9 SHA512 7805531f73d23ecfff3439770e62d387f4254a444875670d53a0a739323e5d4d8f8fcc478f8936ee1ae8aff3e0229549e47c01c606365a8ce060dd5c503e87da WHIRLPOOL 8e54e79219f89640162673da471a02ee8a39bb884e2376a79a09226462903185b49a771fef51ceca54c4dd42a110ee1214db6dbf94235a156a17d6c597634c3d
DIST xen-security-patches-26.tar.xz 8276 SHA256 2a21ec429f8952875f7d95f24697600e606326f1a16d5622cee73628cd0401c1 SHA512 f54fc7e720a70258263d29cc482b8269386818ad75792de87b0d0357fdb6af81f2102e5983100db47563435fa28f875a84e8c6d73d44797aadaf0c469d9fb0ec WHIRLPOOL b31667d8415dc1fbcd60160fdbc2fe0ad4de9bd2171fda875f5585b8d7821c4c035b029dbf382abacf4b6be745aeeb708f419fdcabdd86f78ff1c13703802e3f
DIST xen-security-patches-27.tar.xz 2604 SHA256 a8d01bc309894cb1bbde7a264003b873b77d1b4a1cb5c917b25a51e1b068f85b SHA512 ed9ef5ca3a39635a5ebbdc88663ea32f48c12e8ac1f193b8a66486bb62da692add38c5a89051753c992294528b4b4e92d121997317032a864f46776cb91d1897 WHIRLPOOL 07e2321959664083000a6cc90f30fa2365e206e8c1cc22e74afb085760e2c6378ba51f4ebcbf2b433c0d7a8ad9d98d0f43adb423b1bffc6a00eade362e1c59f5
192 changes: 192 additions & 0 deletions app-emulation/xen/xen-4.8.2.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

PYTHON_COMPAT=( python2_7 )

inherit eutils multilib mount-boot flag-o-matic python-any-r1 toolchain-funcs

MY_PV=${PV/_/-}
MY_P=${PN}-${PV/_/-}

if [[ $PV == *9999 ]]; then
inherit git-r3
KEYWORDS=""
EGIT_REPO_URI="git://xenbits.xen.org/xen.git"
SRC_URI=""
else
KEYWORDS="~amd64 ~arm -x86"
UPSTREAM_VER=0
SECURITY_VER=
GENTOO_VER=

[[ -n ${UPSTREAM_VER} ]] && \
UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
[[ -n ${SECURITY_VER} ]] && \
SECURITY_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-security-patches-${SECURITY_VER}.tar.xz"
[[ -n ${GENTOO_VER} ]] && \
GENTOO_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${PN}-gentoo-patches-${GENTOO_VER}.tar.xz"
SRC_URI="https://downloads.xenproject.org/release/xen/${MY_PV}/${MY_P}.tar.gz
${UPSTREAM_PATCHSET_URI}
${SECURITY_PATCHSET_URI}
${GENTOO_PATCHSET_URI}"
fi

DESCRIPTION="The Xen virtual machine monitor"
HOMEPAGE="http://xen.org/"
LICENSE="GPL-2"
SLOT="0"
IUSE="custom-cflags debug efi flask"

DEPEND="${PYTHON_DEPS}
efi? ( >=sys-devel/binutils-2.22[multitarget] )
!efi? ( >=sys-devel/binutils-2.22 )"
RDEPEND=""
PDEPEND="~app-emulation/xen-tools-${PV}"

# no tests are available for the hypervisor
# prevent the silliness of /usr/lib/debug/usr/lib/debug files
# prevent stripping of the debug info from the /usr/lib/debug/xen-syms
RESTRICT="test splitdebug strip"

# Approved by QA team in bug #144032
QA_WX_LOAD="boot/xen-syms-${PV}"

REQUIRED_USE="arm? ( debug )"

S="${WORKDIR}/${MY_P}"

pkg_setup() {
python-any-r1_pkg_setup
if [[ -z ${XEN_TARGET_ARCH} ]]; then
if use amd64; then
export XEN_TARGET_ARCH="x86_64"
elif use arm; then
export XEN_TARGET_ARCH="arm32"
elif use arm64; then
export XEN_TARGET_ARCH="arm64"
else
die "Unsupported architecture!"
fi
fi

if use flask ; then
export "XSM_ENABLE=y"
export "FLASK_ENABLE=y"
fi
}

src_prepare() {
# Upstream's patchset
if [[ -n ${UPSTREAM_VER} ]]; then
EPATCH_SUFFIX="patch" \
EPATCH_FORCE="yes" \
EPATCH_OPTS="-p1" \
epatch "${WORKDIR}"/patches-upstream
fi

# Security patchset
if [[ -n ${SECURITY_VER} ]]; then
einfo "Try to apply Xen Security patch set"
# apply main xen patches
# Two parallel systems, both work side by side
# Over time they may concdense into one. This will suffice for now
EPATCH_SUFFIX="patch"
EPATCH_FORCE="yes"

source "${WORKDIR}"/patches-security/${PV}.conf

for i in ${XEN_SECURITY_MAIN}; do
epatch "${WORKDIR}"/patches-security/xen/$i
done
fi

# Gentoo's patchset
if [[ -n ${GENTOO_VER} ]]; then
EPATCH_SUFFIX="patch" \
EPATCH_FORCE="yes" \
epatch "${WORKDIR}"/patches-gentoo
fi

epatch "${FILESDIR}"/${PN}-4.6-efi.patch

# Drop .config
sed -e '/-include $(XEN_ROOT)\/.config/d' -i Config.mk || die "Couldn't drop"

if use efi; then
export EFI_VENDOR="gentoo"
export EFI_MOUNTPOINT="boot"
fi

# if the user *really* wants to use their own custom-cflags, let them
if use custom-cflags; then
einfo "User wants their own CFLAGS - removing defaults"
# try and remove all the default custom-cflags
find "${S}" -name Makefile -o -name Rules.mk -o -name Config.mk -exec sed \
-e 's/CFLAGS\(.*\)=\(.*\)-O3\(.*\)/CFLAGS\1=\2\3/' \
-e 's/CFLAGS\(.*\)=\(.*\)-march=i686\(.*\)/CFLAGS\1=\2\3/' \
-e 's/CFLAGS\(.*\)=\(.*\)-fomit-frame-pointer\(.*\)/CFLAGS\1=\2\3/' \
-e 's/CFLAGS\(.*\)=\(.*\)-g3*\s\(.*\)/CFLAGS\1=\2 \3/' \
-e 's/CFLAGS\(.*\)=\(.*\)-O2\(.*\)/CFLAGS\1=\2\3/' \
-i {} \; || die "failed to re-set custom-cflags"
fi

# remove -Werror for gcc-4.6's sake
find "${S}" -name 'Makefile*' -o -name '*.mk' -o -name 'common.make' | \
xargs sed -i 's/ *-Werror */ /'
# not strictly necessary to fix this
sed -i 's/, "-Werror"//' "${S}/tools/python/setup.py" || die "failed to re-set setup.py"

# Bug #575868 converted to a sed statement, typo of one char
sed -e "s:granter’s:granter's:" -i xen/include/public/grant_table.h || die

epatch_user
}

src_configure() {
use arm && myopt="${myopt} CONFIG_EARLY_PRINTK=sun7i"

use debug && myopt="${myopt} debug=y"

if use custom-cflags; then
filter-flags -fPIE -fstack-protector
replace-flags -O3 -O2
else
unset CFLAGS
unset LDFLAGS
unset ASFLAGS
fi
}

src_compile() {
# Send raw LDFLAGS so that --as-needed works
emake V=1 CC="$(tc-getCC)" LDFLAGS="$(raw-ldflags)" LD="$(tc-getLD)" -C xen ${myopt}
}

src_install() {
local myopt
use debug && myopt="${myopt} debug=y"

# The 'make install' doesn't 'mkdir -p' the subdirs
if use efi; then
mkdir -p "${D}"${EFI_MOUNTPOINT}/efi/${EFI_VENDOR} || die
fi

emake LDFLAGS="$(raw-ldflags)" DESTDIR="${D}" -C xen ${myopt} install

# make install likes to throw in some extra EFI bits if it built
use efi || rm -rf "${D}/usr/$(get_libdir)/efi"
}

pkg_postinst() {
elog "Official Xen Guide and the unoffical wiki page:"
elog " https://wiki.gentoo.org/wiki/Xen"
elog " http://en.gentoo-wiki.com/wiki/Xen/"

use efi && einfo "The efi executable is installed in boot/efi/gentoo"

elog "You can optionally block the installation of /boot/xen-syms by an entry"
elog "in folder /etc/portage/env using the portage's feature INSTALL_MASK"
elog "e.g. echo ${msg} > /etc/portage/env/xen.conf"
}

0 comments on commit bc9bced

Please sign in to comment.