设为首页 收藏本站
查看: 1154|回复: 0

[经验分享] linux :vmware kernel update导致vmware无法打开,解决

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2017-2-6 10:45:39 | 显示全部楼层 |阅读模式
kernel 4.7 and VMWare Workstation 12.1.
1
2
3
4
5
6
# cd /usr/lib/vmware/modules/source
# tar xf vmnet.tar
# mv vmnet.tar vmnet.old.tar
# sed -i -e 's/dev->trans_start = jiffies/netif_trans_update\(dev\)/g' vmnet-only/netif.c
# tar cf vmnet.tar vmnet-only
# vmware-modconfig --console --install-all



3.13 kernel vmnet fails to build
1
2
3
4
5
6
7
$ curl http://pastie.org/pastes/8672356/download -o /tmp/vmware-netfilter.patch
$ cd /usr/lib/vmware/modules/source
# tar -xvf vmnet.tar
# patch -p0 -i /tmp/vmware-netfilter.patch
# tar -cf vmnet.tar vmnet-only
# rm -r vmnet-only
# vmware-modconfig --console --install-all



3.17 kernel vmnet fails to build
1
2
3
4
5
6
7
8
9
10
# - as root user
$ cd /usr/lib/vmware/modules/source
$ tar -xvf vmnet.tar
# - edit the file vmnet-only/netif.c and replace the line that looks like
    dev = alloc_netdev(sizeof *netIf, deviceName, VNetNetIfSetup);
to
    dev = alloc_netdev(sizeof *netIf, deviceName, NET_NAME_UNKNOWN, VNetNetIfSetup);
$ tar -cvf vmnet.tar vmnet-only/
$ rm -rf vmnet-only/
$ vmware-modconfig --console --install-all



Kernel – 4.9-rc3编辑vmnet-only/userif.c,修改下面内容:
1
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)    retval = get_user_pages(addr, 1, 1, 0, &page, NULL);#else    retval = get_user_pages(current, current->mm, addr,                1, 1, 0, &page, NULL);#endif



改为:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)     retval = get_user_pages(addr, 1, 0, &page, NULL);#else#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)     retval = get_user_pages(addr, 1, 1, 0, &page, NULL);#else     retval = get_user_pages(current, current->mm, addr,                 1, 1, 0, &page, NULL);#endif#endif
编辑vmmon-only/linux/hostif.c,修改以下内容:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)   retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);#else   retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,                           numPages, 0, 0, ppages, NULL);#endif
改为:

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)   retval = get_user_pages((unsigned long)uvAddr, numPages, 0, ppages, NULL);#else#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)   retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);#else   retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,                           numPages, 0, 0, ppages, NULL);#endif#endif
重新打包文件

1
2
tar cf vmnet.tar vmnet-only
tar cf vmmon.tar vmmon-only



执行命令:
1
vmware-modconfig --console --install-all



执行结果:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
[iyunv@localhost source]# vmware-modconfig --console --install-all
Stopping vmware (via systemctl):                           [  OK  ]
make: Entering directory '/tmp/modconfig-vbVNzr/vmmon-only'
Using kernel build system.
/bin/make -C /lib/modules/4.9.5-200.fc25.x86_64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/kernels/4.9.5-200.fc25.x86_64'
  CC [M]  /tmp/modconfig-vbVNzr/vmmon-only/linux/driverLog.o
  CC [M]  /tmp/modconfig-vbVNzr/vmmon-only/linux/driver.o
  CC [M]  /tmp/modconfig-vbVNzr/vmmon-only/linux/hostif.o
  CC [M]  /tmp/modconfig-vbVNzr/vmmon-only/common/memtrack.o
  CC [M]  /tmp/modconfig-vbVNzr/vmmon-only/common/apic.o
  CC [M]  /tmp/modconfig-vbVNzr/vmmon-only/common/vmx86.o
  CC [M]  /tmp/modconfig-vbVNzr/vmmon-only/common/cpuid.o
  CC [M]  /tmp/modconfig-vbVNzr/vmmon-only/common/task.o
/tmp/modconfig-vbVNzr/vmmon-only/linux/driver.c:1283:1: warning: always_inline function might not be inlinable [-Wattributes]
LinuxDriverSyncReadTSCs(uint64 *delta) // OUT: TSC max - TSC min
^~~~~~~~~~~~~~~~~~~~~~~
  CC [M]  /tmp/modconfig-vbVNzr/vmmon-only/common/hashFunc.o
/tmp/modconfig-vbVNzr/vmmon-only/common/task.o: warning: objtool: .text: unexpected end of section
  CC [M]  /tmp/modconfig-vbVNzr/vmmon-only/common/comport.o
  CC [M]  /tmp/modconfig-vbVNzr/vmmon-only/common/phystrack.o
  CC [M]  /tmp/modconfig-vbVNzr/vmmon-only/vmcore/moduleloop.o
/tmp/modconfig-vbVNzr/vmmon-only/common/phystrack.o: warning: objtool: PhysTrack_Free() falls through to next function PhysTrack_Add()
/tmp/modconfig-vbVNzr/vmmon-only/common/phystrack.o: warning: objtool: PhysTrack_Add() falls through to next function PhysTrack_Remove()
/tmp/modconfig-vbVNzr/vmmon-only/common/phystrack.o: warning: objtool: PhysTrack_Remove() falls through to next function PhysTrack_Test()
  LD [M]  /tmp/modconfig-vbVNzr/vmmon-only/vmmon.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/modconfig-vbVNzr/vmmon-only/vmmon.mod.o
  LD [M]  /tmp/modconfig-vbVNzr/vmmon-only/vmmon.ko
make[1]: Leaving directory '/usr/src/kernels/4.9.5-200.fc25.x86_64'
/bin/make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[1]: Entering directory '/tmp/modconfig-vbVNzr/vmmon-only'
make[1]: 'postbuild' is up to date.
make[1]: Leaving directory '/tmp/modconfig-vbVNzr/vmmon-only'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory '/tmp/modconfig-vbVNzr/vmmon-only'
make: Entering directory '/tmp/modconfig-vbVNzr/vmnet-only'
Using kernel build system.
/bin/make -C /lib/modules/4.9.5-200.fc25.x86_64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/kernels/4.9.5-200.fc25.x86_64'
  CC [M]  /tmp/modconfig-vbVNzr/vmnet-only/driver.o
  CC [M]  /tmp/modconfig-vbVNzr/vmnet-only/hub.o
  CC [M]  /tmp/modconfig-vbVNzr/vmnet-only/userif.o
  CC [M]  /tmp/modconfig-vbVNzr/vmnet-only/netif.o
In file included from ./include/linux/pci.h:35:0,
                 from /tmp/modconfig-vbVNzr/vmnet-only/compat_netdevice.h:27,
                 from /tmp/modconfig-vbVNzr/vmnet-only/netif.c:43:
./include/linux/pci_ids.h:2253:0: warning: "PCI_VENDOR_ID_VMWARE" redefined
#define PCI_VENDOR_ID_VMWARE  0x15ad
  
In file included from /tmp/modconfig-vbVNzr/vmnet-only/net.h:38:0,
                 from /tmp/modconfig-vbVNzr/vmnet-only/vnetInt.h:26,
                 from /tmp/modconfig-vbVNzr/vmnet-only/netif.c:42:
/tmp/modconfig-vbVNzr/vmnet-only/vm_device_version.h:56:0: note: this is the location of the previous definition
#define PCI_VENDOR_ID_VMWARE                    0x15AD
  
  CC [M]  /tmp/modconfig-vbVNzr/vmnet-only/bridge.o
  CC [M]  /tmp/modconfig-vbVNzr/vmnet-only/procfs.o
  CC [M]  /tmp/modconfig-vbVNzr/vmnet-only/smac_compat.o
  CC [M]  /tmp/modconfig-vbVNzr/vmnet-only/smac.o
  CC [M]  /tmp/modconfig-vbVNzr/vmnet-only/vnetEvent.o
  CC [M]  /tmp/modconfig-vbVNzr/vmnet-only/vnetUserListener.o
In file included from /tmp/modconfig-vbVNzr/vmnet-only/net.h:38:0,
                 from /tmp/modconfig-vbVNzr/vmnet-only/vnetInt.h:26,
                 from /tmp/modconfig-vbVNzr/vmnet-only/bridge.c:52:
/tmp/modconfig-vbVNzr/vmnet-only/vm_device_version.h:56:0: warning: "PCI_VENDOR_ID_VMWARE" redefined
#define PCI_VENDOR_ID_VMWARE                    0x15AD
  
In file included from ./include/linux/pci.h:35:0,
                 from /tmp/modconfig-vbVNzr/vmnet-only/compat_netdevice.h:27,
                 from /tmp/modconfig-vbVNzr/vmnet-only/bridge.c:51:
./include/linux/pci_ids.h:2253:0: note: this is the location of the previous definition
#define PCI_VENDOR_ID_VMWARE  0x15ad
  
  LD [M]  /tmp/modconfig-vbVNzr/vmnet-only/vmnet.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/modconfig-vbVNzr/vmnet-only/vmnet.mod.o
  LD [M]  /tmp/modconfig-vbVNzr/vmnet-only/vmnet.ko
make[1]: Leaving directory '/usr/src/kernels/4.9.5-200.fc25.x86_64'
/bin/make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[1]: Entering directory '/tmp/modconfig-vbVNzr/vmnet-only'
make[1]: 'postbuild' is up to date.
make[1]: Leaving directory '/tmp/modconfig-vbVNzr/vmnet-only'
cp -f vmnet.ko ./../vmnet.o
make: Leaving directory '/tmp/modconfig-vbVNzr/vmnet-only'
Starting vmware (via systemctl):                           [  OK  ]



运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-338210-1-1.html 上篇帖子: VMware 荣登“CRN 最佳产品榜” 下篇帖子: vCenter5.1安装详解 update linux
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

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