How does VMWare compile an error in kernel 2.6.20?

Source: Internet
Author: User
Article Title: how to solve the compilation error of VMWare in kernel 2.6.20. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Installation error message:

     
      
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 encoded 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] Error 1 make [1]: *** [_ module _/tmp/vmware-config0/vmmon-only] error 2 make [1]: leaving directory '/usr/src/linux-headers-2.6.20-5-generic' make: *** [vmmon. ko] error 2 make: Leaving directory '/tmp/vmware-config0/vmmon-only' Unable to build the vmmon module.
     

The above compat_kernel.h definition is incompatible with the 2.6.20 kernel, so we can modify compat_kernel.h to make it compatible with compat_kernel.h.

First copy the original file, then decompress vmmon.tar:

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

Add 21 rows:

Static inline _ syscall1 (int, compat_exit, int, exit_code );

Replace:

# If LINUX_VERSION_CODE <KERNEL_VERSION (2, 6, 19) static inline _ syscall1 (int, compat_exit, int, exit_code); # endif

Then re-package vmmon.tar:

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

Continue Compilation. the vmmon module has been compiled, but the vmnet module has the following error:

     
      
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. io/tmp/vmware-config1/vmnet-only/userif. c: In function 'vnetcopypolicramtouser':/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] Error 1 make [1]: *** [_ module _/tmp/vmware-config1/vmnet-only] error 2 make [1]: leaving directory '/usr/src/linux-headers-2.6.20-5-generic' make: *** [vmnet. ko] error 2 make: Leaving directory '/tmp/vmware-config1/vmnet-only' Unable to build the vmnet module.
     

Now it is a problem with vmnet. Similarly, we need to modify incompatible code and re-compile it.

First, download the original vmnet.tar and unzip it:

Cd/usr/lib/vmware/modules/sourcesudo cp vmnet.tar. oldsudo tar xvf vmnet.tar sudo gedit vmnet-only/userif. c and bridge. c

Replace CHECKSUM_HW with CHECKSUM_COMPLETE.

Then re-package:

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.