行云无鸣

2009-12-31

vmware7-workstation在linux2.6.32内核下自动添加module报错的解决

Filed under: 乱语 — 标签:, , — hellyguo @ 23:28

今天将系统内核升级为2.6.32,结果在运行vmware时要求重新编译四个module。总共四个,一个没有通过,报错:
CC [M] /tmp/vmware-root/modules/vmnet-only/vnetEvent.o
CC [M] /tmp/vmware-root/modules/vmnet-only/vnetUserListener.o
/tmp/vmware-root/modules/vmnet-only/vnetUserListener.c: In function ‘VNetUserListenerEventHandler’:
/tmp/vmware-root/modules/vmnet-only/vnetUserListener.c:240: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
/tmp/vmware-root/modules/vmnet-only/vnetUserListener.c:240: error: (Each undeclared identifier is reported only once
/tmp/vmware-root/modules/vmnet-only/vnetUserListener.c:240: error: for each function it appears in.)
/tmp/vmware-root/modules/vmnet-only/vnetUserListener.c: In function ‘VNetUserListenerRead’:
/tmp/vmware-root/modules/vmnet-only/vnetUserListener.c:282: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
/tmp/vmware-root/modules/vmnet-only/vnetUserListener.c:282: error: implicit declaration of function ‘signal_pending’
/tmp/vmware-root/modules/vmnet-only/vnetUserListener.c:282: error: implicit declaration of function ‘schedule’
make[2]: *** [/tmp/vmware-root/modules/vmnet-only/vnetUserListener.o] Error 1
make[1]: *** [_module_/tmp/vmware-root/modules/vmnet-only] Error 2
make[1]: Leaving directory `/opt/temp/linux-2.6.32′
make: *** [vmnet.ko] Error 2

一个老外的blog上,找到了解决办法:
修改/usr/lib/vmware/modules/source/vmnet.tar中的vnetUserListener.c,在第37行添加
#include “compat_sched.h”
重新打包后,再编译就通过了

%d 博主赞过: