Dominique Leuenberger 2012-02-05 18:33:18 +00:00 committed by Git OBS Bridge
parent f903bb387d
commit 0385f6e67f
4 changed files with 265 additions and 15 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Sun Feb 5 15:07:36 UTC 2012 - dimstar@opensuse.org
- Add vmhgfs-2011.12.20.patch: Fix build of vmhgfs module with
kernel 3.2.
- Update FSF address part in vmtoolsd header.
-------------------------------------------------------------------
Tue Jan 24 15:53:36 UTC 2012 - prusnak@opensuse.org

View File

@ -20,20 +20,25 @@
# exclude AMD PCnet32 LANCE pci.id from Supplements list [bnc#397554]
%define __find_supplements sh -c '/usr/lib/rpm/find-supplements %{name} | grep -v pci:v00001022d00002000'
# Modules that have to be build up to version 12.1 (Last checked on 2011-09-21 with kernel 3.1-rc6)
%define vm_modules vmblock vmhgfs vmsync vmxnet vmci vsock
%if 0%{?suse_version} <= 1210
# Modules to be built up to openSUSE 12.1, possibly not building on newer versions.
%define vm_modules1210 vmxnet
%endif
# Modules that have to be build up to version 12.2 (Last checked on 2012-02-05 with kernel 3.2.0)
%define vm_modules vmblock vmhgfs vmsync vmci vsock %{?vm_modules1210}
# X modules are lower prio upstream and once in a while fail. Offer an easy way to enable/disable them.
%define with_X 1
Name: open-vm-tools
Version: 8.8.1
Release: 1
Release: 0
%define svn_rev 528969
License: BSD-3-Clause ; GPL-2.0 ; LGPL-2.1
Summary: Open Virtual Machine Tools
Url: http://open-vm-tools.sourceforge.net/
License: BSD-3-Clause ; GPL-2.0 ; LGPL-2.1
Group: System/Emulators/PC
Url: http://open-vm-tools.sourceforge.net/
Source: http://sourceforge.net/projects/open-vm-tools/files/open-vm-tools/stable-8.8.x/%{name}-%{version}-%{svn_rev}.tar.gz
Source1: vmtoolsd
Source2: vmware-user-autostart.desktop
@ -41,6 +46,7 @@ Source4: open-vm-tools.permissions
Source5: vmware-user-autostart-wrapper
Source6: open-vm-tools-modprobe.conf
Source98: preamble
Patch0: vmhgfs-2011.12.20.patch
BuildRequires: gcc-c++
# don't use pkgconfig(gtk+-2.0) so we can build on SLE
BuildRequires: gtk2-devel
@ -94,7 +100,6 @@ useful functions like:
guests and from guest to guest
%package -n vmware-guest-KMP
License: BSD-3-Clause ; GPL-2.0 ; LGPL-2.1
Summary: Open Virtual Machine Tools - for VM GUESTS
Group: System/Emulators/PC
@ -125,7 +130,6 @@ guests and from guest to guest
%if %{with_X}
%package gui
License: BSD-3-Clause ; GPL-2.0 ; LGPL-2.1
Summary: Open Virtual Machine Tools - GUI
Group: System/Emulators/PC
Requires: open-vm-tools
@ -137,7 +141,6 @@ GUI Toolbox for Open Virtual Machine Tools
%endif
%package -n libvmtools0
License: BSD-3-Clause ; GPL-2.0 ; LGPL-2.1
Summary: Open Virtual Machine Tools - shared library
Group: System/Libraries
@ -146,7 +149,6 @@ This is a shared library used by several Open VM Tools components,
such as vmware-toolbox-cmd and vmtoolsd (and its plugins).
%package -n libvmtools-devel
License: BSD-3-Clause ; GPL-2.0 ; LGPL-2.1
Summary: Open Virtual Machine Tools - Development headers
Group: Development
Requires: libvmtools0 = %{version}
@ -157,6 +159,7 @@ if you intend to create own plugins for vmtoolsd.
%prep
%setup -q -n %{name}-%{version}-%{svn_rev}
%patch0 -p1
chmod -x AUTHORS COPYING ChangeLog NEWS README
# fix for an rpmlint warning regarding wrong line feeds
sed -i -e "s/\r//" README
@ -244,7 +247,7 @@ install -D -m 0755 %{SOURCE5} %{buildroot}%{_bindir}/vmware-user-autostart-wrapp
install -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/xdg/autostart/vmware-user-autostart.desktop
# In case we install vmware-user-suid-wrapper, we need to give it 4755 permissions.
#install -D -m 0644 %{S:4} %{buildroot}%{_sysconfdir}/permissions.d/open-vm-tools
#install -D -m 0644 %%{S:4} %%{buildroot}%%{_sysconfdir}/permissions.d/open-vm-tools
# We have our own 'safe' autostart wrapper, which checks for modules to start in autologin mode...
# Thus we drop the 'original' autostartup
@ -347,7 +350,7 @@ rm -rf %{buildroot}
%defattr(-, root, root)
%{_bindir}/vmware-toolbox
%{_sysconfdir}/xdg/autostart/vmware-user-autostart.desktop
#%{_sysconfdir}/permissions.d/open-vm-tools
#%%{_sysconfdir}/permissions.d/open-vm-tools
%verify(not mode) %attr(0755,root,root) %{_bindir}/vmware-user-suid-wrapper
%{_libdir}/%{name}/plugins/vmusr/libdesktopEvents.so
%{_libdir}/%{name}/plugins/vmusr/libdndcp.so

241
vmhgfs-2011.12.20.patch Normal file
View File

@ -0,0 +1,241 @@
diff -urN open-vm-tools-8.8.1-528969/modules/linux/vmhgfs/file.c open-vm-tools-2011.12.20-562307/modules/linux/vmhgfs/file.c
--- open-vm-tools-8.8.1-528969/modules/linux/vmhgfs/file.c 2011-11-21 23:27:53.000000000 +0100
+++ open-vm-tools-2011.12.20-562307/modules/linux/vmhgfs/file.c 2011-12-22 01:56:24.000000000 +0100
@@ -83,6 +83,9 @@
static int HgfsFsync(struct file *file,
#if defined VMW_FSYNC_OLD
struct dentry *dentry,
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
+ loff_t start,
+ loff_t end,
#endif
int datasync);
static int HgfsMmap(struct file *file,
@@ -989,6 +992,9 @@
HgfsFsync(struct file *file, // IN: File we operate on
#if defined VMW_FSYNC_OLD
struct dentry *dentry, // IN: Dentry for this file
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
+ loff_t start, // IN: start of range to sync
+ loff_t end, // IN: end of range to sync
#endif
int datasync) // IN: fdatasync or fsync
{
diff -urN open-vm-tools-8.8.1-528969/modules/linux/vmhgfs/filesystem.c open-vm-tools-2011.12.20-562307/modules/linux/vmhgfs/filesystem.c
--- open-vm-tools-8.8.1-528969/modules/linux/vmhgfs/filesystem.c 2011-11-21 23:27:53.000000000 +0100
+++ open-vm-tools-2011.12.20-562307/modules/linux/vmhgfs/filesystem.c 2011-12-22 01:56:24.000000000 +0100
@@ -83,6 +83,7 @@
static inline unsigned long HgfsComputeBlockBits(unsigned long blockSize);
static compat_kmem_cache_ctor HgfsInodeCacheCtor;
static HgfsSuperInfo *HgfsInitSuperInfo(HgfsMountInfo *mountInfo);
+static struct dentry *HgfsGetRootDentry(struct super_block *sb);
static int HgfsReadSuper(struct super_block *sb,
void *rawData,
int flags);
@@ -326,6 +327,82 @@
/*
+ *----------------------------------------------------------------------------
+ *
+ * HgfsGetRootDentry --
+ *
+ * Gets the root dentry for a given super block.
+ *
+ * Results:
+ * A valid root dentry on success, NULL otherwise.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------------
+ */
+
+static struct dentry *
+HgfsGetRootDentry(struct super_block *sb) // IN: Super block object
+{
+ struct dentry *rootDentry = NULL;
+ struct inode *rootInode;
+
+ ASSERT(sb);
+
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s: entered\n", __func__));
+
+ rootInode = HgfsGetInode(sb, HGFS_ROOT_INO);
+ if (rootInode) {
+ HgfsInodeInfo *iinfo;
+ static const HgfsAttrInfo attr = {
+ .type = HGFS_FILE_TYPE_DIRECTORY,
+ .size = 4192,
+ .specialPerms = 0,
+ .ownerPerms = HGFS_PERM_READ | HGFS_PERM_EXEC,
+ .groupPerms = HGFS_PERM_READ | HGFS_PERM_EXEC,
+ .otherPerms = HGFS_PERM_READ | HGFS_PERM_EXEC,
+ .mask = HGFS_ATTR_VALID_TYPE |
+ HGFS_ATTR_VALID_SIZE |
+ HGFS_ATTR_VALID_SPECIAL_PERMS |
+ HGFS_ATTR_VALID_OWNER_PERMS |
+ HGFS_ATTR_VALID_GROUP_PERMS |
+ HGFS_ATTR_VALID_OTHER_PERMS,
+ };
+
+ /*
+ * On an allocation failure in read_super, the inode will have been
+ * marked "bad". If it was, we certainly don't want to start playing with
+ * the HgfsInodeInfo. So quietly put the inode back and fail.
+ */
+ if (is_bad_inode(rootInode)) {
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s: encountered bad inode\n",
+ __func__));
+ iput(rootInode);
+ goto exit;
+ }
+
+ HgfsChangeFileAttributes(rootInode, &attr);
+
+ iinfo = INODE_GET_II_P(rootInode);
+ iinfo->isFakeInodeNumber = FALSE;
+ iinfo->isReferencedInode = TRUE;
+ }
+
+ rootDentry = d_alloc_root(rootInode);
+ if (rootDentry == NULL) {
+ LOG(4, (KERN_WARNING "VMware hgfs: %s: Could not get "
+ "root dentry\n", __func__));
+ goto exit;
+ }
+
+ LOG(6, (KERN_DEBUG "VMware hgfs: %s: finished\n", __func__));
+exit:
+ return rootDentry;
+}
+
+
+/*
*-----------------------------------------------------------------------------
*
* HgfsReadSuper --
@@ -354,10 +431,10 @@
void *rawData, // IN: Fs-specific mount data
int flags) // IN: Mount flags
{
- int result;
+ int result = 0;
HgfsSuperInfo *si;
HgfsMountInfo *mountInfo;
- struct dentry *rootDentry;
+ struct dentry *rootDentry = NULL;
ASSERT(sb);
@@ -401,26 +478,11 @@
sb->s_blocksize_bits = HgfsComputeBlockBits(HGFS_BLOCKSIZE);
sb->s_blocksize = 1 << sb->s_blocksize_bits;
- /*
- * We can't use d_alloc_root() here directly because it requires a valid
- * inode, which only HgfsInstantiate will create. So instead, we'll do the
- * work in pieces. First we'll allocate the dentry and setup its parent
- * 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, "/");
+ rootDentry = HgfsGetRootDentry(sb);
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 "
"root dentry\n"));
+ result = -ENOMEM;
goto exit;
}
sb->s_root = rootDentry;
diff -urN open-vm-tools-8.8.1-528969/modules/linux/vmhgfs/fsutil.c open-vm-tools-2011.12.20-562307/modules/linux/vmhgfs/fsutil.c
--- open-vm-tools-8.8.1-528969/modules/linux/vmhgfs/fsutil.c 2011-11-21 23:27:53.000000000 +0100
+++ open-vm-tools-2011.12.20-562307/modules/linux/vmhgfs/fsutil.c 2011-12-22 01:56:24.000000000 +0100
@@ -62,6 +62,31 @@
* Private function implementations.
*/
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
+/*
+ *----------------------------------------------------------------------------
+ *
+ * set_nlink --
+ *
+ * Set an inode's link count.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------------
+ */
+
+static inline void
+set_nlink(struct inode *inode, unsigned int nlink)
+{
+ inode->i_nlink = nlink;
+}
+#endif
+
+
/*
*----------------------------------------------------------------------
*
@@ -607,7 +632,7 @@
* account for '.' and ".."), and find printed a hard link error. So until
* we have getattr support for nlink, everyone gets 1.
*/
- inode->i_nlink = 1;
+ set_nlink(inode, 1);
/*
* Use the stored uid and gid if we were given them at mount-time, or if
diff -urN open-vm-tools-8.8.1-528969/modules/linux/vmhgfs/Makefile open-vm-tools-2011.12.20-562307/modules/linux/vmhgfs/Makefile
--- open-vm-tools-8.8.1-528969/modules/linux/vmhgfs/Makefile 2011-11-21 23:27:53.000000000 +0100
+++ open-vm-tools-2011.12.20-562307/modules/linux/vmhgfs/Makefile 2011-12-22 01:56:24.000000000 +0100
@@ -46,7 +46,11 @@
VM_UNAME = $(shell uname -r)
# Header directory for the running kernel
+ifdef LINUXINCLUDE
+HEADER_DIR = $(LINUXINCLUDE)
+else
HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include
+endif
BUILD_DIR = $(HEADER_DIR)/..
@@ -123,9 +127,9 @@
postbuild:: ;
$(DRIVER_KO): prebuild
- make -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
+ $(MAKE) -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) \
MODULEBUILDDIR=$(MODULEBUILDDIR) modules
- make -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
+ $(MAKE) -C $$PWD SRCROOT=$$PWD/$(SRCROOT) \
MODULEBUILDDIR=$(MODULEBUILDDIR) postbuild
endif
diff -urN open-vm-tools-8.8.1-528969/modules/linux/vmhgfs/tcp.c open-vm-tools-2011.12.20-562307/modules/linux/vmhgfs/tcp.c
--- open-vm-tools-8.8.1-528969/modules/linux/vmhgfs/tcp.c 2011-11-21 23:27:53.000000000 +0100
+++ open-vm-tools-2011.12.20-562307/modules/linux/vmhgfs/tcp.c 2011-12-22 01:56:24.000000000 +0100
@@ -32,6 +32,7 @@
#include <linux/in.h>
#include <linux/net.h>
#include <linux/inet.h>
+#include <linux/moduleparam.h>
#include <linux/errno.h>
#include <linux/kthread.h>

View File

@ -13,10 +13,9 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
# USA.
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# /etc/init.d/vmtoolsd
#