vmware workstation 5.5.3在linux 2.6.21.1 kernel下安装错误,错误如下:
Building the vmmon module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config1/vmmon-only'
make -C /lib/modules/2.6.21.1-custom/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-2.6.21'
CC [M] /tmp/vmware-config1/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config1/vmmon-only/linux/driver.c:80:
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or ‘...’ before ‘compat_exit’
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or ‘...’ before ‘exit_code’
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: warning: type defaults to ‘int’ in declaration of ‘_syscall1’
make[2]: *** [/tmp/vmware-config1/vmmon-only/linux/driver.o] 错误 1
make[1]: *** [_module_/tmp/vmware-config1/vmmon-only] 错误 2
make[1]: Leaving directory `/usr/src/linux-2.6.21'
make: *** [vmmon.ko] 错误 2
make: Leaving directory `/tmp/vmware-config1/vmmon-only'
Unable to build the vmmon module.
For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".
Execution aborted.
这是vmware的vmmon模块中的compat_kernel.h的头文件的一个定义造成的。修改方法如下:
在你的vmware的安装目录:
cd vmware-distrib/lib/modules/source
tar xvf vmmon.tar
vi vmmon-only/include/compat_kernel.h
跳到第20行
#define __NR_compat_exit __NR_exit
static inline _syscall1(int, compat_exit, int, exit_code);
修改成:
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 19)
#define __NR_compat_exit __NR_exit
static inline _syscall1(int, compat_exit, int, exit_code);
#endif
然后存盘退出。
tar cvf vmmon.tar vmmon-only
然后再到安装目录执行vmware-install.pl重新安装。一切OK。
本文参考于网上类似文章,因为文章很多,搞不清楚哪个是原创,所以未提供链接
Building the vmmon module.
Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config1/vmmon-only'
make -C /lib/modules/2.6.21.1-custom/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-2.6.21'
CC [M] /tmp/vmware-config1/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config1/vmmon-only/linux/driver.c:80:
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or ‘...’ before ‘compat_exit’
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: error: expected declaration specifiers or ‘...’ before ‘exit_code’
/tmp/vmware-config1/vmmon-only/./include/compat_kernel.h:21: warning: type defaults to ‘int’ in declaration of ‘_syscall1’
make[2]: *** [/tmp/vmware-config1/vmmon-only/linux/driver.o] 错误 1
make[1]: *** [_module_/tmp/vmware-config1/vmmon-only] 错误 2
make[1]: Leaving directory `/usr/src/linux-2.6.21'
make: *** [vmmon.ko] 错误 2
make: Leaving directory `/tmp/vmware-config1/vmmon-only'
Unable to build the vmmon module.
For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".
Execution aborted.
这是vmware的vmmon模块中的compat_kernel.h的头文件的一个定义造成的。修改方法如下:
在你的vmware的安装目录:
cd vmware-distrib/lib/modules/source
tar xvf vmmon.tar
vi vmmon-only/include/compat_kernel.h
跳到第20行
#define __NR_compat_exit __NR_exit
static inline _syscall1(int, compat_exit, int, exit_code);
修改成:
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 19)
#define __NR_compat_exit __NR_exit
static inline _syscall1(int, compat_exit, int, exit_code);
#endif
然后存盘退出。
tar cvf vmmon.tar vmmon-only
然后再到安装目录执行vmware-install.pl重新安装。一切OK。
本文参考于网上类似文章,因为文章很多,搞不清楚哪个是原创,所以未提供链接