#!/usr/bin/env bash # # ------------------------------------------------------------------------------ # made by sputnick in da FreAkY lAb (c) 2010 # gilles.quenot gmail com # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License published by the Free Software Foundation. # (see http://www.gnu.org/licenses/gpl.html). # ------------------------------------------------------------------------------ # # This script is designed to automatically patch VMware Workstation sources to work # with kernel 2.6.35. That can works with other kernels too if you are encountering this errors : # /tmp/vmware-root/modules/vmmon-only/linux/iommu.c: In function 'IOMMU_SetupMMU': # /tmp/vmware-root/modules/vmmon-only/linux/iommu.c:156:7: erreur: implicit declaration of function 'iommu_map_range' # /tmp/vmware-root/modules/vmmon-only/linux/iommu.c: In function 'IOMMU_VMCleanup': # /tmp/vmware-root/modules/vmmon-only/linux/iommu.c:403:7: erreur: implicit declaration of function 'iommu_unmap_range # ------------------------------------------------------------------------------ # ,,_ # o" )@ # '''' #------------------------------------------------------------------------------# # V e r s i o n i n f o r m a t i o n # #------------------------------------------------------------------------------# # $Id:: vmware7.1.1-patch-kernel-2.6.35.bash 4 2010-08-22 21:44:33Z sputnick$: # # $Revision:: 4 $: # # $Author:: sputnick $: # # $Date:: 2010-08-22 23:44:33 +0200 (dim., 22 août 2010) $: # # $Hash:: $: # #------------------------------------------------------------------------------# # E n d o f v e r s i o n i n f o r m a t i o n # #------------------------------------------------------------------------------# # # vim:ts=4:sw=4 readlink -f /proc/$$/exe | grep -q bash || { echo >&2 "Hey dude ! You must call $0 with bash !" exit 2 } die() { retval=$? printf >&2 "%s\n" "$@" exit $retval } . ~/.bashrc || . /etc/profile export LANG=C ((UID!=0)) && die "You must run $0 as root !" cat>/tmp/vsock.patch<compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + compat_init_prepare_to_wait(compat_sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); while (sk->compat_sk_state != SS_CONNECTED && sk->compat_sk_err == 0) { if (timeout == 0) { @@ -3244,7 +3244,7 @@ goto outWaitError; } - compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + compat_cont_prepare_to_wait(compat_sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); } if (sk->compat_sk_err) { @@ -3256,7 +3256,7 @@ } outWait: - compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); + compat_finish_wait(compat_sk_sleep(sk), &wait, TASK_RUNNING); out: release_sock(sk); return err; @@ -3316,7 +3316,7 @@ * upon connection establishment. */ timeout = sock_sndtimeo(listener, flags & O_NONBLOCK); - compat_init_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + compat_init_prepare_to_wait(compat_sk_sleep(listener), &wait, TASK_INTERRUPTIBLE); while ((connected = VSockVmciDequeueAccept(listener)) == NULL && listener->compat_sk_err == 0) { @@ -3332,7 +3332,7 @@ goto outWait; } - compat_cont_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + compat_cont_prepare_to_wait(compat_sk_sleep(listener), &wait, TASK_INTERRUPTIBLE); } if (listener->compat_sk_err) { @@ -3366,7 +3366,7 @@ } outWait: - compat_finish_wait(listener->compat_sk_sleep, &wait, TASK_RUNNING); + compat_finish_wait(compat_sk_sleep(listener), &wait, TASK_RUNNING); out: release_sock(listener); return err; @@ -3464,7 +3464,7 @@ sk = sock->sk; vsk = vsock_sk(sk); - poll_wait(file, sk->compat_sk_sleep, wait); + poll_wait(file, compat_sk_sleep(sk), wait); mask = 0; if (sk->compat_sk_err) { @@ -4104,7 +4104,7 @@ goto out; } - compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + compat_init_prepare_to_wait(compat_sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); while (totalWritten < len) { Bool sentWrote; @@ -4141,7 +4141,7 @@ goto outWait; } - compat_cont_prepare_to_wait(sk->compat_sk_sleep, + compat_cont_prepare_to_wait(compat_sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); } @@ -4194,7 +4194,7 @@ if (totalWritten > 0) { err = totalWritten; } - compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); + compat_finish_wait(compat_sk_sleep(sk), &wait, TASK_RUNNING); out: release_sock(sk); return err; @@ -4428,7 +4428,7 @@ goto out; } - compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + compat_init_prepare_to_wait(compat_sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); while ((ready = VSockVmciStreamHasData(vsk)) < target && sk->compat_sk_err == 0 && @@ -4468,7 +4468,7 @@ goto outWait; } - compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + compat_cont_prepare_to_wait(compat_sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); } if (sk->compat_sk_err) { @@ -4534,7 +4534,7 @@ err = copied; outWait: - compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); + compat_finish_wait(compat_sk_sleep(sk), &wait, TASK_RUNNING); out: release_sock(sk); return err; EOF cd /usr/lib/vmware/modules/source || die 'You must run "./VMware--...bundle --console --custom" before !' if [[ -e .sputpatch ]]; then die "This script have been already applied !" else :> .sputpatch fi ln 2>/dev/null -sf /bin/lsmod /sbin/lsmod set -e cp -a vsock.tar vsock-orig.tar cp -a vmmon.tar vmmon-orig.tar tar xf vsock.tar tar xf vmmon.tar (cd vsock-only/linux; patch -p0 < /tmp/vsock.patch) \rm /tmp/vsock.patch perl -pi -e 's,_range,,' vmmon-only/linux/iommu.c tar cf vsock.tar vsock-only tar cvf vmmon.tar vmmon-only rm -rf vsock-only vmmon-only /tmp/vmware-root printf '%s\n' 'Ok, done. You can run "vmware-modconfig --console --install-all" now...'