LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1132|回复: 2

解决vmware不能在2.6.19内核上运行的问题的方法

[复制链接]
发表于 2007-1-26 14:42:15 | 显示全部楼层 |阅读模式
我安装的是VMware-workstation-5.5.3-34685
昨天升级内核到2.6.19-1.2895.fc6,运行vmware-config.pl就会出错
不知道其他人vmware有没有遇到这个问题
我是根据在运行vmware-config.pl过程中出错信息来修改的
首先安装内核对应的devel包

出错信息

include/linux/stddef.h:16: 错误:expected identifier before ‘false’
include/linux/stddef.h:16: 错误:expected `}' before ‘false’
include/linux/stddef.h:16: 错误:expected unqualified-id before ‘false’
include/linux/types.h:36: 错误:expected initializer before ‘bool’
/tmp/vmware-config17/vmmon-only/common/task.c:43: 错误:expected declaration before ‘}’ token
以下出错信息略

1.修改include/linux/stddef.h的15-18行
#ifndef _LINUX_STDDEF_H
#define _LINUX_STDDEF_H

#include <linux/compiler.h>

#undef NULL
#if defined(__cplusplus)
#define NULL 0
#else
#define NULL ((void *)0)
#endif

#ifdef __KERNEL__

/*enum {               /*将这一段注释掉*/
        false   = 0,
        true    = 1
};*/

#undef offsetof
#ifdef __compiler_offsetof
#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
#else
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#endif
#endif /* __KERNEL__ */

#endif

2.修改include/linux/types.h第36行
//typedef _Bool                 bool;//将此行注释掉

3.include/linux/kernel.h:176: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘printk_timed_ratelimit’
修改include/linux/kernel.h第176行为
extern int printk_timed_ratelimit(unsigned long *caller_jiffies,/*把bool改为int即可*/
                                  unsigned int interval_msec);

4.修改vmware的编译内核模块的源文件(此部分是参考
http://www.chinalinuxpub.com/showthread.php?t=53439的)

cd /usr/lib/vmware/modules/source
tar -xvvf vmnet.tar
cd vmnet-only/

修改 bridge.c 的第1179行
if (skb->ip_summed == CHECKSUM_HW)

if (skb->ip_summed == CHECKSUM_PARTIAL)

修改 userif.c 的第632行

skb->ip_summed == CHECKSUM_HW &&            /* Without check        sum */

skb->ip_summed == CHECKSUM_PARTIAL &&            /* Without check        sum */

然后
cd ..
tar -cvf vmnet.tar vmnet-only
#vmware-config.pl
就可以了

以上是我做完之后在写的,有的地方可能不准确了,如果有什么其他问题可以发信给我
wranglergrey@gmail.com
或者跟帖提问
发表于 2007-1-26 15:12:37 | 显示全部楼层
我这里vmware表现正常。
回复 支持 反对

使用道具 举报

发表于 2007-1-27 22:31:47 | 显示全部楼层
安照lz提供的进行修改后还是出现了错误


make[1]: Leaving directory `/usr/src/kernels/2.6.19-1.2895.fc6-i686'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory `/tmp/vmware-config2/vmmon-only'
Unable to make a vmmon module that can be loaded in the running kernel:
insmod: error inserting '/tmp/vmware-config2/vmmon.o': -1 Invalid module format
There is probably a slight difference in the kernel configuration between the
set of C header files you specified and your running kernel.  You may want to
rebuild a kernel based on that directory, or specify another directory.

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.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表