public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Vadim Kuznetsov (vadimk)" <vadimk@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/vmware-modules/files: 1.0.0.24-kernel-2.6.30.patch 1.0.0.24-kernel-2.6.29.patch 1.0.0.24-makefile-kernel-dir.patch
Date: Sun, 14 Jun 2009 15:27:06 +0000	[thread overview]
Message-ID: <E1MFrbu-0001QP-Ai@stork.gentoo.org> (raw)

vadimk      09/06/14 15:27:06

  Added:                1.0.0.24-kernel-2.6.30.patch
                        1.0.0.24-kernel-2.6.29.patch
                        1.0.0.24-makefile-kernel-dir.patch
  Log:
  Bugs 268099, 270150, 273750. New ebuild without vmware-mod eclass.
  (Portage version: 2.2_rc33/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  app-emulation/vmware-modules/files/1.0.0.24-kernel-2.6.30.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/vmware-modules/files/1.0.0.24-kernel-2.6.30.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/vmware-modules/files/1.0.0.24-kernel-2.6.30.patch?rev=1.1&content-type=text/plain

Index: 1.0.0.24-kernel-2.6.30.patch
===================================================================
diff -urN source-OLD/vmblock-only/linux/control.c source-NEW/vmblock-only/linux/control.c
--- source-OLD/vmblock-only/linux/control.c	2008-10-28 22:47:20.000000000 -0700
+++ source-NEW/vmblock-only/linux/control.c	2009-05-07 12:25:33.000000000 -0700
@@ -46,7 +46,9 @@
 
 static struct proc_dir_entry *controlProcDirEntry;
 struct file_operations ControlFileOps = {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
    .owner   = THIS_MODULE,
+#endif
    .write   = ControlFileOpWrite,
    .release = ControlFileOpRelease,
 };
@@ -156,7 +158,9 @@
       return -EINVAL;
    }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
    controlProcDirEntry->owner = THIS_MODULE;
+#endif
 
    /* Create /proc/fs/vmblock/mountPoint */
    controlProcMountpoint = proc_mkdir(VMBLOCK_CONTROL_MOUNTPOINT,
@@ -168,7 +172,9 @@
       return -EINVAL;
    }
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 30)
    controlProcMountpoint->owner = THIS_MODULE;
+#endif
 
    /* Create /proc/fs/vmblock/dev */
    controlProcEntry = create_proc_entry(VMBLOCK_CONTROL_DEVNAME,



1.1                  app-emulation/vmware-modules/files/1.0.0.24-kernel-2.6.29.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/vmware-modules/files/1.0.0.24-kernel-2.6.29.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/vmware-modules/files/1.0.0.24-kernel-2.6.29.patch?rev=1.1&content-type=text/plain

Index: 1.0.0.24-kernel-2.6.29.patch
===================================================================
diff -ur vmware-modules-1.0.0.24.0/work/vmblock-only/Makefile.kernel vmware-modules-1.0.0.24/work/vmblock-only/Makefile.kernel
--- vmware-modules-1.0.0.24.0/work/vmblock-only/Makefile.kernel	2009-03-27 08:05:21.000000000 +0300
+++ vmware-modules-1.0.0.24/work/vmblock-only/Makefile.kernel	2009-04-07 16:14:55.000000000 +0400
@@ -19,7 +19,7 @@
 
 INCLUDE := -I$(SRCROOT)/include
 
-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
+EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
 
 EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/setnice.c, -DVMW_HAVE_SET_USER_NICE, )
 EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/epoll.c,   -DVMW_HAVE_EPOLL, )
diff -ur vmware-modules-1.0.0.24.0/work/vmci-only/Makefile.kernel vmware-modules-1.0.0.24/work/vmci-only/Makefile.kernel
--- vmware-modules-1.0.0.24.0/work/vmci-only/Makefile.kernel	2009-03-27 08:05:22.000000000 +0300
+++ vmware-modules-1.0.0.24/work/vmci-only/Makefile.kernel	2009-04-07 16:14:55.000000000 +0400
@@ -21,7 +21,7 @@
 
 INCLUDE := -I$(SRCROOT)/include -I$(SRCROOT)/common -I$(SRCROOT)/linux
 
-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
+EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
 
 EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/epoll.c,   -DVMW_HAVE_EPOLL, )
 
diff -ur vmware-modules-1.0.0.24.0/work/vmmon-only/linux/driver.c vmware-modules-1.0.0.24/work/vmmon-only/linux/driver.c
--- vmware-modules-1.0.0.24.0/work/vmmon-only/linux/driver.c	2009-03-27 08:05:19.000000000 +0300
+++ vmware-modules-1.0.0.24/work/vmmon-only/linux/driver.c	2009-04-07 16:15:11.000000000 +0400
@@ -1984,10 +1984,10 @@
    }
 
    case IOCTL_VMX86_ALLOW_CORE_DUMP:
-      if (current->euid == current->uid &&
-	  current->fsuid == current->uid &&
-          current->egid == current->gid &&
-	  current->fsgid == current->gid) {
+      if (current_euid() == current_uid() &&
+	  current_fsuid() == current_uid() &&
+          current_egid() == current_gid() &&
+	  current_fsgid() == current_gid()) {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) || defined(MMF_DUMPABLE)
          /* Dump core, readable by user. */
          set_bit(MMF_DUMPABLE, &current->mm->flags);
diff -ur vmware-modules-1.0.0.24.0/work/vmmon-only/linux/hostif.c vmware-modules-1.0.0.24/work/vmmon-only/linux/hostif.c
--- vmware-modules-1.0.0.24.0/work/vmmon-only/linux/hostif.c	2009-03-27 08:05:18.000000000 +0300
+++ vmware-modules-1.0.0.24/work/vmmon-only/linux/hostif.c	2009-04-07 16:19:05.000000000 +0400
@@ -3424,6 +3424,82 @@
 }
 
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) 
+static inline
+void compat_cap_raise(int cap)
+{
+   cap_raise(current->cap_effective, cap);
+}
+#else
+static
+void compat_cap_raise(int cap)
+{
+   struct cred *new_cred;
+  
+   new_cred = prepare_creds();
+   if (new_cred != NULL)
+   {
+      cap_raise(new_cred->cap_effective, cap);
+      commit_creds(new_cred);
+   }
+   else
+   {
+      Log("compat_cap_raise(%d) prepare_creds(): Out of memory\n", cap);
+   }
+}
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+static inline
+void compat_cap_lower(int cap)
+{
+   cap_lower(current->cap_effective, cap);
+}
+#else
+static
+void compat_cap_lower(int cap)
+{
+   struct cred *new_cred;
+  
+   new_cred = prepare_creds();
+   if (new_cred != NULL)
+   {
+      cap_lower(new_cred->cap_effective, cap);
+      commit_creds(new_cred);
+   }
+   else
+   {
+      Log("compat_cap_lower(%d) prepare_creds(): Out of memory\n", cap);
+   }
+}
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+static inline
+void compat_set_fsuid(int fsuid)
+{
+   current->fsuid = fsuid;
+}
+#else
+static
+void compat_set_fsuid(int fsuid)
+{
+   struct cred *new_cred;
+  
+   new_cred = prepare_creds();
+   if (new_cred != NULL)
+   {
+      new_cred->fsuid = fsuid;
+      commit_creds(new_cred);
+   }
+   else
+   {
+      Log("compat_set_fsuid(%d) prepare_creds(): Out of memory\n", fsuid);
+   }
+}
+#endif
+
+
 /*
  *----------------------------------------------------------------------
  *
@@ -3456,7 +3532,7 @@
    oldFS = get_fs();
    set_fs(KERNEL_DS);
    compat_allow_signal(SIGKILL);
-   cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
+   compat_cap_raise(CAP_SYS_RESOURCE);
    compat_set_user_nice(current, linuxState.fastClockPriority);
 
    while (linuxState.fastClockRate > HZ + HZ/16) {
@@ -3580,19 +3656,19 @@
          Bool cap;
          long pid;
 
-         fsuid = current->fsuid;
-         current->fsuid = 0;
+         fsuid = current_fsuid();
+         compat_set_fsuid(0);
          filp = filp_open("/dev/rtc", O_RDONLY, 0);
-         current->fsuid = fsuid;
+         compat_set_fsuid(fsuid);
          if (IS_ERR(filp)) {
             Warning("/dev/rtc open failed: %d\n", (int)(VA)filp);
             return -(int)(VA)filp;
          }
-         cap = cap_raised(current->cap_effective, CAP_SYS_RESOURCE);
-         cap_raise(current->cap_effective, CAP_SYS_RESOURCE);
+         cap = cap_raised(current_cap(), CAP_SYS_RESOURCE);
+         compat_cap_raise(CAP_SYS_RESOURCE);
          res = HostIFDoIoctl(filp, RTC_PIE_ON, 0);
          if (!cap) {
-            cap_lower(current->cap_effective, CAP_SYS_RESOURCE);            
+            compat_cap_lower(CAP_SYS_RESOURCE);
          }
          if (res < 0) {
             Warning("/dev/rtc enable interrupt failed: %d\n", res);
diff -ur vmware-modules-1.0.0.24.0/work/vmmon-only/Makefile.kernel vmware-modules-1.0.0.24/work/vmmon-only/Makefile.kernel
--- vmware-modules-1.0.0.24.0/work/vmmon-only/Makefile.kernel	2009-03-27 08:05:19.000000000 +0300
+++ vmware-modules-1.0.0.24/work/vmmon-only/Makefile.kernel	2009-04-07 16:15:21.000000000 +0400
@@ -22,7 +22,7 @@
 INCLUDE := -I$(SRCROOT)/include -I$(SRCROOT)/common -I$(SRCROOT)/linux \
 	   -I$(SRCROOT)/vmcore
 
-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
+EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
 
 EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/nopage1.c, -DVMW_NOPAGE_261, )
 EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/skas1.c,   -DVMW_SKAS_MMAP, )
diff -ur vmware-modules-1.0.0.24.0/work/vmnet-only/Makefile.kernel vmware-modules-1.0.0.24/work/vmnet-only/Makefile.kernel
--- vmware-modules-1.0.0.24.0/work/vmnet-only/Makefile.kernel	2009-03-27 08:05:20.000000000 +0300
+++ vmware-modules-1.0.0.24/work/vmnet-only/Makefile.kernel	2009-04-07 16:15:21.000000000 +0400
@@ -19,7 +19,7 @@
 
 INCLUDE := -I$(SRCROOT)
 
-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
+EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
 EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/epoll.c,   -DVMW_HAVE_EPOLL, )
 EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/socket.c,  -DVMW_HAVE_SK_WMEM_ALLOC, )
 EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/sk_alloc.c,-DVMW_HAVE_SK_ALLOC_WITH_PROTO, )
diff -ur vmware-modules-1.0.0.24.0/work/vmnet-only/netif.c vmware-modules-1.0.0.24/work/vmnet-only/netif.c
--- vmware-modules-1.0.0.24.0/work/vmnet-only/netif.c	2009-03-27 08:05:20.000000000 +0300
+++ vmware-modules-1.0.0.24/work/vmnet-only/netif.c	2009-04-07 16:15:21.000000000 +0400
@@ -55,6 +55,30 @@
    struct net_device_stats stats;
 } VNetNetIF;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
+/*
+    Prior to KERNEL_VERSION(2, 6, 29) "struct net_device" had "void
+    *priv" field which was used as pointer to "VNetNetIF".
+*/
+
+#define VNetNetIF_netdev_priv_size	0
+
+#define VNetNetIF_netdev_netIf(dev)	(*(VNetNetIF**)&((dev)->priv))
+
+#else
+/*
+    Since KERNEL_VERSION(2, 6, 29) pointer to "VNetNetIF" is stored in 
+    explicitly allocated private area.
+*/
+typedef struct {
+   VNetNetIF *netIf;
+} VNetNetIF_netdev_priv;
+
+#define VNetNetIF_netdev_priv_size	sizeof(VNetNetIF_netdev_priv)
+
+#define VNetNetIF_netdev_netIf(dev)	(((VNetNetIF_netdev_priv *)compat_netdev_priv(dev))->netIf)
+
+#endif
 
 static void VNetNetIfFree(VNetJack *this);
 static void VNetNetIfReceive(VNetJack *this, struct sk_buff *skb);
@@ -318,13 +342,13 @@
    memcpy(netIf->devName, devName, sizeof netIf->devName);
    NULL_TERMINATE_STRING(netIf->devName);
 
-   dev = compat_alloc_netdev(0, netIf->devName, VNetNetIfSetup);
+   dev = compat_alloc_netdev(VNetNetIF_netdev_priv_size, netIf->devName, VNetNetIfSetup);
    if (!dev) {
       retval = -ENOMEM;
       goto out;
    }
 
-   dev->priv = netIf;
+   VNetNetIF_netdev_netIf(dev) = netIf;
    netIf->dev = dev;
    
    memcpy(dev->dev_addr, netIf->port.paddr, sizeof netIf->port.paddr);
@@ -566,7 +590,7 @@
 VNetNetifStartXmit(struct sk_buff    *skb, // IN:
                    struct net_device *dev) // IN:
 {
-   VNetNetIF *netIf = (VNetNetIF*)dev->priv;
+   VNetNetIF *netIf = VNetNetIF_netdev_netIf(dev);
 
    if(skb == NULL) {
       return 0;
@@ -618,7 +642,7 @@
 VNetNetifSetMAC(struct net_device *dev, // IN:
                 void *p)                // IN:
 {
-   VNetNetIF *netIf = (VNetNetIF*)dev->priv;
+   VNetNetIF *netIf = VNetNetIF_netdev_netIf(dev);
    struct sockaddr const *addr = p;
    if (!VMX86_IS_STATIC_MAC(addr->sa_data)) {
       return -EINVAL;
@@ -675,7 +699,7 @@
 struct net_device_stats *
 VNetNetifGetStats(struct net_device *dev) // IN:
 {
-   VNetNetIF *netIf = (VNetNetIF*)dev->priv;
+   VNetNetIF *netIf = VNetNetIF_netdev_netIf(dev);
    return &(netIf->stats);
 }
 
diff -ur vmware-modules-1.0.0.24.0/work/vsock-only/linux/util.c vmware-modules-1.0.0.24/work/vsock-only/linux/util.c
--- vmware-modules-1.0.0.24.0/work/vsock-only/linux/util.c	2009-03-27 08:05:23.000000000 +0300
+++ vmware-modules-1.0.0.24/work/vsock-only/linux/util.c	2009-04-07 16:15:21.000000000 +0400
@@ -154,7 +154,7 @@
       goto error;
    }
 
-   Log(buf);
+   Log("%s", buf);
 
    return;
 
diff -ur vmware-modules-1.0.0.24.0/work/vsock-only/Makefile.kernel vmware-modules-1.0.0.24/work/vsock-only/Makefile.kernel
--- vmware-modules-1.0.0.24.0/work/vsock-only/Makefile.kernel	2009-03-27 08:05:23.000000000 +0300
+++ vmware-modules-1.0.0.24/work/vsock-only/Makefile.kernel	2009-04-07 16:15:21.000000000 +0400
@@ -25,7 +25,7 @@
 INCLUDE += -I$(SRCROOT)/linux
 INCLUDE += -I$(SRCROOT)/common
 
-EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE)
+EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) $(LINUXINCLUDE)
 EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/epoll.c,   -DVMW_HAVE_EPOLL, )
 EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/setnice.c, -DVMW_HAVE_SET_USER_NICE, )
 



1.1                  app-emulation/vmware-modules/files/1.0.0.24-makefile-kernel-dir.patch

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/vmware-modules/files/1.0.0.24-makefile-kernel-dir.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/vmware-modules/files/1.0.0.24-makefile-kernel-dir.patch?rev=1.1&content-type=text/plain

Index: 1.0.0.24-makefile-kernel-dir.patch
===================================================================
diff --git a/vmblock-only/Makefile b/vmblock-only/Makefile
index 0a9ffd6..4aa09e8 100644
--- a/vmblock-only/Makefile
+++ b/vmblock-only/Makefile
@@ -29,9 +29,9 @@ SRCROOT = .
 VM_UNAME = $(shell uname -r)
 
 # Header directory for the running kernel
-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
+HEADER_DIR = $(KERNEL_DIR) 
 
-BUILD_DIR = $(HEADER_DIR)/..
+BUILD_DIR = $(KBUILD_OUTPUT)
 
 DRIVER := vmblock
 PRODUCT := @PRODUCT@
diff --git a/vmci-only/Makefile b/vmci-only/Makefile
index 0a6c9c6..6cd0b6d 100644
--- a/vmci-only/Makefile
+++ b/vmci-only/Makefile
@@ -29,9 +29,9 @@ SRCROOT = .
 VM_UNAME = $(shell uname -r)
 
 # Header directory for the running kernel
-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
+HEADER_DIR = $(KERNEL_DIR)
 
-BUILD_DIR = $(HEADER_DIR)/..
+BUILD_DIR = $(KBUILD_OUTPUT)
 
 DRIVER := vmci
 PRODUCT := @PRODUCT@
diff --git a/vmmon-only/Makefile b/vmmon-only/Makefile
index d26e58c..f8a40f4 100644
--- a/vmmon-only/Makefile
+++ b/vmmon-only/Makefile
@@ -29,9 +29,9 @@ SRCROOT = .
 VM_UNAME = $(shell uname -r)
 
 # Header directory for the running kernel
-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
+HEADER_DIR = $(KERNEL_DIR)
 
-BUILD_DIR = $(HEADER_DIR)/..
+BUILD_DIR = $(KBUILD_OUTPUT)
 
 DRIVER := vmmon
 PRODUCT := @PRODUCT@
diff --git a/vmnet-only/Makefile b/vmnet-only/Makefile
index 4cabc30..568271a 100644
--- a/vmnet-only/Makefile
+++ b/vmnet-only/Makefile
@@ -29,9 +29,9 @@ SRCROOT = .
 VM_UNAME = $(shell uname -r)
 
 # Header directory for the running kernel
-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
+HEADER_DIR = $(KERNEL_DIR)
 
-BUILD_DIR = $(HEADER_DIR)/..
+BUILD_DIR = $(KBUILD_OUTPUT)
 
 DRIVER := vmnet
 PRODUCT := @PRODUCT@
diff --git a/vsock-only/Makefile b/vsock-only/Makefile
index a69bc22..8a74856 100644
--- a/vsock-only/Makefile
+++ b/vsock-only/Makefile
@@ -29,9 +29,9 @@ SRCROOT = .
 VM_UNAME = $(shell uname -r)
 
 # Header directory for the running kernel
-HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
+HEADER_DIR = $(KERNEL_DIR)
 
-BUILD_DIR = $(HEADER_DIR)/..
+BUILD_DIR = $(KBUILD_OUTPUT)
 
 DRIVER := vsock
 PRODUCT := ws






                 reply	other threads:[~2009-06-14 15:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1MFrbu-0001QP-Ai@stork.gentoo.org \
    --to=vadimk@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox