夜行録 - 酔歩.net

日暮れて道遠し さらに夜道を行く もって夜行録と名付く

vmware-tools installation to Linux 2.6.30

guest Linux だと最近の kernel に対応できてないようで compile 通らない。

どうでもいいが、 windows7 を sleep に落すたびに geust とのセッションが切れて X のコネクションが切れて非常に不都合なんだが……。

追記:2010.1.4
ゲストから共有フォルダに書こうとしたら kernel エラーになった。 VMwareTools-8.1.3-203739.tar.gz では何のエラーもなくコンパイルが通ったので以下は不要。

vmmemctl
Makefile.kernel:
autoconf/epoll.c での判定に失敗して -DVMW_HAVE_EPOLL が CFLAGS に追加できない。
vmxnet
vmxnet.c:
struct net_device から priv field が消え、 netdev_priv() を使うようになった件。
vmhgfs
Makefile.kernel:
autoconf/epoll.c での判定に失敗して -DVMW_HAVE_EPOLL が CFLAGS に追加できない。
file.c, inode.c:
struct task_struct から fsuid, fsgid field が消え、 current_fsuid(), current_fsgid() を使うようになった件。
filesystem.c:
同じく gid, uid field が消え、 current_gid(), current_uid() を使うようになった件。
page.c:
struct address_space_operations から prepare_write, commit_write field が消えた件。
vmblock:
Makefile.kernel:
autoconf/epoll.c での判定に失敗して -DVMW_HAVE_EPOLL が CFLAGS に追加できない。
control.c:
struct proc_dir_entry から owner field が消えた件。
vmci:
Makefile.kernel:
autoconf/epoll.c での判定に失敗して -DVMW_HAVE_EPOLL が CFLAGS に追加できない。
vsock:
Makefile.kernel:
autoconf/epoll.c での判定に失敗して -DVMW_HAVE_EPOLL が CFLAGS に追加できない。

で、ここまでやって vmware-server だと hgfs 無意味ということに気づく……。ゲストからファイル持ち出せねぇ。orz
かといって samba はダサいしのぉ………。

diff -ur old/vmhgfs-only/compat_wait.h new/vmhgfs-only/compat_wait.h
--- old/vmhgfs-only/compat_wait.h	2009-10-21 06:57:23.000000000 +0900
+++ new/vmhgfs-only/compat_wait.h	2009-12-01 21:25:23.000000000 +0900
@@ -19,6 +19,7 @@
 #ifndef __COMPAT_WAIT_H__
 #   define __COMPAT_WAIT_H__
 
+#define	VMW_HAVE_EPOLL
 
 #include 
 #include 
diff -ur old/vmhgfs-only/file.c new/vmhgfs-only/file.c
--- old/vmhgfs-only/file.c	2009-10-21 06:57:23.000000000 +0900
+++ new/vmhgfs-only/file.c	2009-12-01 20:51:22.000000000 +0900
@@ -637,7 +637,7 @@
             iparent = dparent->d_inode;
 
             HgfsSetUidGid(iparent, file->f_dentry,
-                          current->fsuid, current->fsgid);
+                          current_fsuid(), current_fsgid());
 
             dput(dparent);
          }
diff -ur old/vmhgfs-only/filesystem.c new/vmhgfs-only/filesystem.c
--- old/vmhgfs-only/filesystem.c	2009-10-21 06:57:23.000000000 +0900
+++ new/vmhgfs-only/filesystem.c	2009-12-01 20:52:52.000000000 +0900
@@ -256,13 +256,13 @@
    if (si->uidSet) {
       si->uid = mountInfo->uid;
    } else {
-      si->uid = current->uid;
+      si->uid = current_uid();
    }
    si->gidSet = mountInfo->gidSet;
    if (si->gidSet) {
       si->gid = mountInfo->gid;
    } else {
-      si->gid = current->gid;
+      si->gid = current_gid();
    }
    si->fmask = mountInfo->fmask;
    si->dmask = mountInfo->dmask;
diff -ur old/vmhgfs-only/inode.c new/vmhgfs-only/inode.c
--- old/vmhgfs-only/inode.c	2009-10-21 06:57:23.000000000 +0900
+++ new/vmhgfs-only/inode.c	2009-12-01 20:53:51.000000000 +0900
@@ -1201,7 +1201,7 @@
              * a Linux machine and as root, but we might as well give it
              * a go.
              */
-            HgfsSetUidGid(dir, dentry, current->fsuid, current->fsgid);
+            HgfsSetUidGid(dir, dentry, current_fsuid(), current_fsgid());
          }
 
          /*
diff -ur old/vmhgfs-only/page.c new/vmhgfs-only/page.c
--- old/vmhgfs-only/page.c	2009-10-21 06:57:23.000000000 +0900
+++ new/vmhgfs-only/page.c	2009-12-01 21:21:45.000000000 +0900
@@ -85,8 +85,8 @@
 struct address_space_operations HgfsAddressSpaceOperations = {
    .readpage      = HgfsReadpage,
    .writepage     = HgfsWritepage,
-   .prepare_write = HgfsPrepareWrite,
-   .commit_write  = HgfsCommitWrite,
+/*   .prepare_write = HgfsPrepareWrite, */
+/*   .commit_write  = HgfsCommitWrite, */
 #ifdef HGFS_ENABLE_WRITEBACK
    .set_page_dirty = __set_page_dirty_nobuffers,
 #endif
diff -ur old/vmmemctl-only/compat_wait.h new/vmmemctl-only/compat_wait.h
--- old/vmmemctl-only/compat_wait.h	2009-10-21 06:57:53.000000000 +0900
+++ new/vmmemctl-only/compat_wait.h	2009-12-01 11:13:50.000000000 +0900
@@ -19,6 +19,7 @@
 #ifndef __COMPAT_WAIT_H__
 #   define __COMPAT_WAIT_H__
 
+#define VMW_HAVE_EPOLL
 
 #include 
 #include 
diff -ur old/vmxnet-only/vmxnet.c new/vmxnet-only/vmxnet.c
--- old/vmxnet-only/vmxnet.c	2009-10-21 06:57:46.000000000 +0900
+++ new/vmxnet-only/vmxnet.c	2009-12-01 20:38:32.000000000 +0900
@@ -190,7 +190,7 @@
 static int
 vmxnet_change_mtu(struct net_device *dev, int new_mtu)
 {
-   struct Vmxnet_Private *lp = (struct Vmxnet_Private *)dev->priv;
+   struct Vmxnet_Private *lp = (struct Vmxnet_Private *)netdev_priv(dev);
 
    if (new_mtu < VMXNET_MIN_MTU || new_mtu > VMXNET_MAX_MTU) {
       return -EINVAL;
@@ -264,7 +264,7 @@
 vmxnet_get_drvinfo(struct net_device *dev,
                    struct ethtool_drvinfo *drvinfo)
 {
-   struct Vmxnet_Private *lp = dev->priv;
+   struct Vmxnet_Private *lp = netdev_priv(dev);
 
    strncpy(drvinfo->driver, vmxnet_driver.name, sizeof(drvinfo->driver));
    drvinfo->driver[sizeof(drvinfo->driver) - 1] = '\0';
@@ -302,7 +302,7 @@
 vmxnet_set_tso(struct net_device *dev, u32 data)
 {
    if (data) {
-      struct Vmxnet_Private *lp = (struct Vmxnet_Private *)dev->priv;
+      struct Vmxnet_Private *lp = (struct Vmxnet_Private *)netdev_priv(dev);
 
       if (!lp->tso) {
          return -EINVAL;
@@ -454,7 +454,7 @@
    }
 
    if (value.data) {
-      struct Vmxnet_Private *lp = (struct Vmxnet_Private *)dev->priv;
+      struct Vmxnet_Private *lp = (struct Vmxnet_Private *)netdev_priv(dev);
 
       if (!lp->tso) {
          return -EINVAL;
@@ -656,7 +656,7 @@
    uint32 status;
    int ok;
 
-   lp = dev->priv;
+   lp = netdev_priv(dev);
    status = inl(dev->base_addr + VMXNET_STATUS_ADDR);
    ok = (status & VMXNET_STATUS_CONNECTED) != 0;
    if (ok != netif_carrier_ok(dev)) {
@@ -838,7 +838,7 @@
       goto morph_back;
    }
 
-   lp = dev->priv;
+   lp = netdev_priv(dev);
    lp->pdev = pdev;
 
    dev->base_addr = ioaddr;
@@ -1139,7 +1139,7 @@
 vmxnet_remove_device(struct pci_dev* pdev)
 {
    struct net_device *dev = pci_get_drvdata(pdev);
-   struct Vmxnet_Private *lp = dev->priv;
+   struct Vmxnet_Private *lp = netdev_priv(dev);
 
    /*
     * Do this before device is gone so we never call netif_carrier_* after
@@ -1210,7 +1210,7 @@
 static int
 vmxnet_init_ring(struct net_device *dev)
 {
-   struct Vmxnet_Private *lp = (Vmxnet_Private *)dev->priv;
+   struct Vmxnet_Private *lp = (Vmxnet_Private *)netdev_priv(dev);
    Vmxnet2_DriverData *dd = lp->dd;
    unsigned int i;
    size_t offset;
@@ -1335,7 +1335,7 @@
 static int
 vmxnet_open(struct net_device *dev)
 {
-   struct Vmxnet_Private *lp = (Vmxnet_Private *)dev->priv;
+   struct Vmxnet_Private *lp = (Vmxnet_Private *)netdev_priv(dev);
    unsigned int ioaddr = dev->base_addr;
    u32 paddr;
 
@@ -1591,7 +1591,7 @@
 static void
 check_tx_queue(struct net_device *dev)
 {
-   Vmxnet_Private *lp = (Vmxnet_Private *)dev->priv;
+   Vmxnet_Private *lp = (Vmxnet_Private *)netdev_priv(dev);
    Vmxnet2_DriverData *dd = lp->dd;
    int completed = 0;
 
@@ -1655,7 +1655,7 @@
 vmxnet_tx(struct sk_buff *skb, struct net_device *dev)
 {
    Vmxnet_TxStatus status = VMXNET_DEFER_TRANSMIT;
-   struct Vmxnet_Private *lp = (struct Vmxnet_Private *)dev->priv;
+   struct Vmxnet_Private *lp = (struct Vmxnet_Private *)netdev_priv(dev);
    Vmxnet2_DriverData *dd = lp->dd;
    unsigned long flags;
    Vmxnet2_TxRingEntry *xre;
@@ -2054,7 +2054,7 @@
 static int
 vmxnet_rx(struct net_device *dev)
 {
-   Vmxnet_Private *lp = (Vmxnet_Private *)dev->priv;
+   Vmxnet_Private *lp = (Vmxnet_Private *)netdev_priv(dev);
    Vmxnet2_DriverData *dd = lp->dd;
 
 #ifdef BPF_SUPPORT_ENABLED
@@ -2229,7 +2229,7 @@
    }
 
 
-   lp = (struct Vmxnet_Private *)dev->priv;
+   lp = (struct Vmxnet_Private *)netdev_priv(dev);
    outl(VMXNET_CMD_INTR_ACK, dev->base_addr + VMXNET_COMMAND_ADDR);
 
    dd = lp->dd;
@@ -2311,7 +2311,7 @@
 vmxnet_close(struct net_device *dev)
 {
    unsigned int ioaddr = dev->base_addr;
-   Vmxnet_Private *lp = (Vmxnet_Private *)dev->priv;
+   Vmxnet_Private *lp = (Vmxnet_Private *)netdev_priv(dev);
    int i;
    unsigned long flags;
 
@@ -2401,7 +2401,7 @@
 static int
 vmxnet_load_multicast (struct net_device *dev)
 {
-    Vmxnet_Private *lp = (Vmxnet_Private *) dev->priv;
+    Vmxnet_Private *lp = (Vmxnet_Private *) netdev_priv(dev);
     volatile u16 *mcast_table = (u16 *)lp->dd->LADRF;
     struct dev_mc_list *dmi = dev->mc_list;
     char *addrs;
@@ -2462,7 +2462,7 @@
 vmxnet_set_multicast_list(struct net_device *dev)
 {
    unsigned int ioaddr = dev->base_addr;
-   Vmxnet_Private *lp = (Vmxnet_Private *)dev->priv;
+   Vmxnet_Private *lp = (Vmxnet_Private *)netdev_priv(dev);
 
    lp->dd->ifflags = ~(VMXNET_IFF_PROMISC
                       |VMXNET_IFF_BROADCAST
@@ -2542,7 +2542,7 @@
 static struct net_device_stats *
 vmxnet_get_stats(struct net_device *dev)
 {
-   Vmxnet_Private *lp = (Vmxnet_Private *)dev->priv;
+   Vmxnet_Private *lp = (Vmxnet_Private *)netdev_priv(dev);
 
    return &lp->stats;
 }
2009年12月02日 (Wed) - 19:19:00 - その他雑記 - 6390x - permalink
Karma points: 4. Do you like this article? [yes/no]