install vmware tools on debian (guest) for newest kernel (3.1.0)

vmware version: vmware workstation 8.0.1 build-528992
debian kernel: 3.1.0-1-486
vmware tools fails to install or run.

solution:
1. apt-get install libglib2.0-0
2. patch /usr/lib/vmware-tools/modules/source/vmhgfs.tar
unpack vmhgfs.tar, patch, repack.
the patch:

diff -ur vmhgfs-only-old/file.c vmhgfs-only/file.c
--- vmhgfs-only-old/file.c      2011-11-14 11:41:31.000000000 +0800
+++ vmhgfs-only/file.c  2012-01-19 17:59:47.899616529 +0800
@@ -84,6 +84,8 @@
 #if defined VMW_FSYNC_OLD
                      struct dentry *dentry,
 #endif
+                                        loff_t start,
+                                        loff_t end,
                      int datasync);
 static int HgfsMmap(struct file *file,
                     struct vm_area_struct *vma);
@@ -990,6 +992,8 @@
 #if defined VMW_FSYNC_OLD
           struct dentry *dentry,        // IN: Dentry for this file
 #endif
+                 loff_t start,
+                 loff_t end,
           int datasync)                        // IN: fdatasync or fsync
 {
    LOG(6, (KERN_DEBUG "VMware hgfs: HgfsFsync: was called\n"));
diff -ur vmhgfs-only-old/filesystem.c vmhgfs-only/filesystem.c
--- vmhgfs-only-old/filesystem.c        2011-11-14 11:41:31.000000000 +0800
+++ vmhgfs-only/filesystem.c    2012-01-19 16:41:00.303867660 +0800
@@ -358,6 +358,8 @@
    HgfsSuperInfo *si;
    HgfsMountInfo *mountInfo;
    struct dentry *rootDentry;
+   struct dentry *tmpDentry;
+   struct inode *inode;
 
    ASSERT(sb);
 
@@ -408,15 +410,15 @@
     * and superblock. Then HgfsInstantiate will do the rest, issuing a getattr,
     * getting the inode, and instantiating the dentry with it.
     */
-   rootDentry = compat_d_alloc_name(NULL, "/");
+   inode = new_inode(sb);
+   tmpDentry = d_alloc_root(inode);
+   rootDentry = compat_d_alloc_name(tmpDentry, "/");
    if (rootDentry == NULL) {
       LOG(4, (KERN_WARNING "VMware hgfs: HgfsReadSuper: Could not allocate "
               "root dentry\n"));
       result = -ENOMEM;
       goto exit;
    }
-   rootDentry->d_parent = rootDentry;
-   rootDentry->d_sb = sb;
    result = HgfsInstantiate(rootDentry, HGFS_ROOT_INO, NULL);
    if (result) {
       LOG(4, (KERN_WARNING "VMware hgfs: HgfsReadSuper: Could not instantiate "
此条目发表在linux分类目录。将固定链接加入收藏夹。

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

*