summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-emulation/xen-tools')
-rw-r--r--app-emulation/xen-tools/ChangeLog42
-rw-r--r--app-emulation/xen-tools/files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch56
-rw-r--r--app-emulation/xen-tools/files/3.0.2-r4/xc_ptrace.patch24
-rw-r--r--app-emulation/xen-tools/files/3.0.2-r4/xend.initd61
-rwxr-xr-xapp-emulation/xen-tools/files/3.0.2-r4/xendomains.initd96
-rw-r--r--app-emulation/xen-tools/files/digest-xen-tools-3.0.2-r43
-rw-r--r--app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild199
7 files changed, 480 insertions, 1 deletions
diff --git a/app-emulation/xen-tools/ChangeLog b/app-emulation/xen-tools/ChangeLog
index 6cd6a911ebfc..c4e257db8d00 100644
--- a/app-emulation/xen-tools/ChangeLog
+++ b/app-emulation/xen-tools/ChangeLog
@@ -1,6 +1,46 @@
# ChangeLog for app-emulation/xen-tools
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.17 2006/08/14 07:11:47 aross Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.18 2006/10/14 00:00:03 aross Exp $
+
+*xen-tools-3.0.2-r4 (13 Oct 2006)
+
+ 13 Oct 2006; <aross@gentoo.org>
+ +files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch,
+ +files/3.0.2-r4/xc_ptrace.patch, +files/3.0.2-r4/xendomains.initd,
+ +files/3.0.2-r4/xend.initd, +xen-tools-3.0.2-r4.ebuild:
+ Fix a PTRACE_* compilation error, thanks to Thomas Veith <th_veith@web.de>
+ in #151014.
+
+ Introduce the pygrub local USE flag and fix a compile error when
+ sys-fs/progsreiserfs is installed, thanks to M. Edward Borasky
+ <znmeb@cesmail.net> and Mauricio Zambrano <mauro@webdb.homelinux.net> in
+ #137137.
+
+ Make ntp-client start after xend, thanks to Harris Landgarten
+ <harrisl@lhjonline.com> in #144057.
+
+ Make /etc/init.d/xendomains correctly handle domains with numbers, periods
+ and/or hyphens, thanks to Robert S <robert_s@emailme.net.au> in #148628.
+
+ Fix a compile error with python-2.5, thanks to Charlie Shepherd
+ <masterdriverz@gmail.com> and Marien Zwart <marienz@gentoo.org> in #149138.
+
+ Fix a compilation error on AMD64 with a 64 bit kernel and 32 bit userland,
+ thanks to tonich <tonich@artparade.ru> and Sven Wegener
+ <swegener@gentoo.org> in #143999.
+
+ Make /etc/init.d/xend fail gracefully when started in a non-privileged
+ domain or unmodified kernel, thanks to Christian Hesse <mail@earthworm.de>
+ and Robert S <robert_s@emailme.net.au> in #148486.
+
+ Only warn instead of dying when python is build with stack smashing
+ protection (ssp), thanks to Tuan Van <langthang@gentoo.org>, Raimonds Cicans
+ <ray@apollo.lv>, Brad Plant <bplant@westnet.com.au> and Sven Wegener
+ <swegener@gentoo.org> in #141866.
+
+ Replace the hardened USE flag with test-flag-CC from flag-o-matic.eclass to
+ avoid compile errors with gcc-4.1 and USE=hardened, thanks to Richard
+ Benjamin Voigt <bvoigt@kas.com> in #147876.
*xen-tools-3.0.2-r3 (15 Aug 2006)
diff --git a/app-emulation/xen-tools/files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch b/app-emulation/xen-tools/files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch
new file mode 100644
index 000000000000..2132a6378711
--- /dev/null
+++ b/app-emulation/xen-tools/files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch
@@ -0,0 +1,56 @@
+diff -urN xen-3.0.2/tools/pygrub/src/fsys/reiser/reisermodule.c xen-3.0.2-b/tools/pygrub/src/fsys/reiser/reisermodule.c
+--- xen-3.0.2/tools/pygrub/src/fsys/reiser/reisermodule.c 2006-04-09 18:05:53.000000000 -0400
++++ xen-3.0.2-b/tools/pygrub/src/fsys/reiser/reisermodule.c 2006-08-18 12:51:42.000000000 -0400
+@@ -17,7 +17,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+
+-#include <dal/file_dal.h>
++#include <dal/file.h>
+ #include <reiserfs/reiserfs.h>
+
+ #if (PYTHON_API_VERSION >= 1011)
+@@ -46,8 +46,7 @@
+
+ if (!dal) return;
+
+- close((int)(unsigned long)dal->dev);
+- dal_free(dal);
++ dal_close(dal);
+ }
+
+ /* reiser file object */
+@@ -195,7 +194,7 @@
+ if (fs->fs != NULL)
+ {
+ reiserfs_fs_close(fs->fs);
+- file_dal_close(fs->dal);
++ file_close(fs->dal);
+ fs->fs = NULL;
+ }
+ Py_INCREF(Py_None);
+@@ -218,13 +217,13 @@
+ return NULL;
+ }
+
+- if (!(dal = file_dal_open(name, block_size, O_RDONLY))) {
++ if (!(dal = file_open(name, block_size, O_RDONLY))) {
+ PyErr_SetString(PyExc_ValueError, "Couldn't create device abstraction");
+ return NULL;
+ }
+
+ if (!(rfs = reiserfs_fs_open_fast(dal, dal))) {
+- file_dal_close(dal);
++ file_close(dal);
+ PyErr_SetString(PyExc_ValueError, "unable to open file");
+ return NULL;
+ }
+@@ -265,7 +264,7 @@
+ if (fs->fs != NULL)
+ {
+ reiserfs_fs_close(fs->fs);
+- file_dal_close(fs->dal);
++ file_close(fs->dal);
+ fs->fs = NULL;
+ }
+ PyObject_DEL(fs);
diff --git a/app-emulation/xen-tools/files/3.0.2-r4/xc_ptrace.patch b/app-emulation/xen-tools/files/3.0.2-r4/xc_ptrace.patch
new file mode 100644
index 000000000000..af51c3d88a77
--- /dev/null
+++ b/app-emulation/xen-tools/files/3.0.2-r4/xc_ptrace.patch
@@ -0,0 +1,24 @@
+--- tools/libxc/xc_ptrace.c-orig 2006-10-13 15:53:29.000000000 +1000
++++ tools/libxc/xc_ptrace.c 2006-10-13 15:54:06.000000000 +1000
+@@ -597,17 +597,13 @@
+ online_vcpus_changed(cpumap);
+ break;
+
+- case PTRACE_SETFPREGS:
+- case PTRACE_SETFPXREGS:
+- case PTRACE_PEEKUSER:
+- case PTRACE_POKEUSER:
+- case PTRACE_SYSCALL:
+- case PTRACE_KILL:
+- goto out_unspported; /* XXX not yet supported */
+-
+ case PTRACE_TRACEME:
+ printf("PTRACE_TRACEME is an invalid request under Xen\n");
+ goto out_error;
++
++ default:
++ goto out_unspported; /* XXX not yet supported */
++
+ }
+
+ return retval;
diff --git a/app-emulation/xen-tools/files/3.0.2-r4/xend.initd b/app-emulation/xen-tools/files/3.0.2-r4/xend.initd
new file mode 100644
index 000000000000..3ecd31f8661d
--- /dev/null
+++ b/app-emulation/xen-tools/files/3.0.2-r4/xend.initd
@@ -0,0 +1,61 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/3.0.2-r4/xend.initd,v 1.1 2006/10/14 00:00:03 aross Exp $
+
+opts="start stop status restart"
+
+depend() {
+ need net
+ before xendomains sshd ntp-client ntpd nfs nfsmount rsyncd portmap dhcp
+}
+
+await_daemons_up() {
+ for ((i=0; i<5; i++)); do
+ sleep 1
+ /usr/sbin/xend status && return 0
+ done
+ return 1
+}
+
+is_privileged_domain() {
+ grep -qsE '^control_d$' /proc/xen/capabilities
+ return $?
+}
+
+start() {
+ if is_privileged_domain ; then
+ ebegin "Starting Xen control daemon"
+ /usr/sbin/xend start
+ /usr/sbin/xend status || await_daemons_up
+ eend $?
+ else
+ eerror "Can't start xend - this is not a privileged domain."
+ return 1
+ fi
+}
+
+stop() {
+ if [ "$(xm list | wc -l)" -gt 2 ]; then
+ ebegin " Stopping all domains"
+ /usr/sbin/xm shutdown --all --wait >/dev/null
+ eend $?
+ fi
+
+ ebegin "Stopping Xen control daemon"
+ /usr/sbin/xend stop
+ eend $?
+
+ # This needs more testing (bug #149321)
+ #ebegin "Stopping xenconsoled"
+ #kill $(</var/run/xenconsoled.pid)
+ #eend $?
+
+ #ebegin "Stopping xenstored"
+ #kill $(</var/run/xenstore.pid)
+ #eend $?
+}
+
+status() {
+ is_privileged_domain && /usr/sbin/xend status
+}
diff --git a/app-emulation/xen-tools/files/3.0.2-r4/xendomains.initd b/app-emulation/xen-tools/files/3.0.2-r4/xendomains.initd
new file mode 100755
index 000000000000..039c76527aa1
--- /dev/null
+++ b/app-emulation/xen-tools/files/3.0.2-r4/xendomains.initd
@@ -0,0 +1,96 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/files/3.0.2-r4/xendomains.initd,v 1.1 2006/10/14 00:00:03 aross Exp $
+
+opts="start stop status restart"
+
+depend() {
+ need xend
+ after dhcp
+}
+
+get_domname() {
+ local name_from_file=$(sed -rn 's/^name\W*=\W*\"?([[:alnum:]_\.-]+)\"?\W*;?/\1/p' "${1}" | tail -n 1)
+
+ if [[ -z ${name_from_file} ]] ; then
+ basename "${1}"
+ else
+ echo ${name_from_file}
+ fi
+}
+
+is_running() {
+ /usr/sbin/xm list "${1}" >/dev/null 2>&1
+}
+
+using_screen() {
+ [[ "${SCREEN}" == "yes" || "${SCREEN}" == "YES" ]]
+}
+
+set_screen_cmd() {
+ screen_cmd="screen -q -r ${SCREEN_NAME:=xen} -X"
+}
+
+start() {
+ set_screen_cmd
+
+ einfo "Starting Xen domains from ${AUTODIR:=/etc/xen/auto}"
+ if using_screen ; then
+ ebegin "Creating screen session to hold domain consoles"
+ ( screen -d -m -S ${SCREEN_NAME} -t dom0 \
+ && ${screen_cmd} zombie dr \
+ && logrotate -f /etc/xen/xen-consoles.logrotate \
+ && ${screen_cmd} logfile /var/log/xen-consoles/%t.log \
+ && ${screen_cmd} logfile flush ${SCREEN_LOG_INTERVAL:-1} \
+ && ${screen_cmd} log on \
+ && ${screen_cmd} deflog on ) >/dev/null
+ if [[ $? -ne 0 ]] ; then
+ eend 1
+ return 1
+ else
+ eend
+ fi
+ fi
+ # Create all domains with config files in AUTODIR.
+ for dom in $(ls "${AUTODIR}/"* 2>/dev/null); do
+ name=$(get_domname ${dom})
+ if ! is_running ${name} ; then
+ ebegin " Starting domain ${name}"
+ if using_screen ; then
+ ${screen_cmd} screen -t ${name} xm create ${dom} -c
+ else
+ xm create --quiet ${dom}
+ fi
+ eend $?
+ else
+ einfo " Not starting domain ${name} - already running"
+ fi
+ done
+}
+
+stop() {
+ set_screen_cmd
+
+ einfo "Shutting down Xen domains from ${AUTODIR:=/etc/xen/auto}"
+ # Stop all domains with config files in AUTODIR.
+ for dom in $(ls "${AUTODIR}/"* 2>/dev/null); do
+ name=$(get_domname ${dom})
+ if is_running ${name} ; then
+ ebegin " Stopping domain ${name}"
+ xm shutdown --wait ${name} >/dev/null
+ eend $?
+ else
+ einfo " Not stopping domain ${name} - not running"
+ fi
+ done
+ if using_screen ; then
+ ebegin "Closing screen session ${SCREEN_NAME}"
+ ${screen_cmd} quit
+ eend $?
+ fi
+}
+
+status() {
+ /usr/sbin/xm list
+}
diff --git a/app-emulation/xen-tools/files/digest-xen-tools-3.0.2-r4 b/app-emulation/xen-tools/files/digest-xen-tools-3.0.2-r4
new file mode 100644
index 000000000000..724d092d5489
--- /dev/null
+++ b/app-emulation/xen-tools/files/digest-xen-tools-3.0.2-r4
@@ -0,0 +1,3 @@
+MD5 544eab940a0734a55459d648e5c3b224 xen-3.0.2-src.tgz 4933621
+RMD160 34e4431a981891319f8a5ea0c3f604e7d8d7d7af xen-3.0.2-src.tgz 4933621
+SHA256 f18ffab16a457fa721d11933c75f8288f6958c88c2669857c7c11d5107ba2951 xen-3.0.2-src.tgz 4933621
diff --git a/app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild b/app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild
new file mode 100644
index 000000000000..ca6112b1be0f
--- /dev/null
+++ b/app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild
@@ -0,0 +1,199 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/xen-tools-3.0.2-r4.ebuild,v 1.1 2006/10/14 00:00:03 aross Exp $
+
+inherit mount-boot flag-o-matic distutils eutils multilib
+
+DESCRIPTION="Xend daemon and tools"
+HOMEPAGE="http://xen.sourceforge.net"
+SRC_URI="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/xen-${PV}-src.tgz"
+S="${WORKDIR}/xen-${PV}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc debug screen custom-cflags pygrub vnc sdl"
+
+CDEPEND="dev-lang/python
+ sys-libs/zlib
+ sdl? ( media-libs/libsdl )
+ vnc? ( media-libs/libsdl )
+ pygrub? ( >=sys-fs/progsreiserfs-0.3.1_rc8 )"
+
+DEPEND="${CDEPEND}
+ sys-devel/gcc
+ dev-lang/perl
+ app-misc/pax-utils
+ doc? (
+ dev-tex/latex2html
+ media-gfx/transfig
+ )
+ vnc? ( net-libs/libvncserver )"
+
+RDEPEND="${CDEPEND}
+ >=app-emulation/xen-3.0.2
+ sys-apps/iproute2
+ net-misc/bridge-utils
+ screen? (
+ app-misc/screen
+ app-admin/logrotate
+ )
+ || ( sys-fs/udev sys-apps/hotplug )"
+
+PYTHON_MODNAME="xen grub"
+
+pkg_setup() {
+ if use vnc && ! use sdl ; then
+ ewarn "You have the 'vnc' USE flag set, but not 'sdl'."
+ ewarn "VNC functionality requires SDL support, so it"
+ ewarn "will be enabled anyway."
+ fi
+
+ if [[ "$(scanelf -s __guard -q `which python`)" ]] ; then
+ ewarn "xend may not work when python is built with stack smashing protection (ssp)."
+ ewarn "If 'xm create' fails with '<ProtocolError for /RPC2: -1 >', see bug #141866"
+ fi
+
+ if [[ -z ${XEN_TARGET_ARCH} ]] ; then
+ if use x86 ; then
+ export XEN_TARGET_ARCH="x86_32"
+ elif use amd64 ; then
+ export XEN_TARGET_ARCH="x86_64"
+ else
+ die "Unsupported architecture!"
+ fi
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+
+ # 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 {} \;
+ fi
+
+ # xen tries to be smart and filter out CFLAGs not supported by gcc.
+ # It doesn't handle no* flags though, but flag-o-matic's test-flag-CC does.
+ for FLAG in -nopie -fno-stack-protector -fno-stack-protector-all; do
+ test-flag-CC ${FLAG} && HARDFLAGS="${HARDFLAGS} ${FLAG}"
+ done
+ sed -i "s/^CFLAGS :=$/& ${HARDFLAGS}/" \
+ "${S}"/tools/firmware/{hvmloader,vmxassist}/Makefile
+
+
+ # Disable the 32bit-only vmxassist if we are not on x86
+ # and we don't support the x86 ABI
+ if ! use x86 && ! has x86 $(get_all_abis); then
+ sed -i -e "/SUBDIRS += vmxassist/d" "${S}"tools/firmware/Makefile
+ fi
+
+ if use pygrub; then
+ # Upstream use Debian and hence progsreiserfs-0.3.0,
+ # which has a different API to 0.3.1
+ epatch "${FILESDIR}/${PVR}"/pygrub-progsreiserfs-0.3.1.patch
+ else
+ sed -i -e "/^SUBDIRS += pygrub$/d" "${S}"/tools/Makefile
+ fi
+
+ # Fixes for hardened and amd64
+ epatch "${FILESDIR}"/${P}-bxclobber.patch
+ epatch "${FILESDIR}"/${P}-pushpop.patch
+
+ # Allow --as-needed LDFLAGS
+ epatch "${FILESDIR}/${P}"--as-needed.patch
+
+ # Allow building with python-2.5 (bug #149138)
+ # Backported from upstream - should be in 3.0.3
+ sed -i 's/\.2|^2\.3|^2\.4/.[2345]/' "${S}"/tools/check/check_python
+
+ # Fix upstream's broken test cases (bug #141233)
+ epatch "${FILESDIR}/${P}"-test-uuid.patch
+ epatch "${FILESDIR}/${P}"-test-xauthority.patch
+
+ # Fix compilation error with newer glibc (bug #151014)
+ # Backported from upstream - should be in 3.0.3
+ epatch "${FILESDIR}/${PVR}"/xc_ptrace.patch
+}
+
+src_compile() {
+ local myopt myconf
+ use debug && myopt="${myopt} debug=y"
+
+ myconf="${myconf} $(use_enable vnc)"
+ if use vnc ; then
+ myconf="${myconf} --enable-sdl"
+ else
+ myconf="${myconf} $(use_enable sdl)"
+ fi
+
+ use custom-cflags || unset CFLAGS
+ gcc-specs-ssp && append-flags -fno-stack-protector -fno-stack-protector-all
+
+ (cd tools/ioemu && econf ${myconf}) || die "configure failured"
+ emake -C tools ${myopt} || die "compile failed"
+
+ if use doc; then
+ sh ./docs/check_pkgs || die "package check failed"
+ emake -C docs || die "compiling docs failed"
+ fi
+
+ emake -C docs man-pages || die "make man-pages failed"
+}
+
+src_install() {
+ local myopt="XEN_PYTHON_NATIVE_INSTALL=1"
+
+ make DESTDIR="${D}" ${myopt} install-tools \
+ || die "install failed"
+
+ # Remove RedHat-specific stuff
+ rm -rf "${D}"/etc/sysconfig
+
+ if use doc; then
+ make DESTDIR="${D}" -C docs install || die "install docs failed"
+ # Rename doc/xen to the Gentoo-style doc/xen-x.y
+ mv "${D}"/usr/share/doc/{${PN},${PF}}
+ fi
+
+ doman docs/man?/*
+
+ newinitd "${FILESDIR}/${PVR}"/xend.initd xend
+ newconfd "${FILESDIR}"/xendomains.confd xendomains
+ newinitd "${FILESDIR}/${PVR}"/xendomains.initd xendomains
+
+ if use screen; then
+ cat "${FILESDIR}"/xendomains-screen.confd >> "${D}"/etc/conf.d/xendomains
+ cp "${FILESDIR}"/xen-consoles.logrotate "${D}"/etc/xen/
+ keepdir /var/log/xen-consoles
+ fi
+
+ # xend expects these to exist
+ keepdir /var/run/xenstored /var/lib/xenstored /var/xen/dump
+}
+
+pkg_postinst() {
+ elog "Please visit the Xen and Gentoo wiki:"
+ elog "http://gentoo-wiki.com/HOWTO_Xen_and_Gentoo"
+
+ if ! built_with_use dev-lang/python ncurses; then
+ echo
+ ewarn "NB: Your dev-lang/python is built without USE=ncurses."
+ ewarn "Please rebuild python with USE=ncurses to make use of xenmon.py."
+ fi
+
+ if grep -qsF XENSV= "${ROOT}/etc/conf.d/xend"; then
+ echo
+ elog "xensv is broken upstream (Gentoo bug #142011)."
+ elog "Please remove '${ROOT%/}/etc/conf.d/xend', as it is no longer needed."
+ fi
+}