diff options
22 files changed, 790 insertions, 0 deletions
diff --git a/sysutils/xentools20/DESCR b/sysutils/xentools20/DESCR new file mode 100644 index 00000000000..96c12e64e68 --- /dev/null +++ b/sysutils/xentools20/DESCR @@ -0,0 +1,5 @@ +The Xen virtual machine monitor allows running several virtual machines +on a single physical machine. The xentools20 package contains the +tools to create, destroy and control the virtual machines. + +The xentools20 package contains the tools for Xen 2.0 diff --git a/sysutils/xentools20/Makefile b/sysutils/xentools20/Makefile new file mode 100644 index 00000000000..ab011d02cbb --- /dev/null +++ b/sysutils/xentools20/Makefile @@ -0,0 +1,65 @@ +# $NetBSD: Makefile,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ +# + +DISTNAME= xen-2.0.3-src +PKGNAME= xentools20-2.0.3 +CATEGORIES= sysutils +MASTER_SITES= http://www.cl.cam.ac.uk/Research/SRG/netos/xen/downloads/ +EXTRACT_SUFX= .tgz +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} +#DISTFILES+= netbsd-xen-kernel-headers-040508.tar.gz + +MAINTAINER= bouyer@NetBSD.org +HOMEPAGE= http://www.netbsd.org/Ports/xen/ +COMMENT= Userland Tools for Xen + +DEPENDS+= ${PYPKGPREFIX}-twisted*:../../net/py-twisted + +ONLY_FOR_PLATFORM= NetBSD-*-i386 + +WRKSRC= ${WRKDIR}/xen-2.0/tools + +PKG_SYSCONFSUBDIR?= xc20 +USE_PKGINSTALL= yes +EGDIR= ${PREFIX}/share/examples/${PKGNAME_NOREV} +CONF_FILES= ${EGDIR}/defaults ${PKG_SYSCONFDIR}/defaults +CONF_FILES+= ${EGDIR}/democd ${PKG_SYSCONFDIR}/democd +CONF_FILES+= ${EGDIR}/netbsd ${PKG_SYSCONFDIR}/netbsd + +USE_GNU_TOOLS+= make +MAKE_ENV+= EGDIR="${EGDIR}" +MAKE_ENV+= MV="${MV}" PYTHON="${PYTHONBIN}" SED="${SED}" +PYTHON_VERSIONS_ACCEPTED= 24pth 23pth 22pth +PY_PATCHPLIST= yes +PYTHON_PATCH_SCRIPTS= python/xen/util/console_client.py +PYTHON_PATCH_SCRIPTS+= python/xen/xend/server/SrvServer.py +PYTHON_PATCH_SCRIPTS+= python/xen/xend/XendClient.py +PYTHON_PATCH_SCRIPTS+= python/xen/xend/sxp.py +PYTHON_PATCH_SCRIPTS+= xfrd/xfrdClient.py +PYTHON_PATCH_SCRIPTS+= misc/xensymoops +PYTHON_PATCH_SCRIPTS+= misc/xencons +PYTHON_PATCH_SCRIPTS+= misc/xm +PYTHON_PATCH_SCRIPTS+= misc/xensv +PYTHON_PATCH_SCRIPTS+= misc/netfix +PYTHON_PATCH_SCRIPTS+= misc/xend +PYTHON_PATCH_SCRIPTS+= xentrace/xentrace_format +USE_BUILDLINK3= yes + +SUBST_CLASSES= paths +SUBST_STAGE.paths= pre-configure +SUBST_FILES.paths= python/xen/xend/server/SrvDaemon.py +SUBST_FILES.paths+= python/xen/xend/XendDomainInfo.py +SUBST_FILES.paths+= python/xen/sv/Daemon.py +SUBST_SED.paths= -e "s|/usr/sbin|${PREFIX}/sbin|g" +SUBST_MESSAGE.paths= "Fixing hardcoded paths." + +pre-build: + ${MKDIR} ${WRKSRC}/libxc/xen/NetBSD + ${CP} files/xenio.h ${WRKSRC}/libxc/xen/NetBSD + +.include "../../lang/python/application.mk" +.include "../../lang/python/extension.mk" +.include "../../devel/zlib/buildlink3.mk" +.include "../../www/curl/buildlink3.mk" + +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/xentools20/PLIST b/sysutils/xentools20/PLIST new file mode 100644 index 00000000000..075d2d40d50 --- /dev/null +++ b/sysutils/xentools20/PLIST @@ -0,0 +1,186 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ +bin/xenperf +bin/xencons +bin/miniterm +include/xc.h +lib/libxutil.so.2.0.0 +lib/libxutil.a +lib/libxc.so.2.0.0 +sbin/xend +sbin/xensv +sbin/netfix +sbin/xm +sbin/xenperf +sbin/xfrd +${PYSITELIB}/xen/__init__.py +${PYSITELIB}/xen/lowlevel/__init__.py +${PYSITELIB}/xen/lowlevel/xc.so +${PYSITELIB}/xen/lowlevel/xu.so +${PYSITELIB}/xen/lowlevel/__init__.pyc +${PYSITELIB}/xen/util/__init__.py +${PYSITELIB}/xen/util/Brctl.py +${PYSITELIB}/xen/util/tempfile.py +${PYSITELIB}/xen/util/ip.py +${PYSITELIB}/xen/util/console_client.py +${PYSITELIB}/xen/util/__init__.pyc +${PYSITELIB}/xen/util/Brctl.pyc +${PYSITELIB}/xen/util/tempfile.pyc +${PYSITELIB}/xen/util/ip.pyc +${PYSITELIB}/xen/util/console_client.pyc +${PYSITELIB}/xen/xend/util.py +${PYSITELIB}/xen/xend/XendClient.py +${PYSITELIB}/xen/xend/XendProtocol.py +${PYSITELIB}/xen/xend/XendVnet.py +${PYSITELIB}/xen/xend/XendError.py +${PYSITELIB}/xen/xend/XendDomainInfo.py +${PYSITELIB}/xen/xend/XendDomain.py +${PYSITELIB}/xen/xend/XendLogging.py +${PYSITELIB}/xen/xend/XendRoot.py +${PYSITELIB}/xen/xend/XendDomainConfig.py +${PYSITELIB}/xen/xend/XendMigrate.py +${PYSITELIB}/xen/xend/PrettyPrint.py +${PYSITELIB}/xen/xend/XendConsole.py +${PYSITELIB}/xen/xend/sxp.py +${PYSITELIB}/xen/xend/Blkctl.py +${PYSITELIB}/xen/xend/XendNode.py +${PYSITELIB}/xen/xend/Vifctl.py +${PYSITELIB}/xen/xend/EventServer.py +${PYSITELIB}/xen/xend/EventTypes.py +${PYSITELIB}/xen/xend/XendDmesg.py +${PYSITELIB}/xen/xend/Args.py +${PYSITELIB}/xen/xend/__init__.py +${PYSITELIB}/xen/xend/XendAsynchProtocol.py +${PYSITELIB}/xen/xend/encode.py +${PYSITELIB}/xen/xend/XendDB.py +${PYSITELIB}/xen/xend/server/controller.py +${PYSITELIB}/xen/xend/server/SrvServer.py +${PYSITELIB}/xen/xend/server/SrvConsoleDir.py +${PYSITELIB}/xen/xend/server/SrvDeviceDir.py +${PYSITELIB}/xen/xend/server/__init__.py +${PYSITELIB}/xen/xend/server/messages.py +${PYSITELIB}/xen/xend/server/SrvBase.py +${PYSITELIB}/xen/xend/server/domain.py +${PYSITELIB}/xen/xend/server/SrvDir.py +${PYSITELIB}/xen/xend/server/netif.py +${PYSITELIB}/xen/xend/server/params.py +${PYSITELIB}/xen/xend/server/SrvDmesg.py +${PYSITELIB}/xen/xend/server/channel.py +${PYSITELIB}/xen/xend/server/console.py +${PYSITELIB}/xen/xend/server/SrvConsole.py +${PYSITELIB}/xen/xend/server/SrvRoot.py +${PYSITELIB}/xen/xend/server/SrvEventDir.py +${PYSITELIB}/xen/xend/server/SrvNode.py +${PYSITELIB}/xen/xend/server/SrvDaemon.py +${PYSITELIB}/xen/xend/server/SrvDomain.py +${PYSITELIB}/xen/xend/server/blkif.py +${PYSITELIB}/xen/xend/server/SrvDomainDir.py +${PYSITELIB}/xen/xend/server/SrvXendLog.py +${PYSITELIB}/xen/xend/server/SrvVnetDir.py +${PYSITELIB}/xen/xend/server/controller.pyc +${PYSITELIB}/xen/xend/server/SrvServer.pyc +${PYSITELIB}/xen/xend/server/SrvConsoleDir.pyc +${PYSITELIB}/xen/xend/server/SrvDeviceDir.pyc +${PYSITELIB}/xen/xend/server/__init__.pyc +${PYSITELIB}/xen/xend/server/messages.pyc +${PYSITELIB}/xen/xend/server/SrvBase.pyc +${PYSITELIB}/xen/xend/server/domain.pyc +${PYSITELIB}/xen/xend/server/SrvDir.pyc +${PYSITELIB}/xen/xend/server/netif.pyc +${PYSITELIB}/xen/xend/server/params.pyc +${PYSITELIB}/xen/xend/server/SrvDmesg.pyc +${PYSITELIB}/xen/xend/server/channel.pyc +${PYSITELIB}/xen/xend/server/console.pyc +${PYSITELIB}/xen/xend/server/SrvConsole.pyc +${PYSITELIB}/xen/xend/server/SrvRoot.pyc +${PYSITELIB}/xen/xend/server/SrvEventDir.pyc +${PYSITELIB}/xen/xend/server/SrvNode.pyc +${PYSITELIB}/xen/xend/server/SrvDaemon.pyc +${PYSITELIB}/xen/xend/server/SrvDomain.pyc +${PYSITELIB}/xen/xend/server/blkif.pyc +${PYSITELIB}/xen/xend/server/SrvDomainDir.pyc +${PYSITELIB}/xen/xend/server/SrvXendLog.pyc +${PYSITELIB}/xen/xend/server/SrvVnetDir.pyc +${PYSITELIB}/xen/xend/util.pyc +${PYSITELIB}/xen/xend/XendClient.pyc +${PYSITELIB}/xen/xend/XendProtocol.pyc +${PYSITELIB}/xen/xend/XendVnet.pyc +${PYSITELIB}/xen/xend/XendError.pyc +${PYSITELIB}/xen/xend/XendDomainInfo.pyc +${PYSITELIB}/xen/xend/XendDomain.pyc +${PYSITELIB}/xen/xend/XendLogging.pyc +${PYSITELIB}/xen/xend/XendRoot.pyc +${PYSITELIB}/xen/xend/XendDomainConfig.pyc +${PYSITELIB}/xen/xend/XendMigrate.pyc +${PYSITELIB}/xen/xend/PrettyPrint.pyc +${PYSITELIB}/xen/xend/XendConsole.pyc +${PYSITELIB}/xen/xend/sxp.pyc +${PYSITELIB}/xen/xend/Blkctl.pyc +${PYSITELIB}/xen/xend/XendNode.pyc +${PYSITELIB}/xen/xend/Vifctl.pyc +${PYSITELIB}/xen/xend/Args.pyc +${PYSITELIB}/xen/xend/EventServer.pyc +${PYSITELIB}/xen/xend/EventTypes.pyc +${PYSITELIB}/xen/xend/XendDmesg.pyc +${PYSITELIB}/xen/xend/__init__.pyc +${PYSITELIB}/xen/xend/XendAsynchProtocol.pyc +${PYSITELIB}/xen/xend/encode.pyc +${PYSITELIB}/xen/xend/XendDB.pyc +${PYSITELIB}/xen/sv/MigrateDomain.py +${PYSITELIB}/xen/sv/GenTabbed.py +${PYSITELIB}/xen/sv/HTMLBase.py +${PYSITELIB}/xen/sv/CreateDomain.py +${PYSITELIB}/xen/sv/Wizard.py +${PYSITELIB}/xen/sv/Main.py +${PYSITELIB}/xen/sv/TabView.py +${PYSITELIB}/xen/sv/DomInfo.py +${PYSITELIB}/xen/sv/util.py +${PYSITELIB}/xen/sv/SaveDomain.py +${PYSITELIB}/xen/sv/Daemon.py +${PYSITELIB}/xen/sv/NodeInfo.py +${PYSITELIB}/xen/sv/__init__.py +${PYSITELIB}/xen/sv/RestoreDomain.py +${PYSITELIB}/xen/sv/DomList.py +${PYSITELIB}/xen/sv/params.py +${PYSITELIB}/xen/sv/MigrateDomain.pyc +${PYSITELIB}/xen/sv/GenTabbed.pyc +${PYSITELIB}/xen/sv/HTMLBase.pyc +${PYSITELIB}/xen/sv/CreateDomain.pyc +${PYSITELIB}/xen/sv/Wizard.pyc +${PYSITELIB}/xen/sv/Main.pyc +${PYSITELIB}/xen/sv/TabView.pyc +${PYSITELIB}/xen/sv/DomInfo.pyc +${PYSITELIB}/xen/sv/util.pyc +${PYSITELIB}/xen/sv/SaveDomain.pyc +${PYSITELIB}/xen/sv/Daemon.pyc +${PYSITELIB}/xen/sv/NodeInfo.pyc +${PYSITELIB}/xen/sv/__init__.pyc +${PYSITELIB}/xen/sv/RestoreDomain.pyc +${PYSITELIB}/xen/sv/DomList.pyc +${PYSITELIB}/xen/sv/params.pyc +${PYSITELIB}/xen/xm/migrate.py +${PYSITELIB}/xen/xm/create.py +${PYSITELIB}/xen/xm/sysrq.py +${PYSITELIB}/xen/xm/help.py +${PYSITELIB}/xen/xm/opts.py +${PYSITELIB}/xen/xm/destroy.py +${PYSITELIB}/xen/xm/__init__.py +${PYSITELIB}/xen/xm/shutdown.py +${PYSITELIB}/xen/xm/main.py +${PYSITELIB}/xen/xm/migrate.pyc +${PYSITELIB}/xen/xm/create.pyc +${PYSITELIB}/xen/xm/sysrq.pyc +${PYSITELIB}/xen/xm/help.pyc +${PYSITELIB}/xen/xm/opts.pyc +${PYSITELIB}/xen/xm/destroy.pyc +${PYSITELIB}/xen/xm/__init__.pyc +${PYSITELIB}/xen/xm/shutdown.pyc +${PYSITELIB}/xen/xm/main.pyc +${PYSITELIB}/xen/__init__.pyc + +@dirrm ${PYSITELIB}/xen/lowlevel +@dirrm ${PYSITELIB}/xen/util +@dirrm ${PYSITELIB}/xen/xend/server +@dirrm ${PYSITELIB}/xen/xend +@dirrm ${PYSITELIB}/xen/sv +@dirrm ${PYSITELIB}/xen/xm +@dirrm ${PYSITELIB}/xen diff --git a/sysutils/xentools20/distinfo b/sysutils/xentools20/distinfo new file mode 100644 index 00000000000..8edd608a6bf --- /dev/null +++ b/sysutils/xentools20/distinfo @@ -0,0 +1,21 @@ +$NetBSD: distinfo,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +SHA1 (xen-2.0.3-src.tgz) = eb71d43abd014c87062f5b93932947b71e32be54 +Size (xen-2.0.3-src.tgz) = 2158860 bytes +SHA1 (patch-aa) = c90169af9aac2724e7ab723e530e41441ec38243 +SHA1 (patch-ab) = d85923de2eacaa34657f2a196d2b3e6b3ec349f0 +SHA1 (patch-ac) = ec2ae94412d6d25a82935fe72d7a1cc2391ee86c +SHA1 (patch-ad) = 53f4439338f98013d33045faf9b055a39e862a78 +SHA1 (patch-ae) = 756e8675e8e42b3f104bdd34135cae60f117bb66 +SHA1 (patch-af) = d92a5d826ff70a24ea1d17bc971121205b1e9900 +SHA1 (patch-ag) = 30a49accf32647639ddc6e96817f88df1ba684f8 +SHA1 (patch-ah) = edb8532711f01bb8e1c89e07ae4275d88d036f13 +SHA1 (patch-ai) = 19586ece7682463eabc8d93fbc7276f5c637b155 +SHA1 (patch-aj) = 00d7a1ef99e6501e81c69e3518a6307f52742b8c +SHA1 (patch-ak) = 0bf9e57b9cb7c8a6afd1f8a8cb76334c08cdb645 +SHA1 (patch-al) = 4672aed893039a697a7e2a4da4b47a9d93f8844c +SHA1 (patch-am) = db53e3f8508d88992191788d17e2645ef20eb9a2 +SHA1 (patch-an) = 097907ffc9219fc9e0ab8920bbf55f8a8e228ca7 +SHA1 (patch-ao) = e0d556cd5d01581f2c1107a107579c4dc5fd3aec +SHA1 (patch-ap) = f2788a28ce597f7741195810f32516419c0cee0b +SHA1 (patch-aq) = 9635192daabab2d76252b662c01b1c0e9bce61da diff --git a/sysutils/xentools20/files/xenio.h b/sysutils/xentools20/files/xenio.h new file mode 100644 index 00000000000..688f2db8772 --- /dev/null +++ b/sysutils/xentools20/files/xenio.h @@ -0,0 +1,97 @@ +/****************************************************************************** + * privcmd.h + * + * Copyright (c) 2003-2004, K A Fraser + * + * This file may be distributed separately from the Linux kernel, or + * incorporated into other software packages, subject to the following license: + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this source file (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, modify, + * merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#ifndef __PRIVCMD_H__ +#define __PRIVCMD_H__ + +/* Interface to /proc/xen/privcmd */ + +typedef struct privcmd_hypercall +{ + unsigned long op; + unsigned long arg[5]; +} privcmd_hypercall_t; + +typedef struct privcmd_mmap_entry { + unsigned long va; + unsigned long mfn; + unsigned long npages; +} privcmd_mmap_entry_t; + +typedef struct privcmd_mmap { + int num; + domid_t dom; /* target domain */ + privcmd_mmap_entry_t *entry; +} privcmd_mmap_t; + +typedef struct privcmd_mmapbatch { + int num; /* number of pages to populate */ + domid_t dom; /* target domain */ + unsigned long addr; /* virtual address */ + unsigned long *arr; /* array of mfns - top nibble set on err */ +} privcmd_mmapbatch_t; + +typedef struct privcmd_blkmsg +{ + unsigned long op; + void *buf; + int buf_size; +} privcmd_blkmsg_t; + +/* + * @cmd: IOCTL_PRIVCMD_HYPERCALL + * @arg: &privcmd_hypercall_t + * Return: Value returned from execution of the specified hypercall. + */ +#define IOCTL_PRIVCMD_HYPERCALL \ + _IOWR('P', 0, privcmd_hypercall_t) + +/* + * @cmd: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN + * @arg: n/a + * Return: Port associated with domain-controller end of control event channel + * for the initial domain. + */ +#define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \ + _IO('P', 1) + +#define IOCTL_PRIVCMD_MMAP \ + _IOW('P', 2, privcmd_mmap_t) +#define IOCTL_PRIVCMD_MMAPBATCH \ + _IOW('P', 3, privcmd_mmapbatch_t) +#define IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN \ + _IOW('P', 4, unsigned long) + +/* Interface to /dev/xenevt */ +/* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */ +#define EVTCHN_RESET _IO('E', 1) +/* EVTCHN_BIND: Bind to the specified event-channel port. */ +#define EVTCHN_BIND _IOW('E', 2, unsigned long) +/* EVTCHN_UNBIND: Unbind from the specified event-channel port. */ +#define EVTCHN_UNBIND _IOW('E', 3, unsigned long) + +#endif /* __PRIVCMD_H__ */ diff --git a/sysutils/xentools20/patches/patch-aa b/sysutils/xentools20/patches/patch-aa new file mode 100644 index 00000000000..04648c83ef3 --- /dev/null +++ b/sysutils/xentools20/patches/patch-aa @@ -0,0 +1,28 @@ +$NetBSD: patch-aa,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- Makefile.orig 2005-01-12 13:22:26.000000000 +0100 ++++ Makefile 2005-01-22 01:09:07.000000000 +0100 +@@ -1,23 +1,16 @@ + + all: +- $(MAKE) -C check + $(MAKE) -C libxutil + $(MAKE) -C libxc + $(MAKE) -C misc + $(MAKE) -C examples +- $(MAKE) -C xentrace + $(MAKE) -C python + $(MAKE) -C xfrd + + install: +-ifneq ($(dist),yes) +- $(MAKE) -C check install +-endif + $(MAKE) -C libxutil install + $(MAKE) -C libxc install + $(MAKE) -C misc install +- $(MAKE) -C examples install +- $(MAKE) -C xentrace install + $(MAKE) -C python install + $(MAKE) -C xfrd install + $(MAKE) -C sv install diff --git a/sysutils/xentools20/patches/patch-ab b/sysutils/xentools20/patches/patch-ab new file mode 100644 index 00000000000..684942fcff6 --- /dev/null +++ b/sysutils/xentools20/patches/patch-ab @@ -0,0 +1,13 @@ +$NetBSD: patch-ab,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- libxc/xc_private.h.orig 2005-01-22 00:49:25.000000000 +0100 ++++ libxc/xc_private.h 2005-01-22 00:49:49.000000000 +0100 +@@ -16,7 +16,7 @@ + + #include "xc.h" + +-#include <xen/linux/privcmd.h> ++#include <xen/NetBSD/xenio.h> + + #define _PAGE_PRESENT 0x001 + #define _PAGE_RW 0x002 diff --git a/sysutils/xentools20/patches/patch-ac b/sysutils/xentools20/patches/patch-ac new file mode 100644 index 00000000000..bd85171c870 --- /dev/null +++ b/sysutils/xentools20/patches/patch-ac @@ -0,0 +1,108 @@ +$NetBSD: patch-ac,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- python/xen/lowlevel/xu/xu.c.orig 2005-01-12 13:22:21.000000000 +0100 ++++ python/xen/lowlevel/xu/xu.c 2005-02-05 20:22:08.000000000 +0100 +@@ -15,7 +15,6 @@ + #include <sys/socket.h> + #include <sys/mman.h> + #include <sys/poll.h> +-#include <sys/sysmacros.h> + #include <netinet/in.h> + #include <fcntl.h> + #include <unistd.h> +@@ -25,7 +24,7 @@ + + #include <xen/xen.h> + #include <xen/io/domain_controller.h> +-#include <xen/linux/privcmd.h> ++#include <xen/NetBSD/xenio.h> + + #define XENPKG "xen.lowlevel.xu" + +@@ -35,6 +34,9 @@ + #endif + + /* NB. The following should be kept in sync with the kernel's evtchn driver. */ ++#ifdef __NetBSD__ ++#define EVTCHN_DEV_NAME "/dev/xenevt" ++#else + #define EVTCHN_DEV_NAME "/dev/xen/evtchn" + #define EVTCHN_DEV_MAJOR 10 + #define EVTCHN_DEV_MINOR 201 +@@ -45,6 +47,7 @@ + #define EVTCHN_BIND _IO('E', 2) + /* EVTCHN_UNBIND: Unbind from the specified event-channel port. */ + #define EVTCHN_UNBIND _IO('E', 3) ++#endif + + /* Size of a machine page frame. */ + #define PAGE_SIZE 4096 +@@ -130,7 +133,11 @@ + if ( !PyArg_ParseTuple(args, "i", &idx) ) + return NULL; + ++#ifdef __NetBSD__ ++ if ( ioctl(xun->evtchn_fd, EVTCHN_BIND, &idx) != 0 ) ++#else + if ( ioctl(xun->evtchn_fd, EVTCHN_BIND, idx) != 0 ) ++#endif + return PyErr_SetFromErrno(PyExc_IOError); + + Py_INCREF(Py_None); +@@ -145,7 +152,11 @@ + if ( !PyArg_ParseTuple(args, "i", &idx) ) + return NULL; + ++#ifdef __NetBSD__ ++ if ( ioctl(xun->evtchn_fd, EVTCHN_UNBIND, &idx) != 0 ) ++#else + if ( ioctl(xun->evtchn_fd, EVTCHN_UNBIND, idx) != 0 ) ++#endif + return PyErr_SetFromErrno(PyExc_IOError); + + Py_INCREF(Py_None); +@@ -192,13 +203,16 @@ + static PyObject *xu_notifier_new(PyObject *self, PyObject *args) + { + xu_notifier_object *xun; ++#ifndef __NetBSD__ + struct stat st; ++#endif + + if ( !PyArg_ParseTuple(args, "") ) + return NULL; + + xun = PyObject_New(xu_notifier_object, &xu_notifier_type); + ++#ifndef __NetBSD__ + /* Make sure any existing device file links to correct device. */ + if ( (lstat(EVTCHN_DEV_NAME, &st) != 0) || + !S_ISCHR(st.st_mode) || +@@ -206,14 +220,17 @@ + (void)unlink(EVTCHN_DEV_NAME); + + reopen: ++#endif + xun->evtchn_fd = open(EVTCHN_DEV_NAME, O_NONBLOCK|O_RDWR); + if ( xun->evtchn_fd == -1 ) + { ++#ifndef __NetBSD__ + if ( (errno == ENOENT) && + ((mkdir("/dev/xen", 0755) == 0) || (errno == EEXIST)) && + (mknod(EVTCHN_DEV_NAME, S_IFCHR|0600, + makedev(EVTCHN_DEV_MAJOR,EVTCHN_DEV_MINOR)) == 0) ) + goto reopen; ++#endif + PyObject_Del((PyObject *)xun); + return PyErr_SetFromErrno(PyExc_IOError); + } +@@ -1083,7 +1100,8 @@ + * The control-interface event channel for DOM0 is already set up. + * We use an ioctl to discover the port at our end of the channel. + */ +- port1 = ioctl(xup->xc_handle, IOCTL_PRIVCMD_INITDOMAIN_EVTCHN, NULL); ++ (void)ioctl(xup->xc_handle, IOCTL_PRIVCMD_INITDOMAIN_EVTCHN, NULL); ++ port1 = errno; + port2 = -1; /* We don't need the remote end of the DOM0 link. */ + if ( port1 < 0 ) + { diff --git a/sysutils/xentools20/patches/patch-ad b/sysutils/xentools20/patches/patch-ad new file mode 100644 index 00000000000..50419193899 --- /dev/null +++ b/sysutils/xentools20/patches/patch-ad @@ -0,0 +1,22 @@ +$NetBSD: patch-ad,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- xfrd/Makefile.orig 2005-01-12 13:22:27.000000000 +0100 ++++ xfrd/Makefile 2005-01-22 18:44:53.000000000 +0100 +@@ -7,7 +7,7 @@ + XEN_ROOT = ../.. + include $(XEN_ROOT)/tools/Make.defs + +-XFRD_INSTALL_DIR = /usr/sbin ++XFRD_INSTALL_DIR = ${PREFIX}/sbin + + vpath %.h $(XEN_LIBXC) + INCLUDES += -I $(XEN_LIBXC) +@@ -48,7 +48,7 @@ + XFRD_LIBS := + + XFRD_LIBS += -L $(XEN_LIBXC) -lxc +-XFRD_LIBS += -L $(XEN_LIBXUTIL) -lxutil ++XFRD_LIBS += -L $(XEN_LIBXUTIL) $(LDFLAGS) -lxutil + + # zlib library. + XFRD_LIBS += -lz diff --git a/sysutils/xentools20/patches/patch-ae b/sysutils/xentools20/patches/patch-ae new file mode 100644 index 00000000000..b36031cb82c --- /dev/null +++ b/sysutils/xentools20/patches/patch-ae @@ -0,0 +1,15 @@ +$NetBSD: patch-ae,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- xfrd/xfrd.c.orig 2005-01-22 01:24:53.000000000 +0100 ++++ xfrd/xfrd.c 2005-01-22 01:25:08.000000000 +0100 +@@ -1229,8 +1229,8 @@ + + #ifndef DEBUG + freopen(LOGFILE, "w+", stdout); +- fclose(stderr); +- stderr = stdout; ++ close(2); ++ dup2(1,2); + #endif + dprintf(">\n"); + set_defaults(args); diff --git a/sysutils/xentools20/patches/patch-af b/sysutils/xentools20/patches/patch-af new file mode 100644 index 00000000000..0cf8b8a2a9b --- /dev/null +++ b/sysutils/xentools20/patches/patch-af @@ -0,0 +1,12 @@ +$NetBSD: patch-af,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- xfrd/select.c.orig 2005-01-22 01:28:18.000000000 +0100 ++++ xfrd/select.c 2005-01-22 01:29:02.000000000 +0100 +@@ -1,6 +1,7 @@ + #include <stdlib.h> + #include <errno.h> + #include <unistd.h> ++#include <string.h> + + #include "select.h" + diff --git a/sysutils/xentools20/patches/patch-ag b/sysutils/xentools20/patches/patch-ag new file mode 100644 index 00000000000..0cf03a7eee8 --- /dev/null +++ b/sysutils/xentools20/patches/patch-ag @@ -0,0 +1,25 @@ +$NetBSD: patch-ag,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- misc/Makefile.orig 2005-01-12 13:22:25.000000000 +0100 ++++ misc/Makefile 2005-01-22 18:44:36.000000000 +0100 +@@ -20,10 +20,10 @@ + $(MAKE) -C miniterm + + install: all +- mkdir -p $(prefix)/usr/bin +- mkdir -p $(prefix)/usr/sbin +- install -m0755 $(INSTALL_BIN) $(prefix)/usr/bin +- install -m0755 $(INSTALL_SBIN) $(prefix)/usr/sbin ++ mkdir -p $(prefix)/${PREFIX}/bin ++ mkdir -p $(prefix)/${PREFIX}/sbin ++ install -m0755 $(INSTALL_BIN) $(prefix)/${PREFIX}/bin ++ install -m0755 $(INSTALL_SBIN) $(prefix)/${PREFIX}/sbin + $(MAKE) -C miniterm install + + clean: +@@ -31,4 +31,4 @@ + $(MAKE) -C miniterm clean + + %: %.c $(HDRS) Makefile +- $(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxc -L$(XEN_LIBXUTIL) -lxutil ++ $(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -lxc -L$(XEN_LIBXUTIL) $(LDFLAGS) -lxutil diff --git a/sysutils/xentools20/patches/patch-ah b/sysutils/xentools20/patches/patch-ah new file mode 100644 index 00000000000..43d3ce7d966 --- /dev/null +++ b/sysutils/xentools20/patches/patch-ah @@ -0,0 +1,27 @@ +$NetBSD: patch-ah,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- xentrace/Makefile.orig 2005-01-12 13:22:22.000000000 +0100 ++++ xentrace/Makefile 2005-01-22 18:44:45.000000000 +0100 +@@ -20,15 +20,15 @@ + all: $(BIN) + + install: all +- mkdir -p $(prefix)/usr/bin +- mkdir -p $(prefix)/usr/man/man1 +- mkdir -p $(prefix)/usr/man/man8 +- install -m0755 $(BIN) $(SCRIPTS) $(prefix)/usr/bin +- install -m0644 $(MAN1) $(prefix)/usr/man/man1 +- install -m0644 $(MAN8) $(prefix)/usr/man/man8 ++ mkdir -p $(prefix)/${PREFIX}/bin ++ mkdir -p $(prefix)/${PREFIX}/man/man1 ++ mkdir -p $(prefix)/${PREFIX}/man/man8 ++ install -m0755 $(BIN) $(SCRIPTS) $(prefix)/${PREFIX}/bin ++ install -m0644 $(MAN1) $(prefix)/${PREFIX}/man/man1 ++ install -m0644 $(MAN8) $(prefix)/${PREFIX}/man/man8 + + clean: + $(RM) *.a *.so *.o *.rpm $(BIN) + + %: %.c $(HDRS) Makefile +- $(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -lxc -lxutil ++ $(CC) $(CFLAGS) -o $@ $< -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -lxc $(LDFLAGS) -lxutil diff --git a/sysutils/xentools20/patches/patch-ai b/sysutils/xentools20/patches/patch-ai new file mode 100644 index 00000000000..39be47b490c --- /dev/null +++ b/sysutils/xentools20/patches/patch-ai @@ -0,0 +1,31 @@ +$NetBSD: patch-ai,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- libxc/Makefile.orig 2005-01-22 18:44:30.000000000 +0100 ++++ libxc/Makefile 2005-01-22 18:44:15.000000000 +0100 +@@ -62,12 +62,12 @@ + ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . ) + + install: all +- mkdir -p $(prefix)/usr/lib +- mkdir -p $(prefix)/usr/include +- install -m0755 $(LIB) $(prefix)/usr/lib +- ln -sf libxc.so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/libxc.so.$(MAJOR) +- ln -sf libxc.so.$(MAJOR) $(prefix)/usr/lib/libxc.so +- install -m0644 xc.h $(prefix)/usr/include ++ mkdir -p $(prefix)/${PREFIX}/lib ++ mkdir -p $(prefix)/${PREFIX}/include ++ install -m0755 $(LIB) $(prefix)/${PREFIX}/lib ++ ln -sf libxc.so.$(MAJOR).$(MINOR) $(prefix)/${PREFIX}/lib/libxc.so.$(MAJOR) ++ ln -sf libxc.so.$(MAJOR) $(prefix)/${PREFIX}/lib/libxc.so ++ install -m0644 xc.h $(prefix)/${PREFIX}/include + + clean: + rm -rf *.a *.so *.o *.rpm $(LIB) *~ $(DEPS) xen +@@ -86,6 +86,6 @@ + libxc.so.$(MAJOR): + ln -sf libxc.so.$(MAJOR).$(MINOR) $@ + libxc.so.$(MAJOR).$(MINOR): $(OBJS) +- $(CC) -Wl,-soname -Wl,$(SONAME) -shared -o $@ $^ -L../libxutil -lxutil -lz ++ $(CC) -Wl,-soname -Wl,$(SONAME) -shared -o $@ $^ -L../libxutil $(LDFLAGS) -lxutil -lz + + -include $(DEPS) diff --git a/sysutils/xentools20/patches/patch-aj b/sysutils/xentools20/patches/patch-aj new file mode 100644 index 00000000000..5bf95910f8c --- /dev/null +++ b/sysutils/xentools20/patches/patch-aj @@ -0,0 +1,19 @@ +$NetBSD: patch-aj,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- libxutil/Makefile.orig 2005-01-22 01:45:45.000000000 +0100 ++++ libxutil/Makefile 2005-01-22 01:45:50.000000000 +0100 +@@ -62,10 +62,10 @@ + fi + + install: all +- mkdir -p $(prefix)/usr/lib +- install -m0755 $(LIB) $(prefix)/usr/lib +- ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/$(LIB_NAME).so.$(MAJOR) +- ln -sf $(LIB_NAME).so.$(MAJOR) $(prefix)/usr/lib/$(LIB_NAME).so ++ mkdir -p $(prefix)/${PREFIX}/lib ++ install -m0755 $(LIB) $(prefix)/${PREFIX}/lib ++ ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(prefix)/${PREFIX}/lib/$(LIB_NAME).so.$(MAJOR) ++ ln -sf $(LIB_NAME).so.$(MAJOR) $(prefix)/${PREFIX}/lib/$(LIB_NAME).so + + clean: + $(RM) *.a *.so *.so.* *.o *.rpm diff --git a/sysutils/xentools20/patches/patch-ak b/sysutils/xentools20/patches/patch-ak new file mode 100644 index 00000000000..08b028184a1 --- /dev/null +++ b/sysutils/xentools20/patches/patch-ak @@ -0,0 +1,15 @@ +$NetBSD: patch-ak,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- misc/miniterm/Makefile.orig 2005-01-22 01:47:40.000000000 +0100 ++++ misc/miniterm/Makefile 2005-01-22 01:48:00.000000000 +0100 +@@ -6,8 +6,8 @@ + all: $(TARGET) + + install: all +- mkdir -p $(prefix)/usr/bin +- install -m0755 $(TARGET) $(prefix)/usr/bin ++ mkdir -p $(prefix)/${PREFIX}/bin ++ install -m0755 $(TARGET) $(prefix)/${PREFIX}/bin + + clean: + $(RM) *.o $(TARGET) *~ diff --git a/sysutils/xentools20/patches/patch-al b/sysutils/xentools20/patches/patch-al new file mode 100644 index 00000000000..e4508e0a950 --- /dev/null +++ b/sysutils/xentools20/patches/patch-al @@ -0,0 +1,23 @@ +$NetBSD: patch-al,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- python/Makefile.orig 2005-01-22 01:21:14.000000000 +0100 ++++ python/Makefile 2005-01-22 01:51:09.000000000 +0100 +@@ -1,14 +1,14 @@ + + all: +- python setup.py build ++ $(PYTHON) setup.py build + + install: all + if [ "$(prefix)" = "" ]; then \ +- python setup.py install; \ ++ $(PYTHON) setup.py install; \ + elif [ "$(dist)" = "yes" ]; then \ +- python setup.py install --home="$(prefix)"; \ ++ $(PYTHON) setup.py install --home="$(prefix)"; \ + else \ +- python setup.py install --root="$(prefix)"; \ ++ $(PYTHON) setup.py install --root="$(prefix)"; \ + fi + + clean: diff --git a/sysutils/xentools20/patches/patch-am b/sysutils/xentools20/patches/patch-am new file mode 100644 index 00000000000..d5b3e7e86cb --- /dev/null +++ b/sysutils/xentools20/patches/patch-am @@ -0,0 +1,10 @@ +$NetBSD: patch-am,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- x2d2/Makefile.orig 2005-01-22 18:45:34.000000000 +0100 ++++ x2d2/Makefile 2005-01-22 18:45:09.000000000 +0100 +@@ -19,4 +19,4 @@ + $(RM) *.a *.so *.o *.rpm $(BIN) + + $(BIN): $(OBJS) +- $(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) -lxc -lxutil -lpthread ++ $(CC) $(CFLAGS) $^ -o $@ -L$(XEN_LIBXC) -L$(XEN_LIBXUTIL) $(LDFLAGS) -lxc -lxutil -lpthread diff --git a/sysutils/xentools20/patches/patch-an b/sysutils/xentools20/patches/patch-an new file mode 100644 index 00000000000..ed81a0ef6da --- /dev/null +++ b/sysutils/xentools20/patches/patch-an @@ -0,0 +1,13 @@ +$NetBSD: patch-an,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- python/xen/xend/XendVnet.py.orig 2005-01-24 10:25:27.000000000 +0100 ++++ python/xen/xend/XendVnet.py 2005-01-24 10:26:50.000000000 +0100 +@@ -14,7 +14,7 @@ + out = None + try: + try: +- out = file("/proc/vnet/policy", "wb") ++ out = file("/kern/vnet/policy", "wb") + sxp.show(cmd, out) + except IOError, ex: + raise XendError(str(ex)) diff --git a/sysutils/xentools20/patches/patch-ao b/sysutils/xentools20/patches/patch-ao new file mode 100644 index 00000000000..c6e3d4ebde5 --- /dev/null +++ b/sysutils/xentools20/patches/patch-ao @@ -0,0 +1,13 @@ +$NetBSD: patch-ao,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- libxc/xc_misc.c.orig 2005-01-24 10:25:41.000000000 +0100 ++++ libxc/xc_misc.c 2005-01-24 10:30:18.000000000 +0100 +@@ -8,7 +8,7 @@ + + int xc_interface_open(void) + { +- int fd = open("/proc/xen/privcmd", O_RDWR); ++ int fd = open("/kern/xen/privcmd", O_RDWR); + if ( fd == -1 ) + PERROR("Could not obtain handle on privileged command interface"); + return fd; diff --git a/sysutils/xentools20/patches/patch-ap b/sysutils/xentools20/patches/patch-ap new file mode 100644 index 00000000000..3f0f66a29d1 --- /dev/null +++ b/sysutils/xentools20/patches/patch-ap @@ -0,0 +1,21 @@ +$NetBSD: patch-ap,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- xentrace/xentrace.c.orig 2005-01-24 10:25:49.000000000 +0100 ++++ xentrace/xentrace.c 2005-01-24 10:30:32.000000000 +0100 +@@ -123,14 +123,14 @@ + struct t_buf *map_tbufs(unsigned long tbufs_mach, unsigned int num, + unsigned long size) + { +- int xc_handle; /* file descriptor for /proc/xen/privcmd */ ++ int xc_handle; /* file descriptor for /kern/xen/privcmd */ + struct t_buf *tbufs_mapped; + + xc_handle = xc_interface_open(); + + if ( xc_handle < 0 ) + { +- PERROR("Open /proc/xen/privcmd when mapping trace buffers\n"); ++ PERROR("Open /kern/xen/privcmd when mapping trace buffers\n"); + exit(EXIT_FAILURE); + } + diff --git a/sysutils/xentools20/patches/patch-aq b/sysutils/xentools20/patches/patch-aq new file mode 100644 index 00000000000..a4f4178a612 --- /dev/null +++ b/sysutils/xentools20/patches/patch-aq @@ -0,0 +1,21 @@ +$NetBSD: patch-aq,v 1.1.1.1 2005/03/07 15:59:08 bouyer Exp $ + +--- x2d2/minixend.c.orig 2005-01-31 14:45:08.000000000 +0100 ++++ x2d2/minixend.c 2005-01-31 14:46:00.000000000 +0100 +@@ -913,10 +913,15 @@ + xc_handle = xc_interface_open(); + + listen_fd = start_listening(); +- ++#ifdef __NetBSD__ ++ evtchn_fd = open("/dev/xenevt", O_RDWR); ++ if (evtchn_fd < 0) ++ err(1, "openning /dev/xenevt"); ++#else + evtchn_fd = open("/dev/xen/evtchn", O_RDWR); + if (evtchn_fd < 0) + err(1, "openning /dev/xen/evtchn"); ++#endif + + dom0 = find_dom0(); + |