[packages/open-vm-tools] - fix building with linux 3.10 - vmci module is present in kernel 3.10+ - rel 10

baggins baggins at pld-linux.org
Sun Aug 25 12:59:34 CEST 2013


commit 01d05bd9a3f5751b6e862fc5da0d36bd30e6ee21
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Aug 25 12:59:03 2013 +0200

    - fix building with linux 3.10
    - vmci module is present in kernel 3.10+
    - rel 10

 open-vm-tools-linux-3.10.patch | 259 +++++++++++++++++++++++++++++++++++++++++
 open-vm-tools.spec             |  16 +--
 2 files changed, 268 insertions(+), 7 deletions(-)
---
diff --git a/open-vm-tools.spec b/open-vm-tools.spec
index d6fc38c..16832ce 100644
--- a/open-vm-tools.spec
+++ b/open-vm-tools.spec
@@ -8,7 +8,7 @@
 %define		subver	%(echo %{snap} | tr -d .)
 %define		ver     9.2.3
 %define		rev     1031360
-%define		rel	9
+%define		rel	10
 %define		pname	open-vm-tools
 %define     modsrc	modules/linux
 Summary:	VMWare guest utilities
@@ -27,6 +27,7 @@ Source1:	%{pname}-packaging
 Source2:	%{pname}-modprobe.d
 Source3:	%{pname}-init
 Source4:	%{pname}-vmware-user.desktop
+Patch0:		%{pname}-linux-3.10.patch
 URL:		http://open-vm-tools.sourceforge.net/
 BuildRequires:	rpmbuild(macros) >= 1.453
 %if %{with userspace}
@@ -220,6 +221,7 @@ Moduł jądra Linuksa VMware vsock.
 %prep
 #setup -q -n %{pname}-%{snap}-%{rev}
 %setup -q -n %{pname}-%{ver}-%{rev}
+%patch0 -p1
 
 cp %{SOURCE1} packaging
 %{__sed} -i -e 's|##{BUILD_OUTPUT}##|build|' docs/api/doxygen.conf
@@ -228,11 +230,11 @@ cp %{SOURCE1} packaging
 %if %{with kernel}
 export OVT_SOURCE_DIR=$PWD
 %build_kernel_modules -C %{modsrc}/vmblock	-m vmblock	SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}
-%build_kernel_modules -C %{modsrc}/vmci		-m vmci		SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}
 %build_kernel_modules -C %{modsrc}/vmhgfs	-m vmhgfs	SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}
 %build_kernel_modules -C %{modsrc}/vmxnet	-m vmxnet	SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}
 %build_kernel_modules -C %{modsrc}/vsock	-m vsock	SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}
 %if "%{_alt_kernel}" == "-longterm"
+%build_kernel_modules -C %{modsrc}/vmci		-m vmci		SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}
 %build_kernel_modules -C %{modsrc}/vmsync	-m vmsync	SRCROOT=$PWD VM_KBUILD=26 VM_CCVER=%{cc_version}
 %endif
 %endif
@@ -252,11 +254,11 @@ rm -rf $RPM_BUILD_ROOT
 
 %if %{with kernel}
 %install_kernel_modules -m %{modsrc}/vmblock/vmblock	-d misc
-%install_kernel_modules -m %{modsrc}/vmci/vmci		-d misc
 %install_kernel_modules -m %{modsrc}/vmhgfs/vmhgfs	-d misc
 %install_kernel_modules -m %{modsrc}/vmxnet/vmxnet	-d misc
 %install_kernel_modules -m %{modsrc}/vsock/vsock	-d misc
 %if "%{_alt_kernel}" == "-longterm"
+%install_kernel_modules -m %{modsrc}/vmci/vmci		-d misc
 %install_kernel_modules -m %{modsrc}/vmsync/vmsync	-d misc
 %endif
 %endif
@@ -390,15 +392,15 @@ fi
 %defattr(644,root,root,755)
 /lib/modules/%{_kernel_ver}/misc/vmblock.ko*
 
-%files -n kernel%{_alt_kernel}-misc-vmci
-%defattr(644,root,root,755)
-/lib/modules/%{_kernel_ver}/misc/vmci.ko*
-
 %files -n kernel%{_alt_kernel}-misc-vmhgfs
 %defattr(644,root,root,755)
 /lib/modules/%{_kernel_ver}/misc/vmhgfs.ko*
 
 %if "%{_alt_kernel}" == "-longterm"
+%files -n kernel%{_alt_kernel}-misc-vmci
+%defattr(644,root,root,755)
+/lib/modules/%{_kernel_ver}/misc/vmci.ko*
+
 %files -n kernel%{_alt_kernel}-misc-vmsync
 %defattr(644,root,root,755)
 /lib/modules/%{_kernel_ver}/misc/vmsync.ko*
diff --git a/open-vm-tools-linux-3.10.patch b/open-vm-tools-linux-3.10.patch
new file mode 100644
index 0000000..88d7aa7
--- /dev/null
+++ b/open-vm-tools-linux-3.10.patch
@@ -0,0 +1,259 @@
+diff --git a/modules/linux/dkms.conf b/modules/linux/dkms.conf
+index 3ed77f9..263921f 100644
+--- a/modules/linux/dkms.conf
++++ b/modules/linux/dkms.conf
+@@ -1,39 +1,39 @@
+ PACKAGE_NAME=open-vm-tools
+ PACKAGE_VERSION=2013.04.16
+ MAKE_CMD_TMPL="make VM_UNAME=\$kernelver \
+-               MODULEBUILDDIR=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build"
++               MODULEBUILDDIR=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build \
++               CC_WARNINGS=-Wno-unused-local-typedefs"
+ 
+ # The vsock module depends on symbols exported by the vmci module, so it
+ # needs to be built afterwards; the MODULEBUILDDIR variable tells the makefiles
+ # where to store / retrive those symbol files.
+ MAKE[0]="$MAKE_CMD_TMPL -C vmblock;    \
+          $MAKE_CMD_TMPL -C vmci;       \
+          $MAKE_CMD_TMPL -C vmhgfs;     \
+          $MAKE_CMD_TMPL -C vmsync;     \
+          $MAKE_CMD_TMPL -C vmxnet;     \
+          $MAKE_CMD_TMPL -C vsock"
+ CLEAN[0]="$MAKE_CMD_TMPL -C vmblock clean;    \
+           $MAKE_CMD_TMPL -C vmci clean;       \
+           $MAKE_CMD_TMPL -C vmhgfs clean;     \
+-          $MAKE_CMD_TMPL -C vmsync clean";    \
++          $MAKE_CMD_TMPL -C vmsync clean;    \
+           $MAKE_CMD_TMPL -C vmxnet clean;     \
+-          $MAKE_CMD_TMPL -C vsock clean
++          $MAKE_CMD_TMPL -C vsock clean"
+ BUILT_MODULE_NAME[0]="vmblock"
+ BUILT_MODULE_NAME[1]="vmci"
+-BUILT_MODULE_NAME[2]="vmhgfs"
+-BUILT_MODULE_NAME[3]="vmsync"
+-BUILT_MODULE_NAME[4]="vmxnet"
+-BUILT_MODULE_NAME[5]="vsock"
++BUILT_MODULE_NAME[1]="vmhgfs"
++BUILT_MODULE_NAME[2]="vmsync"
++BUILT_MODULE_NAME[3]="vmxnet"
++BUILT_MODULE_NAME[4]="vsock"
+ BUILT_MODULE_LOCATION[0]="vmblock/"
+ BUILT_MODULE_LOCATION[1]="vmci/"
+-BUILT_MODULE_LOCATION[2]="vmhgfs/"
+-BUILT_MODULE_LOCATION[3]="vmsync/"
+-BUILT_MODULE_LOCATION[4]="vmxnet/"
+-BUILT_MODULE_LOCATION[5]="vsock/"
++BUILT_MODULE_LOCATION[1]="vmhgfs/"
++BUILT_MODULE_LOCATION[2]="vmsync/"
++BUILT_MODULE_LOCATION[3]="vmxnet/"
++BUILT_MODULE_LOCATION[4]="vsock/"
+ DEST_MODULE_LOCATION[0]="/kernel/fs/vmblock"
+-DEST_MODULE_LOCATION[1]="/kernel/drivers/misc"
+-DEST_MODULE_LOCATION[2]="/kernel/fs/vmhgfs"
+-DEST_MODULE_LOCATION[3]="/kernel/drivers/misc"
+-DEST_MODULE_LOCATION[4]="/kernel/drivers/net"
+-DEST_MODULE_LOCATION[5]="/kernel/net/vsock"
++DEST_MODULE_LOCATION[1]="/kernel/fs/vmhgfs"
++DEST_MODULE_LOCATION[2]="/kernel/drivers/misc"
++DEST_MODULE_LOCATION[3]="/kernel/drivers/net"
++DEST_MODULE_LOCATION[4]="/kernel/net/vsock"
+ AUTOINSTALL="YES"
+diff --git a/modules/linux/vmblock/linux/control.c b/modules/linux/vmblock/linux/control.c
+index 79716bd..ee64cdc 100644
+--- a/modules/linux/vmblock/linux/control.c
++++ b/modules/linux/vmblock/linux/control.c
+@@ -208,9 +208,10 @@ SetupProcDevice(void)
+    VMBlockSetProcEntryOwner(controlProcMountpoint);
+ 
+    /* Create /proc/fs/vmblock/dev */
+-   controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,
+-                                        VMBLOCK_CONTROL_MODE,
+-                                        controlProcDirEntry);
++   controlProcEntry = proc_create(VMBLOCK_CONTROL_DEVNAME,
++                                  VMBLOCK_CONTROL_MODE,
++                                  controlProcDirEntry,
++                                  &ControlFileOps);
+    if (!controlProcEntry) {
+       Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n");
+       remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry);
+@@ -218,7 +219,6 @@ SetupProcDevice(void)
+       return -EINVAL;
+    }
+ 
+-   controlProcEntry->proc_fops = &ControlFileOps;
+    return 0;
+ }
+ 
+@@ -278,7 +278,7 @@ ExecuteBlockOp(const char __user *buf,                // IN: buffer with name
+                int (*blockOp)(const char *filename,   // IN: block operation
+                               const os_blocker_id_t blocker))
+ {
+-   char *name;
++   struct filename *name;
+    int i;
+    int retval;
+ 
+@@ -287,13 +287,13 @@ ExecuteBlockOp(const char __user *buf,                // IN: buffer with name
+       return PTR_ERR(name);
+    }
+ 
+-   for (i = strlen(name) - 1; i >= 0 && name[i] == '/'; i--) {
+-      name[i] = '\0';
++   for (i = strlen(name->name) - 1; i >= 0 && name->name[i] == '/'; i--) {
++      ((char *)name->name)[i] = '\0';
+    }
+ 
+-   retval = i < 0 ? -EINVAL : blockOp(name, blocker);
++   retval = i < 0 ? -EINVAL : blockOp(name->name, blocker);
+ 
+-   putname(name);
++   __putname(name);
+ 
+    return retval;
+ }
+diff --git a/modules/linux/vmblock/linux/dentry.c b/modules/linux/vmblock/linux/dentry.c
+index 05ea95a..d93b2f0 100644
+--- a/modules/linux/vmblock/linux/dentry.c
++++ b/modules/linux/vmblock/linux/dentry.c
+@@ -31,8 +31,7 @@
+ #include "filesystem.h"
+ #include "block.h"
+ 
+-
+-static int DentryOpRevalidate(struct dentry *dentry, struct nameidata *nd);
++static int DentryOpRevalidate(struct dentry *dentry, unsigned int flags);
+ 
+ struct dentry_operations LinkDentryOps = {
+    .d_revalidate = DentryOpRevalidate,
+@@ -60,7 +59,7 @@ struct dentry_operations LinkDentryOps = {
+ 
+ static int
+ DentryOpRevalidate(struct dentry *dentry,  // IN: dentry revalidating
+-                   struct nameidata *nd)   // IN: lookup flags & intent
++                   unsigned int flags)     // IN: lookup flags
+ {
+    VMBlockInodeInfo *iinfo;
+    struct nameidata actualNd;
+@@ -101,7 +100,7 @@ DentryOpRevalidate(struct dentry *dentry,  // IN: dentry revalidating
+    if (actualDentry &&
+        actualDentry->d_op &&
+        actualDentry->d_op->d_revalidate) {
+-      return actualDentry->d_op->d_revalidate(actualDentry, nd);
++      return actualDentry->d_op->d_revalidate(actualDentry, flags);
+    }
+ 
+    if (compat_path_lookup(iinfo->name, 0, &actualNd)) {
+diff --git a/modules/linux/vmblock/linux/inode.c b/modules/linux/vmblock/linux/inode.c
+index 098c94c..ddd37f3 100644
+--- a/modules/linux/vmblock/linux/inode.c
++++ b/modules/linux/vmblock/linux/inode.c
+@@ -36,7 +36,7 @@
+ 
+ /* Inode operations */
+ static struct dentry *InodeOpLookup(struct inode *dir,
+-                                    struct dentry *dentry, struct nameidata *nd);
++                                    struct dentry *dentry, unsigned int flags);
+ static int InodeOpReadlink(struct dentry *dentry, char __user *buffer, int buflen);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
+ static void *InodeOpFollowlink(struct dentry *dentry, struct nameidata *nd);
+@@ -75,7 +75,7 @@ static struct inode_operations LinkInodeOps = {
+ static struct dentry *
+ InodeOpLookup(struct inode *dir,      // IN: parent directory's inode
+               struct dentry *dentry,  // IN: dentry to lookup
+-              struct nameidata *nd)   // IN: lookup intent and information
++              unsigned int flags)     // IN: lookup flags
+ {
+    char *filename;
+    struct inode *inode;
+diff --git a/modules/linux/vmhgfs/file.c b/modules/linux/vmhgfs/file.c
+index 1033984..db62070 100644
+--- a/modules/linux/vmhgfs/file.c
++++ b/modules/linux/vmhgfs/file.c
+@@ -25,6 +25,7 @@
+ /* Must come before any kernel header file. */
+ #include "driver-config.h"
+ 
++#include <linux/aio.h>
+ #include <linux/errno.h>
+ #include <linux/module.h>
+ #include <linux/signal.h>
+diff --git a/modules/linux/vmsync/sync.c b/modules/linux/vmsync/sync.c
+index d05ccad..73baf8b 100644
+--- a/modules/linux/vmsync/sync.c
++++ b/modules/linux/vmsync/sync.c
+@@ -162,7 +162,7 @@ VmSyncThawDevices(void  *_state)  // IN
+    cancel_delayed_work(&state->thawTask);
+    list_for_each_safe(cur, tmp, &state->devices) {
+       dev = list_entry(cur, VmSyncBlockDevice, list);
+-      if (dev->sb != NULL && dev->sb->s_frozen != SB_UNFROZEN) {
++      if (dev->sb != NULL && dev->sb->s_writers.frozen != SB_UNFROZEN) {
+          thaw_bdev(dev->bdev, dev->sb);
+          atomic_dec(&gFreezeCount);
+       }
+@@ -237,7 +237,7 @@ VmSyncAddPath(const VmSyncState *state,   // IN
+     * the superblock is already frozen.
+     */
+    if (inode->i_sb->s_bdev == NULL ||
+-       inode->i_sb->s_frozen != SB_UNFROZEN) {
++       inode->i_sb->s_writers.frozen != SB_UNFROZEN) {
+       result = (inode->i_sb->s_bdev == NULL) ? -EINVAL : -EALREADY;
+       compat_path_release(&nd);
+       goto exit;
+@@ -303,7 +303,7 @@ VmSyncFreezeDevices(VmSyncState *state,            // IN
+                     const char __user *userPaths)  // IN
+ {
+    int result = 0;
+-   char *paths;
++   struct filename *paths;
+    char *currPath;
+    char *nextSep;
+    struct list_head *cur, *tmp;
+@@ -328,7 +328,8 @@ VmSyncFreezeDevices(VmSyncState *state,            // IN
+    /*
+     * First, try to add all paths to the list of paths to be frozen.
+     */
+-   currPath = paths;
++   currPath = __getname();
++   strcpy(currPath, paths->name);
+    do {
+       nextSep = strchr(currPath, ':');
+       if (nextSep != NULL) {
+@@ -347,6 +348,7 @@ VmSyncFreezeDevices(VmSyncState *state,            // IN
+       }
+       currPath = nextSep + 1;
+    } while (nextSep != NULL);
++   __putname(currPath);
+ 
+    /*
+     * If adding all the requested paths worked, then freeze them.
+@@ -371,6 +373,8 @@ VmSyncFreezeDevices(VmSyncState *state,            // IN
+    compat_mutex_unlock(&state->lock);
+    compat_mutex_unlock(&gFreezeLock);
+ 
++   __putname(paths);
++
+    if (result == 0) {
+       compat_schedule_delayed_work(&state->thawTask, VMSYNC_THAW_TASK_DELAY);
+    }
+@@ -670,9 +674,10 @@ init_module(void)
+    }
+ 
+    /* Create /proc/driver/vmware-sync */
+-   controlProcEntry = create_proc_entry("driver/vmware-sync",
+-                                        S_IFREG | S_IRUSR | S_IRGRP | S_IROTH,
+-                                        NULL);
++   controlProcEntry = proc_create("driver/vmware-sync",
++                                  S_IFREG | S_IRUSR | S_IRGRP | S_IROTH,
++                                  NULL,
++                                  &VmSyncFileOps);
+    if (!controlProcEntry) {
+       printk(KERN_ERR "vmsync: could not create /proc/driver/vmware-sync\n");
+       kmem_cache_destroy(gSyncStateCache);
+@@ -680,7 +685,6 @@ init_module(void)
+       return -EINVAL;
+    }
+ 
+-   controlProcEntry->proc_fops = &VmSyncFileOps;
+    return 0;
+ }
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/open-vm-tools.git/commitdiff/01d05bd9a3f5751b6e862fc5da0d36bd30e6ee21



More information about the pld-cvs-commit mailing list