diff options
author | Evan Teran <evan.teran@gmail.com> | 2016-03-18 21:32:19 +0100 |
---|---|---|
committer | Andreas K. Huettel <dilfridge@gentoo.org> | 2016-03-18 21:35:59 +0100 |
commit | ba0cdb922e11e38f4f493bd7774315928d69d6b6 (patch) | |
tree | e0b8872d79a2ce7ed605cbf740e49ae1238b3766 /app-emulation | |
parent | app-backup/kfoldersync: New package (diff) | |
download | gentoo-ba0cdb922e11e38f4f493bd7774315928d69d6b6.tar.gz gentoo-ba0cdb922e11e38f4f493bd7774315928d69d6b6.tar.bz2 gentoo-ba0cdb922e11e38f4f493bd7774315928d69d6b6.zip |
app-emulation/vmware-modules: Version bump, add patches up to Kernel 4.5
Imported from vmware overlay
Diffstat (limited to 'app-emulation')
7 files changed, 369 insertions, 0 deletions
diff --git a/app-emulation/vmware-modules/files/304-4.2-00-inode_op.patch b/app-emulation/vmware-modules/files/304-4.2-00-inode_op.patch new file mode 100644 index 000000000000..e6f2acbbb6a0 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-4.2-00-inode_op.patch @@ -0,0 +1,45 @@ +diff -rupN vmblock-only/linux/inode.c vmblock-only.new/linux/inode.c +--- vmblock-only/linux/inode.c 2016-03-16 21:24:25.771034759 -0400 ++++ vmblock-only.new/linux/inode.c 2016-03-16 21:26:22.697036311 -0400 +@@ -44,7 +44,9 @@ static struct dentry *InodeOpLookup(stru + static int InodeOpReadlink(struct dentry *, char __user *, int); + #endif + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++static const char *InodeOpFollowlink(struct dentry *dentry, void **cookie); ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) + static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd); + #else + static int InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd); +@@ -220,7 +222,9 @@ InodeOpReadlink(struct dentry *dentry, + * + *---------------------------------------------------------------------------- + */ +- ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++static const char *InodeOpFollowlink(struct dentry *dentry, void **cookie) ++#else + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) + static void * + #else +@@ -228,6 +232,7 @@ static int + #endif + InodeOpFollowlink(struct dentry *dentry, // IN : dentry of symlink + struct nameidata *nd) // OUT: stores result ++#endif + { + int ret; + VMBlockInodeInfo *iinfo; +@@ -244,7 +249,11 @@ InodeOpFollowlink(struct dentry *dentry, + goto out; + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++ return *cookie = (char *)(iinfo->name); ++#else + nd_set_link(nd, iinfo->name); ++#endif + + out: + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) diff --git a/app-emulation/vmware-modules/files/304-4.2-01-vmci_vmalloc.patch b/app-emulation/vmware-modules/files/304-4.2-01-vmci_vmalloc.patch new file mode 100644 index 000000000000..2296c060bff1 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-4.2-01-vmci_vmalloc.patch @@ -0,0 +1,13 @@ +diff -rupN vmci-only/linux/driver.c vmci-only.new/linux/driver.c +--- vmci-only/linux/driver.c 2015-11-03 19:27:55.000000000 -0500 ++++ vmci-only.new/linux/driver.c 2016-03-16 21:30:47.646039829 -0400 +@@ -26,6 +26,9 @@ + + #include <linux/file.h> + #include <linux/fs.h> ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++#include <linux/vmalloc.h> ++#endif + #include <linux/init.h> + #if defined(__x86_64__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) + # include <linux/ioctl32.h> diff --git a/app-emulation/vmware-modules/files/304-4.2-02-vsock.patch b/app-emulation/vmware-modules/files/304-4.2-02-vsock.patch new file mode 100644 index 000000000000..bdac109e6c60 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-4.2-02-vsock.patch @@ -0,0 +1,77 @@ +diff -rupN vsock-only/linux/af_vsock.c vsock-only.new/linux/af_vsock.c +--- vsock-only/linux/af_vsock.c 2016-03-16 21:31:24.582040320 -0400 ++++ vsock-only.new/linux/af_vsock.c 2016-03-16 21:37:22.140045067 -0400 +@@ -231,7 +231,16 @@ static int VSockVmciStreamSetsockopt(str + + static int VSockVmciStreamGetsockopt(struct socket *sock, int level, int optname, + char __user *optval, int __user * optlen); +- ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++static int VSockVmciDgramSendmsg( ++ struct socket *sock, struct msghdr *msg, size_t len); ++static int VSockVmciDgramRecvmsg(struct socket *sock, ++ struct msghdr *msg, size_t len, int flags); ++static int VSockVmciStreamSendmsg( ++ struct socket *sock, struct msghdr *msg, size_t len); ++static int VSockVmciStreamRecvmsg(struct socket *sock, ++ struct msghdr *msg, size_t len, int flags); ++#else + static int VSockVmciDgramSendmsg(struct kiocb *kiocb, + struct socket *sock, struct msghdr *msg, size_t len); + static int VSockVmciDgramRecvmsg(struct kiocb *kiocb, struct socket *sock, +@@ -240,6 +249,7 @@ static int VSockVmciStreamSendmsg(struct + struct socket *sock, struct msghdr *msg, size_t len); + static int VSockVmciStreamRecvmsg(struct kiocb *kiocb, struct socket *sock, + struct msghdr *msg, size_t len, int flags); ++#endif + + static int VSockVmciCreate( + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) +@@ -4210,7 +4220,11 @@ VSockVmciShutdown(struct socket *sock, + */ + + static int ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++VSockVmciDgramSendmsg( ++#else + VSockVmciDgramSendmsg(struct kiocb *kiocb, // UNUSED ++#endif + struct socket *sock, // IN: socket to send on + struct msghdr *msg, // IN: message to send + size_t len) // IN: length of message +@@ -4540,7 +4554,11 @@ VSockVmciStreamGetsockopt(struct socket + */ + + static int ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++VSockVmciStreamSendmsg( ++#else + VSockVmciStreamSendmsg(struct kiocb *kiocb, // UNUSED ++#endif + struct socket *sock, // IN: socket to send on + struct msghdr *msg, // IN: message to send + size_t len) // IN: length of message +@@ -4709,7 +4727,11 @@ out: + */ + + static int ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++VSockVmciDgramRecvmsg( ++#else + VSockVmciDgramRecvmsg(struct kiocb *kiocb, // UNUSED ++#endif + struct socket *sock, // IN: socket to receive from + struct msghdr *msg, // IN/OUT: message to receive into + size_t len, // IN: length of receive buffer +@@ -4804,7 +4826,11 @@ out: + */ + + static int ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++VSockVmciStreamRecvmsg( ++#else + VSockVmciStreamRecvmsg(struct kiocb *kiocb, // UNUSED ++#endif + struct socket *sock, // IN: socket to receive from + struct msghdr *msg, // IN/OUT: message to receive into + size_t len, // IN: length of receive buffer diff --git a/app-emulation/vmware-modules/files/304-4.2-03-vsock.patch b/app-emulation/vmware-modules/files/304-4.2-03-vsock.patch new file mode 100644 index 000000000000..a2504a6a15e3 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-4.2-03-vsock.patch @@ -0,0 +1,14 @@ +diff -rupN vsock-only/linux/af_vsock.c vsock-only.new/linux/af_vsock.c +--- vsock-only/linux/af_vsock.c 2016-03-16 21:38:01.401045589 -0400 ++++ vsock-only.new/linux/af_vsock.c 2016-03-16 21:39:32.529046799 -0400 +@@ -2836,7 +2836,9 @@ __VSockVmciCreate(struct net *net, + * network namespace, and the option to zero the sock was dropped. + * + */ +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++ sk = sk_alloc(net, vsockVmciFamilyOps.family, priority, &vsockVmciProto, 1); ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) + sk = sk_alloc(vsockVmciFamilyOps.family, priority, + vsockVmciProto.slab_obj_size, vsockVmciProto.slab); + #elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) diff --git a/app-emulation/vmware-modules/files/304-4.3-00-misc_deregister.patch b/app-emulation/vmware-modules/files/304-4.3-00-misc_deregister.patch new file mode 100644 index 000000000000..32d960dfbcae --- /dev/null +++ b/app-emulation/vmware-modules/files/304-4.3-00-misc_deregister.patch @@ -0,0 +1,34 @@ +diff -rupN vmci-only/linux/driver.c vmci-only.new/linux/driver.c +--- vmci-only/linux/driver.c 2016-03-16 21:59:30.229062702 -0400 ++++ vmci-only.new/linux/driver.c 2016-03-16 21:58:35.452061974 -0400 +@@ -2469,7 +2469,9 @@ vmci_init(void) + static void __exit + vmci_exit(void) + { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + int retval; ++#endif + + if (guestDeviceInit) { + pci_unregister_driver(&vmci_driver); + +diff -rupN vmci-only/linux/driver.c vmci-only.new/linux/driver.c +--- vmci-only/linux/driver.c 2016-03-16 21:53:24.184057841 -0400 ++++ vmci-only.new/linux/driver.c 2016-03-16 21:54:37.558058816 -0400 +@@ -2482,12 +2482,16 @@ vmci_exit(void) + + VMCI_HostCleanup(); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++ misc_deregister(&linuxState.misc); ++#else + retval = misc_deregister(&linuxState.misc); + if (retval) { + Warning(LGPFX "Module %s: error unregistering\n", VMCI_MODULE_NAME); + } else { + Log(LGPFX"Module %s: unloaded\n", VMCI_MODULE_NAME); + } ++#endif + + hostDeviceInit = FALSE; + } diff --git a/app-emulation/vmware-modules/files/304-4.5-00-get_link.patch b/app-emulation/vmware-modules/files/304-4.5-00-get_link.patch new file mode 100644 index 000000000000..169fc71d9e22 --- /dev/null +++ b/app-emulation/vmware-modules/files/304-4.5-00-get_link.patch @@ -0,0 +1,67 @@ +diff -rupN vmblock-only/linux/inode.c vmblock-only.new/linux/inode.c +--- vmblock-only/linux/inode.c 2016-03-16 22:22:00.470080630 -0400 ++++ vmblock-only.new/linux/inode.c 2016-03-16 22:23:33.016081859 -0400 +@@ -44,7 +44,9 @@ static struct dentry *InodeOpLookup(stru + static int InodeOpReadlink(struct dentry *, char __user *, int); + #endif + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) ++const char *InodeOpGetLink(struct dentry *dentry, struct inode *inode, struct delayed_call *done); ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) + static const char *InodeOpFollowlink(struct dentry *dentry, void **cookie); + #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) + static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd); +@@ -63,7 +65,11 @@ static struct inode_operations LinkInode + struct inode_operations LinkInodeOps = { + #endif + .readlink = InodeOpReadlink, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) ++ .get_link = InodeOpGetLink, ++#else + .follow_link = InodeOpFollowlink, ++#endif + }; + + /* +@@ -222,7 +228,9 @@ InodeOpReadlink(struct dentry *dentry, + * + *---------------------------------------------------------------------------- + */ +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) ++const char *InodeOpGetLink(struct dentry *dentry, struct inode *inode, struct delayed_call *done) ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) + static const char *InodeOpFollowlink(struct dentry *dentry, void **cookie) + #else + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) +@@ -238,18 +246,28 @@ InodeOpFollowlink(struct dentry *dentry, + VMBlockInodeInfo *iinfo; + + if (!dentry) { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) ++ ret = -ECHILD; ++#else + Warning("InodeOpReadlink: invalid args from kernel\n"); + ret = -EINVAL; ++#endif + goto out; + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) ++ iinfo = INODE_TO_IINFO(inode); ++#else + iinfo = INODE_TO_IINFO(dentry->d_inode); ++#endif + if (!iinfo) { + ret = -EINVAL; + goto out; + } + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) ++ return (char *)(iinfo->name); ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0) + return *cookie = (char *)(iinfo->name); + #else + nd_set_link(nd, iinfo->name); diff --git a/app-emulation/vmware-modules/vmware-modules-304.3-r1.ebuild b/app-emulation/vmware-modules/vmware-modules-304.3-r1.ebuild new file mode 100644 index 000000000000..86bea59c220d --- /dev/null +++ b/app-emulation/vmware-modules/vmware-modules-304.3-r1.ebuild @@ -0,0 +1,119 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +inherit eutils flag-o-matic linux-info linux-mod user versionator udev + +PV_MAJOR=$(get_major_version) +PV_MINOR=$(get_version_component_range 2) + +DESCRIPTION="VMware kernel modules" +HOMEPAGE="http://www.vmware.com/" + +SRC_URI="" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="-* ~amd64" +IUSE="pax_kernel +vmci +vsock" + +RDEPEND="" +DEPEND="${RDEPEND} + || ( =app-emulation/vmware-player-7.1.${PV_MINOR}* + =app-emulation/vmware-workstation-11.1.${PV_MINOR}* )" + +S=${WORKDIR} + +pkg_setup() { + CONFIG_CHECK="~HIGH_RES_TIMERS" + if kernel_is ge 2 6 37 && kernel_is lt 2 6 39; then + CONFIG_CHECK="${CONFIG_CHECK} BKL" + fi + if use vmci ; then + CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI" + else + CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI" + fi + if use vsock ; then + CONFIG_CHECK="${CONFIG_CHECK} !VMWARE_VMCI_VSOCKETS" + else + CONFIG_CHECK="${CONFIG_CHECK} VMWARE_VMCI_VSOCKETS" + fi + + linux-info_pkg_setup + + linux-mod_pkg_setup + + VMWARE_GROUP=${VMWARE_GROUP:-vmware} + + VMWARE_MODULE_LIST_ALL="vmblock vmmon vmnet vmci vsock" + VMWARE_MODULE_LIST="vmblock vmmon vmnet" + use vmci && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vmci" + use vsock && VMWARE_MODULE_LIST="${VMWARE_MODULE_LIST} vsock" + + VMWARE_MOD_DIR="${PN}-${PVR}" + + BUILD_TARGETS="auto-build 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() { + cd "${S}" + for mod in ${VMWARE_MODULE_LIST_ALL}; do + tar -xf /opt/vmware/lib/vmware/modules/source/${mod}.tar + done +} + +src_prepare() { + epatch "${FILESDIR}/${PV_MAJOR}-makefile-kernel-dir.patch" + epatch "${FILESDIR}/${PV_MAJOR}-makefile-include.patch" + epatch "${FILESDIR}/${PV_MAJOR}-netdevice.patch" + use pax_kernel && epatch "${FILESDIR}/${PV_MAJOR}-hardened.patch" + epatch "${FILESDIR}/${PV_MAJOR}-apic.patch" + + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-00-dentry.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-01-inode.patch" + kernel_is ge 3 10 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-02-control.patch" + kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.10-03-inline.patch" + kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.11-00-readdir.patch" + kernel_is ge 3 11 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.11-01-filldir.patch" + kernel_is ge 3 15 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.15-00-vsock.patch" + kernel_is ge 3 18 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.18-00-version-redefined.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-00-compat-namei.patch" + #kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-01-dentry.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-02-vmblock-path.patch" + #kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-03-iovec.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-04-iovec.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-05-vmci_qpair.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-06-vsock.patch" + kernel_is ge 3 19 0 && epatch "${FILESDIR}/${PV_MAJOR}-3.19-07-vsock.patch" + kernel_is ge 4 2 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.2-00-inode_op.patch" + kernel_is ge 4 2 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.2-01-vmci_vmalloc.patch" + kernel_is ge 4 2 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.2-02-vsock.patch" + kernel_is ge 4 2 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.2-03-vsock.patch" + kernel_is ge 4 3 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.3-00-misc_deregister.patch" + kernel_is ge 4 5 0 && epatch "${FILESDIR}/${PV_MAJOR}-4.5-00-get_link.patch" + + # Allow user patches so they can support RC kernels and whatever else + epatch_user +} + +src_install() { + linux-mod_src_install + local udevrules="${T}/60-vmware.rules" + cat > "${udevrules}" <<-EOF + KERNEL=="vmci", GROUP="vmware", MODE="660" + KERNEL=="vmw_vmci", GROUP="vmware", MODE="660" + KERNEL=="vmmon", GROUP="vmware", MODE="660" + KERNEL=="vsock", GROUP="vmware", MODE="660" + EOF + udev_dorules "${udevrules}" +} |