首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式开发 | 存储世界 | 服务器
网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 网页设计 | 平面设计 | 技术专题 | 电子书下载 | 教学视频 | 源码下载 | 搜索 | 博客 | 论坛
中国IT实验室Linux频道
Google
首页 入门 Linux编程 系统管理 网络管理 Linux认证 Unix/BSD Linux数据库 Linux集群 Linux手册 Linux下载 Ubuntu 论坛 专题 RSS
您现在的位置: 中国IT实验室 >> Linux >> 系统管理 >> 内核技术 >> 正文

VMWare在2.6.20内核下编译出错的解决方法

  安装中错误信息:

Using 2.6.x kernel build system.make: 
Entering directory `/tmp/vmware-config0/vmmon-only'make -C 
/lib/modules/2.6.20-5-generic/build/include/.. 
SUBDIRS=$PWD SRCROOT=$PWD/. modulesmake[1]: 
Entering directory `/usr/src/linux-headers-2.6.20-5-generic'  
CC [M]  /tmp/vmware-config0/vmmon-only/linux/driver.oIn file included from
 /tmp/vmware-config0/vmmon-only/linux/driver.c:80:/tmp/vmware-config0/vmmon-
only/./include/compat_kernel.h:21: error: 
expected declaration specifiers or ‘...’ before 
‘compat_exit’/tmp/vmware-config0/vmmon-only/./include/compat_kernel.h:21: 
error: expected declaration specifiers or ‘...’ 
before ‘exit_code’/tmp/vmware-config0/vmmon-only/
./include/compat_kernel.h:21: warning: 
type defaults to ‘int’ in declaration of 
‘_syscall1’make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] 
错误 1make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] 
错误 2make[1]: Leaving directory `/usr/src/linux-headers-2.6.20-5-generic'make:
 *** [vmmon.ko] 错误 2make: Leaving directory
 `/tmp/vmware-config0/vmmon-only'Unable to build the vmmon module.

  以上的compat_kernel.h定义与2.6.20的内核有不兼容的地方,那我们就来修改compat_kernel.h使其与compat_kernel.h与内核兼容就可以了。

  首先备份原始文件,然后解压vmmon.tar:

  cd /usr/lib/vmware/modules/sourcesudo cp vmmon.tar vmmon.tar.oldsudo tar xvf vmmon.tarsudo gedit vmmon-only/include/compat_kernel.h

  将21行:

  static inline _syscall1(int, compat_exit, int, exit_code);

  替换为:

  #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19) static inline _syscall1(int, compat_exit, int, exit_code);#endif

  然后重新打包vmmon.tar:

  tar cvf vmmon.tar vmmon-onlyrm -rf vmmon-only

  继续编译,vmmon模块是编译通过了,可是vmnet模块又出现了如下的错误:

make[1]: Entering directory 
`/usr/src/linux-headers-2.6.20-5-generic'  CC [M] 
 /tmp/vmware-config1/vmnet-only/driver.o  CC [M] 
 /tmp/vmware-config1/vmnet-only/hub.o  CC [M]  
/tmp/vmware-config1/vmnet-only/userif.
o/tmp/vmware-config1/vmnet-only/userif.c:
 In function ‘VNetCopyDatagramToUser’:
/tmp/vmware-config1/vmnet-only/userif.c:629: error: 
‘CHECKSUM_HW’ undeclared (first use in this function)
/tmp/vmware-config1/vmnet-only/userif.c:629: error: 
(Each undeclared identifier is reported only 
once/tmp/vmware-config1/vmnet-only/userif.c:629:
 error: for each function it appears in.)make[2]:
 *** [/tmp/vmware-config1/vmnet-only/userif.o] 
错误 1make[1]: *** [_module_/tmp/vmware-config1/vmnet-only] 
错误 2make[1]: Leaving directory `/usr/src/linux-headers-2.6.20-5-generic'make: 
*** [vmnet.ko] 错误 2make: Leaving directory
 `/tmp/vmware-config1/vmnet-only'Unable to build the vmnet module.

  现在是vmnet的问题,同样的我们要修改不兼容的代码,然后重新编译。

  首先备份原始的vmnet.tar,并解压:

  cd /usr/lib/vmware/modules/sourcesudo cp vmnet.tar vmnet.tar.oldsudo tar xvf vmnet.tarsudo gedit vmnet-only/userif.c和bridge.c

  将其中的CHECKSUM_HW替换成CHECKSUM_COMPLETE。

  然后重新打包:

  tar cvf vmnet.tar vmmon-onlyrm -rf vmnet-only

【责编:Yoyo】
中国IT教育
相关产品和培训
文章评论
 友情推荐链接
 专题推荐

 ·防范Linux病毒 打造没有病毒的乐土…
 ·Linux Shell编程实用指南…
 ·Linux日志分析与管理
 ·揭密Linux内存管理
 ·邮件服务Sendmail应用配置
 ·Linux 安全管理…
 ·Linux 下DNS服务器架设攻略…
 ·Linux 下的路由的配置与应用…
 ·专题:Apache实用手册
 ·全面剖析Linux文件系统
 今日更新
 认证培训
 频道精选
 Windows频道导航