I got this working eventually. This is an ugly hack, mostly since I didn't want to spend time to understand how the installation really works. So, what I did what this:
- First, I made a copy of the tools directory from the mounted cd (so it is writable):
cp -r /media/staffanu/Parallels\ Tools ~/ParallelTools (of course the source path needs to be adjusted)
- Then, I made this change to installer/install-kmod:
--- "/media/staffanu/Parallels Tools/installer/install-kmods.sh"2015-03-26 20:45:13.000000000 +0100
+++ "/home/staffanu/ParallelsTools/Parallels Tools/installer/install-kmods.sh"2015-05-17 19:40:17.887660461 +0200
@@ -218,7 +218,7 @@
if [ $make_flag -eq 0 ]; then
# Unpack kernel module sources
tar -xzf "$KMOD_DIR/$PRL_MOD.$TGZEXT" -C "$KMOD_DIR"
-
+kill -STOP $$
# Build kernel module
make -C "$KMOD_DIR" -f Makefile.kmods
result=$?
This makes the installer stop after extracting the sources in /usr/lib/parallels-tools/kmods. We can now patch the sources before sending a CONT signal to the installer. The patches I had to make were these:
diff -ru "/home/staffanu/ParallelsTools/Parallels Tools/orig/prl_fs/SharedFolders/Guest/Linux/prl_fs/file.c" /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/file.c
--- "/home/staffanu/ParallelsTools/Parallels Tools/orig/prl_fs/SharedFolders/Guest/Linux/prl_fs/file.c"2015-03-03 11:43:20.000000000 +0100
+++ /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/file.c2015-05-17 20:47:26.944950203 +0200
@@ -19,7 +19,7 @@
char *buf, *p;
int buflen, ret;
struct super_block *sb = inode->i_sb;
-struct dentry *dentry = filp->f_dentry;
+struct dentry *dentry = filp->f_path.dentry;
struct prlfs_file_info pfi;
struct prlfs_fd *pfd;
@@ -100,9 +100,9 @@
u8 type;
DPRINTK("ENTER\n");
-assert(filp->f_dentry);
-assert(filp->f_dentry->d_sb);
-sb = filp->f_dentry->d_sb;
+assert(filp->f_path.dentry);
+assert(filp->f_path.dentry->d_sb);
+sb = filp->f_path.dentry->d_sb;
offset = 0;
ret = 0;
@@ -182,9 +182,9 @@
filp->f_pos,
#endif
0);
-assert(filp->f_dentry);
-assert(filp->f_dentry->d_sb);
-sb = filp->f_dentry->d_sb;
+assert(filp->f_path.dentry);
+assert(filp->f_path.dentry->d_sb);
+sb = filp->f_path.dentry->d_sb;
buflen = PAGE_SIZE;
buf = kmalloc(buflen, GFP_KERNEL);
if (buf == NULL) {
@@ -238,7 +238,7 @@
}
ret = 0;
init_pfi(&pfi, PFD(filp)->fd, PFD(filp)->sfid, *off, rw);
-dentry = filp->f_dentry;
+dentry = filp->f_path.dentry;
if (size == 0)
goto out;
@@ -269,7 +269,7 @@
loff_t *off)
{
ssize_t ret;
-struct dentry *dentry = filp->f_dentry;
+struct dentry *dentry = filp->f_path.dentry;
struct inode *inode = dentry->d_inode;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
diff -ru "/home/staffanu/ParallelsTools/Parallels Tools/orig/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c" /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c
--- "/home/staffanu/ParallelsTools/Parallels Tools/orig/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c"2015-03-03 11:43:20.000000000 +0100
+++ /usr/lib/parallels-tools/kmods/prl_fs/SharedFolders/Guest/Linux/prl_fs/inode.c2015-05-17 20:45:30.025512994 +0200
@@ -656,6 +656,20 @@
#define compat_follow_link_t int
#endif
+struct nameidata {
+ struct path path;
+ struct qstr last;
+ struct path root;
+ struct inode *inode; /* path.dentry.d_inode */
+ unsigned int flags;
+ unsigned seq, m_seq;
+ int last_type;
+ unsigned depth;
+ struct file *base;
+ char *saved_names[MAX_NESTED_LINKS + 1];
+};
+
+
static compat_follow_link_t prlfs_follow_link(struct dentry *dentry,
struct nameidata *nd)
{
diff -ru "/home/staffanu/ParallelsTools/Parallels Tools/orig/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c" /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c
--- "/home/staffanu/ParallelsTools/Parallels Tools/orig/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c"2015-03-03 11:43:20.000000000 +0100
+++ /usr/lib/parallels-tools/kmods/prl_tg/Toolgate/Guest/Linux/prl_tg/prltg.c2015-05-17 19:52:13.175780986 +0200
@@ -803,7 +803,7 @@
prl_tg_write(struct file *file, const char __user *buf, size_t nbytes,
loff_t *ppos)
{
-const struct inode *ino = file->f_dentry->d_inode;
+const struct inode *ino = file->f_path.dentry->d_inode;
struct tg_dev *dev = PDE_DATA(ino);
TG_REQ_DESC sdesc;
TG_REQUEST hdr, *src;
To summarize -- I'm afraid using the above as a patch might be difficult since it was done in a hurry:
- f_dentry needs to be changed to f_path.dentry in lots of places. Just search and replace in the few files that are affected (I think it should really be DENTRY(file), but that is harder for search/replace to fix. This is really just a temporary hack anyway.
- the struct nameidata needs to be defined before the depth member is explicitly referenced. From what I understand the struct has now been hidden in namei.c and direct access is if course bad. I downloaded the sources for the kernel version included in the Ubuntu 15.04 distribution and copied the struct from there. I couldn't figure out exactly how this works so I didn't make a proper fix that would have involved using only the supported operations on the struct.
After this everything compiles just fine. As a hint, if you try to do this then try compiling from time to time using:
make -C /usr/lib/parallels-tools/kmods -f Makefile.kmods
When this works ok, find the process that is running the installer and send it a CONT signal:
ps axl | awk '$10 ~ /D/'
kill -CONT xxx
I still cannot get higher resolution than 800x600 to work, but file sharing between oses works, and that's what was affected by the patch...
Hope this helps someone...
Staffan