From: Michael Marineau Date: Wed, 2 May 2007 04:10:04 +0000 (+0000) Subject: Add xen-tools 3.0.4 from the marineam-xen overlay X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=71c833a90a7fdaedd21336e7a97446fbc7f70d9d;p=gentoo.git Add xen-tools 3.0.4 from the marineam-xen overlay Package-Manager: portage-2.1.1-r2 --- diff --git a/app-emulation/xen-tools/ChangeLog b/app-emulation/xen-tools/ChangeLog index 7596d3540370..340f9d1cc8c4 100644 --- a/app-emulation/xen-tools/ChangeLog +++ b/app-emulation/xen-tools/ChangeLog @@ -1,6 +1,23 @@ # ChangeLog for app-emulation/xen-tools # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.20 2007/03/13 06:26:34 aross Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/xen-tools/ChangeLog,v 1.21 2007/05/02 04:10:04 marineam Exp $ + +*xen-tools-3.0.4_p1 (02 May 2007) + + 02 May 2007; Michael Marineau + -files/3.0.2-r4/pygrub-progsreiserfs-0.3.1.patch, + -files/3.0.2-r4/xc_ptrace.patch, -files/3.0.2-r4/xend.initd, + -files/3.0.2-r4/xendomains.initd, +files/xen-tools-3.0.2-xc_ptrace.patch, + +files/xen-tools-3.0.2-pygrub-progsreiserfs-0.3.1.patch, + +files/xen-tools-3.0.4_p1--as-needed.patch, + +files/xen-tools-3.0.4_p1-network-bridge-broadcast.patch, + +files/xen-tools-3.0.4_p1-remove-monitor-mode-from-vnc.patch, + +files/xen-tools-3.0.4_p1-vnclisten.patch, +files/xend.initd, + +files/xendomains.initd, -files/xendomains-conf, -files/xendomains-init, + -xen-tools-3.0.2-r2.ebuild, -xen-tools-3.0.2-r3.ebuild, + xen-tools-3.0.2-r4.ebuild, +xen-tools-3.0.4_p1.ebuild: + Add Xen 3.0.4_1 from the marineam-xen overlay. + Clean out some old ebuilds and clean up the files dir. 13 Mar 2007; Andrew Ross xen-tools-3.0.2-r3.ebuild, xen-tools-3.0.2-r4.ebuild: diff --git a/app-emulation/xen-tools/files/digest-xen-tools-3.0.4_p1 b/app-emulation/xen-tools/files/digest-xen-tools-3.0.4_p1 new file mode 100644 index 000000000000..7aadef066796 --- /dev/null +++ b/app-emulation/xen-tools/files/digest-xen-tools-3.0.4_p1 @@ -0,0 +1,3 @@ +MD5 e85e16ad3dc354338e3ac4a8951f9649 xen-3.0.4_1-src.tgz 6473636 +RMD160 f869eec35f6afe0bc9824ce2eb4a600f789d423b xen-3.0.4_1-src.tgz 6473636 +SHA256 6b3842393e69a9c8fcdbc2789d05830aba6f1d108a6f97f1448de4a86f92a5cb xen-3.0.4_1-src.tgz 6473636 diff --git a/app-emulation/xen-tools/files/xen-tools-3.0.2-pygrub-progsreiserfs-0.3.1.patch b/app-emulation/xen-tools/files/xen-tools-3.0.2-pygrub-progsreiserfs-0.3.1.patch new file mode 100644 index 000000000000..2132a6378711 --- /dev/null +++ b/app-emulation/xen-tools/files/xen-tools-3.0.2-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 + #include + +-#include ++#include + #include + + #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/xen-tools-3.0.2-xc_ptrace.patch b/app-emulation/xen-tools/files/xen-tools-3.0.2-xc_ptrace.patch new file mode 100644 index 000000000000..af51c3d88a77 --- /dev/null +++ b/app-emulation/xen-tools/files/xen-tools-3.0.2-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/xen-tools-3.0.4_p1--as-needed.patch b/app-emulation/xen-tools/files/xen-tools-3.0.4_p1--as-needed.patch new file mode 100644 index 000000000000..8243ac8f342e --- /dev/null +++ b/app-emulation/xen-tools/files/xen-tools-3.0.4_p1--as-needed.patch @@ -0,0 +1,12 @@ +diff -rpuN xen-3.0.4_1-src.orig/tools/xenmon/Makefile xen-3.0.4_1-src/tools/xenmon/Makefile +--- xen-3.0.4_1-src.orig/tools/xenmon/Makefile 2007-01-08 15:00:51.000000000 +0000 ++++ xen-3.0.4_1-src/tools/xenmon/Makefile 2007-02-09 01:02:08.000000000 +0000 +@@ -42,6 +42,6 @@ clean: + + + %: %.c Makefile +- $(CC) $(CFLAGS) $(LDFLAGS) -lxenctrl -o $@ $< ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lxenctrl + xentrace_%: %.c Makefile +- $(CC) $(CFLAGS) $(LDFLAGS) -lxenctrl -o $@ $< ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< -lxenctrl diff --git a/app-emulation/xen-tools/files/xen-tools-3.0.4_p1-network-bridge-broadcast.patch b/app-emulation/xen-tools/files/xen-tools-3.0.4_p1-network-bridge-broadcast.patch new file mode 100644 index 000000000000..e830de54ae43 --- /dev/null +++ b/app-emulation/xen-tools/files/xen-tools-3.0.4_p1-network-bridge-broadcast.patch @@ -0,0 +1,19 @@ +diff -ru xen-3.0.4_1-src.orig/tools/examples/network-bridge xen-3.0.4_1-src/tools/examples/network-bridge +--- xen-3.0.4_1-src.orig/tools/examples/network-bridge 2007-01-08 07:00:48.000000000 -0800 ++++ xen-3.0.4_1-src/tools/examples/network-bridge 2007-03-05 17:37:32.000000000 -0800 +@@ -70,13 +70,13 @@ + vif0="vif0.${vifnum}" + + get_ip_info() { +- addr_pfx=`ip addr show dev $1 | egrep '^ *inet' | sed -e 's/ *inet //' -e 's/ .*//'` ++ addr_pfx=`ip addr show dev $1 | egrep '^ *inet' | sed -e 's/ *inet //' -e "s/$1//"` + gateway=`ip route show dev $1 | fgrep default | sed 's/default via //'` + } + + do_ifup() { + if ! ifup $1 ; then +- if [ ${addr_pfx} ] ; then ++ if [ "${addr_pfx}" ] ; then + # use the info from get_ip_info() + ip addr flush $1 + ip addr add ${addr_pfx} dev $1 diff --git a/app-emulation/xen-tools/files/xen-tools-3.0.4_p1-remove-monitor-mode-from-vnc.patch b/app-emulation/xen-tools/files/xen-tools-3.0.4_p1-remove-monitor-mode-from-vnc.patch new file mode 100644 index 000000000000..07e9735ea8df --- /dev/null +++ b/app-emulation/xen-tools/files/xen-tools-3.0.4_p1-remove-monitor-mode-from-vnc.patch @@ -0,0 +1,23 @@ +diff --git a/tools/ioemu/vnc.c b/tools/ioemu/vnc.c +index 6d7cc31..9e2d535 100644 +--- a/tools/ioemu/vnc.c ++++ b/tools/ioemu/vnc.c +@@ -962,18 +962,6 @@ static void do_key_event(VncState *vs, int down, uint32_t sym) + case XK_Num_Lock: + vs->numlock = !vs->numlock; + break; +- +- case XK_1 ... XK_9: +- if ((vs->ctl_keys & 3) != 3) +- break; +- +- console_select(sym - XK_1); +- if (is_graphic_console()) { +- /* tell the vga console to redisplay itself */ +- vga_hw_invalidate(); +- vnc_dpy_update(vs->ds, 0, 0, vs->ds->width, vs->ds->height); +- } +- break; + } + } + } diff --git a/app-emulation/xen-tools/files/xen-tools-3.0.4_p1-vnclisten.patch b/app-emulation/xen-tools/files/xen-tools-3.0.4_p1-vnclisten.patch new file mode 100644 index 000000000000..a22bebefbd32 --- /dev/null +++ b/app-emulation/xen-tools/files/xen-tools-3.0.4_p1-vnclisten.patch @@ -0,0 +1,13 @@ +diff -rpuN xen-3.0.4_1-src.orig/tools/python/xen/xend/XendConfig.py xen-3.0.4_1-src/tools/python/xen/xend/XendConfig.py +--- xen-3.0.4_1-src.orig/tools/python/xen/xend/XendConfig.py Mon Dec 11 15:06:53 2006 +0000 ++++ xen-3.0.4_1-src/tools/python/xen/xend/XendConfig.py Tue Jan 30 13:36:15 2007 -0500 +@@ -229,7 +229,8 @@ LEGACY_IMAGE_CFG = [ + ('sdl', int), + ('vncdisplay', int), + ('vncunused', int), +- ('vncpasswd', str), ++ ('vncpasswd', str), ++ ('vnclisten', str), + ] + + LEGACY_IMAGE_HVM_CFG = [ diff --git a/app-emulation/xen-tools/files/xend.initd b/app-emulation/xen-tools/files/xend.initd new file mode 100644 index 000000000000..a28c6b4eb966 --- /dev/null +++ b/app-emulation/xen-tools/files/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/xend.initd,v 1.1 2007/05/02 04:10:04 marineam 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 $(> "${D}"/etc/conf.d/xendomains diff --git a/app-emulation/xen-tools/xen-tools-3.0.4_p1.ebuild b/app-emulation/xen-tools/xen-tools-3.0.4_p1.ebuild new file mode 100644 index 000000000000..8ce92e747a21 --- /dev/null +++ b/app-emulation/xen-tools/xen-tools-3.0.4_p1.ebuild @@ -0,0 +1,194 @@ +# Copyright 1999-2007 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.4_p1.ebuild,v 1.1 2007/05/02 04:10:04 marineam Exp $ + +inherit flag-o-matic distutils eutils multilib + +DESCRIPTION="Xend daemon and tools" +HOMEPAGE="http://www.xensource.com/xen/xen/" +MY_PV=${PV/_p/_} +SRC_URI="http://bits.xensource.com/oss-xen/release/${MY_PV/_/-}/src.tgz/xen-${MY_PV}-src.tgz" +S="${WORKDIR}/xen-${MY_PV}-src" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc debug screen custom-cflags pygrub ioemu" + +CDEPEND="dev-lang/python + sys-libs/zlib + ioemu? ( media-libs/libsdl )" + +DEPEND="${CDEPEND} + sys-devel/gcc + dev-lang/perl + sys-devel/dev86 + app-misc/pax-utils + x11-proto/xproto + doc? ( + dev-tex/latex2html + media-gfx/transfig + ) + ioemu? ( + net-libs/libvncserver + )" + +RDEPEND="${CDEPEND} + sys-apps/iproute2 + net-misc/bridge-utils + screen? ( + app-misc/screen + app-admin/logrotate + ) + || ( sys-fs/udev sys-apps/hotplug )" + +PYTHON_MODNAME="xen grub" + +# hvmloader is used to bootstrap a fully virtualized kernel +# Approved by QA team in bug #144032 +QA_WX_LOAD="usr/lib/xen/boot/hvmloader" + +pkg_setup() { + 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 '', 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. Also disable hvmloader, since it requires vmxassist. + if ! use x86 && ! has x86 $(get_all_abis); then + sed -i -e "/SUBDIRS += vmxassist/d" "${S}"/tools/firmware/Makefile + sed -i -e "/SUBDIRS += hvmloader/d" "${S}"/tools/firmware/Makefile + fi + + if ! use pygrub; then + sed -i -e "/^SUBDIRS-y += pygrub$/d" "${S}"/tools/Makefile + fi + + # Don't bother with ioemu, only needed for fully virtualised guests + if ! use ioemu; then + sed -i -e "/^CONFIG_IOEMU := y$/d" "${S}"/config/*.mk + fi + + # Allow --as-needed LDFLAGS + epatch "${FILESDIR}/${P}"--as-needed.patch + + # Fix vnclisten + epatch "${FILESDIR}/${P}"-vnclisten.patch + + # Fix network broadcast on bridged networks + epatch "${FILESDIR}/${P}"-network-bridge-broadcast.patch + + # Disable QEMU monitor mode in VNC, bug #170917 + epatch "${FILESDIR}/${P}"-remove-monitor-mode-from-vnc.patch +} + +src_compile() { + local myopt myconf + use debug && myopt="${myopt} debug=y" + + use custom-cflags || unset CFLAGS + gcc-specs-ssp && append-flags -fno-stack-protector -fno-stack-protector-all + + if use ioemu; then + myconf="${myconf} --disable-system --disable-user" + (cd tools/ioemu && econf ${myconf}) || die "configure failured" + fi + + 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}"/xend.initd xend \ + || die "Couldn't install xen.initd" + newconfd "${FILESDIR}"/xendomains.confd xendomains \ + || die "Couldn't install xendomains.confd" + newinitd "${FILESDIR}"/xendomains.initd xendomains \ + || die "Couldn't install xendomains.initd" + + 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 /var/lib/xen /var/log/xen +} + +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 +}