summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Kuznetsov <vadimk@gentoo.org>2011-03-24 14:38:02 +0000
committerVadim Kuznetsov <vadimk@gentoo.org>2011-03-24 14:38:02 +0000
commitc07b0c0217fef5ad392e8983b51108f7466458ed (patch)
tree54f3f4d3048b67a343390cdcf1ecca1e4104aae6 /app-emulation/vmware-modules
parentdeleted old version. QA fixes. (diff)
downloadvmware-c07b0c0217fef5ad392e8983b51108f7466458ed.tar.gz
vmware-c07b0c0217fef5ad392e8983b51108f7466458ed.tar.bz2
vmware-c07b0c0217fef5ad392e8983b51108f7466458ed.zip
vmware server 2 modules
svn path=/trunk/; revision=462
Diffstat (limited to 'app-emulation/vmware-modules')
-rw-r--r--app-emulation/vmware-modules/files/208-sema.patch83
-rw-r--r--app-emulation/vmware-modules/files/208-sk_sleep.patch74
-rw-r--r--app-emulation/vmware-modules/files/208-unlocked_ioctl.patch33
-rw-r--r--app-emulation/vmware-modules/vmware-modules-208.2.ebuild73
4 files changed, 263 insertions, 0 deletions
diff --git a/app-emulation/vmware-modules/files/208-sema.patch b/app-emulation/vmware-modules/files/208-sema.patch
new file mode 100644
index 0000000..1ebdab7
--- /dev/null
+++ b/app-emulation/vmware-modules/files/208-sema.patch
@@ -0,0 +1,83 @@
+diff -ru original//vmci-only/include/compat_semaphore.h patched//vmci-only/include/compat_semaphore.h
+--- original//vmci-only/include/compat_semaphore.h 2010-11-11 15:37:25.000000000 -0500
++++ patched//vmci-only/include/compat_semaphore.h 2010-11-20 10:11:56.000000000 -0500
+@@ -28,7 +28,7 @@
+ #endif
+
+
+-#if defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
++#if (defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+ /*
+ * The -rt patch series changes the name of semaphore/mutex initialization
+ * routines (across the entire kernel). Probably to identify locations that
+@@ -41,7 +41,7 @@
+ #define DECLARE_MUTEX(_m) DEFINE_SEMAPHORE(_m)
+ #endif
+ #ifndef init_MUTEX
+- #define init_MUTEX(_m) semaphore_init(_m)
++ #define init_MUTEX(_m) sema_init(_m,1)
+ #endif
+ #endif
+
+diff -ru original//vmmon-only/linux/driver.c patched//vmmon-only/linux/driver.c
+--- original//vmmon-only/linux/driver.c 2010-11-11 15:37:22.000000000 -0500
++++ patched//vmmon-only/linux/driver.c 2010-11-29 23:09:16.000000000 -0500
+@@ -145,7 +145,7 @@
+ #endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && \
+ (defined(CONFIG_SMP) || defined(CONFIG_PREEMPT))
+-# define kernel_locked_by_current() kernel_locked()
++# define kernel_locked_by_current() (current->lock_depth >= 0)
+ #else
+ # define kernel_locked_by_current() 0
+ #endif
+@@ -170,6 +170,7 @@
+ static int LinuxDriver_Ioctl(struct inode *inode, struct file *filp,
+ u_int iocmd, unsigned long ioarg);
+ #if defined(HAVE_UNLOCKED_IOCTL) || defined(HAVE_COMPAT_IOCTL)
++#define VMW_HAVE_UNLOCKED_IOCTL
+ static long LinuxDriver_UnlockedIoctl(struct file *filp,
+ u_int iocmd, unsigned long ioarg);
+ #endif
+diff -ru original//vmnet-only/compat_semaphore.h patched//vmnet-only/compat_semaphore.h
+--- original//vmnet-only/compat_semaphore.h 2010-11-11 15:37:23.000000000 -0500
++++ patched//vmnet-only/compat_semaphore.h 2010-11-20 10:11:56.000000000 -0500
+@@ -28,7 +28,7 @@
+ #endif
+
+
+-#if defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
++#if (defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+ /*
+ * The -rt patch series changes the name of semaphore/mutex initialization
+ * routines (across the entire kernel). Probably to identify locations that
+@@ -41,7 +41,7 @@
+ #define DECLARE_MUTEX(_m) DEFINE_SEMAPHORE(_m)
+ #endif
+ #ifndef init_MUTEX
+- #define init_MUTEX(_m) semaphore_init(_m)
++ #define init_MUTEX(_m) sema_init(_m,1)
+ #endif
+ #endif
+
+diff -ru original//vsock-only/shared/compat_semaphore.h patched//vsock-only/shared/compat_semaphore.h
+--- original//vsock-only/shared/compat_semaphore.h 2010-11-11 13:04:44.000000000 -0500
++++ patched//vsock-only/shared/compat_semaphore.h 2010-11-20 10:11:56.000000000 -0500
+@@ -28,7 +28,7 @@
+ #endif
+
+
+-#if defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)
++#if (defined CONFIG_PREEMPT_RT && LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 31)) || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
+ /*
+ * The -rt patch series changes the name of semaphore/mutex initialization
+ * routines (across the entire kernel). Probably to identify locations that
+@@ -41,7 +41,7 @@
+ #define DECLARE_MUTEX(_m) DEFINE_SEMAPHORE(_m)
+ #endif
+ #ifndef init_MUTEX
+- #define init_MUTEX(_m) semaphore_init(_m)
++ #define init_MUTEX(_m) sema_init(_m,1)
+ #endif
+ #endif
+
diff --git a/app-emulation/vmware-modules/files/208-sk_sleep.patch b/app-emulation/vmware-modules/files/208-sk_sleep.patch
new file mode 100644
index 0000000..d92dd7c
--- /dev/null
+++ b/app-emulation/vmware-modules/files/208-sk_sleep.patch
@@ -0,0 +1,74 @@
+diff --git a/vsock-only/linux/af_vsock.c b/vsock-only/linux/af_vsock.c
+index 314e5fb..bd69539 100644
+--- a/vsock-only/linux/af_vsock.c
++++ b/vsock-only/linux/af_vsock.c
+@@ -3150,5 +3150,5 @@ VSockVmciStreamConnect(struct socket *sock, // IN
+ */
+ timeout = sock_sndtimeo(sk, flags & O_NONBLOCK);
+- compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
++ compat_init_prepare_to_wait(compat_sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+
+ while (sk->compat_sk_state != SS_CONNECTED && sk->compat_sk_err == 0) {
+@@ -3173,5 +3173,5 @@ VSockVmciStreamConnect(struct socket *sock, // IN
+ }
+
+- compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
++ compat_cont_prepare_to_wait(compat_sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+ }
+
+@@ -3185,5 +3185,5 @@ VSockVmciStreamConnect(struct socket *sock, // IN
+
+ outWait:
+- compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING);
++ compat_finish_wait(compat_sk_sleep(sk), &wait, TASK_RUNNING);
+ out:
+ release_sock(sk);
+@@ -3392,5 +3392,5 @@ VSockVmciPoll(struct file *file, // IN
+ sk = sock->sk;
+
+- poll_wait(file, sk->compat_sk_sleep, wait);
++ poll_wait(file, compat_sk_sleep(sk), wait);
+ mask = 0;
+
+@@ -3993,5 +3993,5 @@ VSockVmciStreamSendmsg(struct kiocb *kiocb, // UNUSED
+ */
+ timeout = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
+- compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
++ compat_init_prepare_to_wait(compat_sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+
+ while (totalWritten < len) {
+@@ -4032,5 +4032,5 @@ VSockVmciStreamSendmsg(struct kiocb *kiocb, // UNUSED
+ }
+
+- compat_cont_prepare_to_wait(sk->compat_sk_sleep,
++ compat_cont_prepare_to_wait(compat_sk_sleep(sk),
+ &wait, TASK_INTERRUPTIBLE);
+ }
+@@ -4115,5 +4115,5 @@ outWait:
+ err = totalWritten;
+ }
+- compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING);
++ compat_finish_wait(compat_sk_sleep(sk), &wait, TASK_RUNNING);
+ out:
+ release_sock(sk);
+@@ -4338,5 +4338,5 @@ VSockVmciStreamRecvmsg(struct kiocb *kiocb, // UNUSED
+ copied = 0;
+
+- compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
++ compat_init_prepare_to_wait(compat_sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+
+ while ((ready = VMCIQueue_BufReady(vsk->consumeQ,
+@@ -4381,5 +4381,5 @@ VSockVmciStreamRecvmsg(struct kiocb *kiocb, // UNUSED
+ }
+
+- compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
++ compat_cont_prepare_to_wait(compat_sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+ }
+
+@@ -4473,5 +4473,5 @@ VSockVmciStreamRecvmsg(struct kiocb *kiocb, // UNUSED
+
+ outWait:
+- compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING);
++ compat_finish_wait(compat_sk_sleep(sk), &wait, TASK_RUNNING);
+ out:
+ release_sock(sk);
diff --git a/app-emulation/vmware-modules/files/208-unlocked_ioctl.patch b/app-emulation/vmware-modules/files/208-unlocked_ioctl.patch
new file mode 100644
index 0000000..62ae5e8
--- /dev/null
+++ b/app-emulation/vmware-modules/files/208-unlocked_ioctl.patch
@@ -0,0 +1,33 @@
+diff --git a/vmmon-only/linux/driver.c b/vmmon-only/linux/driver.c
+index bf93446..022e856 100644
+--- a/vmmon-only/linux/driver.c
++++ b/vmmon-only/linux/driver.c
+@@ -169,6 +169,7 @@ static int LinuxDriver_Open(struct inode *inode, struct file *filp);
+ static int LinuxDriver_Ioctl(struct inode *inode, struct file *filp,
+ u_int iocmd, unsigned long ioarg);
+ #if defined(HAVE_UNLOCKED_IOCTL) || defined(HAVE_COMPAT_IOCTL)
++#define VMW_HAVE_UNLOCKED_IOCTL
+ static long LinuxDriver_UnlockedIoctl(struct file *filp,
+ u_int iocmd, unsigned long ioarg);
+ #endif
+diff --git a/vmmon-only/linux/hostif.c b/vmmon-only/linux/hostif.c
+index 8104878..02bb71c 100644
+--- a/vmmon-only/linux/hostif.c
++++ b/vmmon-only/linux/hostif.c
+@@ -3411,7 +3411,7 @@ HostIFDoIoctl(struct file *filp,
+ if (filp->f_op->unlocked_ioctl) {
+ return filp->f_op->unlocked_ioctl(filp, iocmd, ioarg);
+ }
+-#endif
++#else
+ if (filp->f_op->ioctl) {
+ long err;
+
+@@ -3420,6 +3420,7 @@ HostIFDoIoctl(struct file *filp,
+ unlock_kernel();
+ return err;
+ }
++#endif
+ return -ENOIOCTLCMD;
+ }
+
diff --git a/app-emulation/vmware-modules/vmware-modules-208.2.ebuild b/app-emulation/vmware-modules/vmware-modules-208.2.ebuild
new file mode 100644
index 0000000..fe615e3
--- /dev/null
+++ b/app-emulation/vmware-modules/vmware-modules-208.2.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/vmware-modules/vmware-modules-1.0.0.24-r3.ebuild,v 1.2 2011/03/16 17:36:57 vadimk Exp $
+
+EAPI="2"
+
+inherit eutils flag-o-matic linux-mod versionator
+
+PV_MAJOR=$(get_major_version)
+PV_MINOR=$(get_version_component_range 2)
+
+DESCRIPTION="VMware kernel modules"
+HOMEPAGE="http://www.vmware.com/"
+
+SRC_URI="mirror://gentoo/${P}.patch.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ =app-emulation/vmware-server-2.0.${PV_MINOR}*"
+
+S="${WORKDIR}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ VMWARE_VER="VME_V65" # THIS VALUE IS JUST A PLACE HOLDER
+ VMWARE_GROUP=${VMWARE_GROUP:-vmware}
+
+ VMWARE_MODULE_LIST="vmci vmmon vmnet vsock"
+ VMWARE_MOD_DIR="${PN}-${PVR}"
+
+ BUILD_TARGETS="auto-build VMWARE_VER=${VMWARE_VER} KERNEL_DIR=${KERNEL_DIR} KBUILD_OUTPUT=${KV_OUT_DIR}"
+
+ enewgroup "${VMWARE_GROUP}"
+ filter-flags -mfpmath=sse
+
+ for mod in ${VMWARE_MODULE_LIST}; do
+ MODULE_NAMES="${MODULE_NAMES} ${mod}(misc:${S}/${mod}-only)"
+ done
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ for mod in ${VMWARE_MODULE_LIST}; do
+ tar -xf /opt/vmware/server/lib/modules/source/${mod}.tar
+ done
+
+}
+
+src_prepare() {
+ epatch "${S}/${P}.patch"
+ kernel_is ge 2 6 35 && epatch "${FILESDIR}/${PV_MAJOR}-sk_sleep.patch"
+ kernel_is ge 2 6 36 && epatch "${FILESDIR}/${PV_MAJOR}-unlocked_ioctl.patch"
+ kernel_is ge 2 6 37 && epatch "${FILESDIR}/${PV_MAJOR}-sema.patch"
+}
+
+src_install() {
+ linux-mod_src_install
+ local udevrules="${T}/60-vmware.rules"
+ cat > "${udevrules}" <<-EOF
+ KERNEL=="vmci", GROUP="$VMWARE_GROUP", MODE=660
+ KERNEL=="vmmon", GROUP="$VMWARE_GROUP", MODE=660
+ KERNEL=="vsock", GROUP="$VMWARE_GROUP", MODE=660
+ EOF
+ insinto /etc/udev/rules.d/
+ doins "${udevrules}"
+}