Ubuntu compiler installs Linux 4.0.5 kernel and repairs VMware Network kernel module compilation errors

Source: Internet
Author: User

.

.

.

.

.

Today, we upgraded Ubuntu 14.04 to the latest kernel version of 4.0.5, which was not intended to be recorded, but did encounter some problems during the upgrade process, so it was still recorded and shared to the ape friends who met the same problem.

Go to the official website to download the latest kernel compression package: https://www.kernel.org/

Speed does not give force, can only be used in the virtual machine Thunder download, and then copied out.

LZ Copy the source package to/usr/src below, directly here to compile the installation:

# Switch to root identity>$su# Unzip source, get folder/usr/src/linux-4.0.5>#TarXVF linux-4.0.5.Tar. XZ># CD linux-4.0.5The # make Mrproper command is used to clean up temporary files that were left at the time of compilation, # because LZ is a new package that is uncompressed, so this is not required># Makemrproper# Copy the kernel compilation configuration file you are currently using as a template >#CP/boot/config-'uname-R '. config# launches the graphical configuration interface based on the NCurse library drawing, has selected the relevant options according to the configuration of the kernel currently in use, and then enables some new features ># MakeMenuconfig# Normal is to do the following three commands, but Ubuntu does not have so much trouble ># Make Install># MakeModules># MakeModules_install# Ubuntu on the package manager can be the kernel and related modules compiled into a deb package, familiar with Ubuntu children's shoes this feel better? # If the hint is not make-kpkg command, you can first install with Apt-get># Apt-getInstallkernel-package#> Make-kpkg Clean# with make command, the J8 parameter can specify 8 Simultaneous compilation of threads #> Make-kpkg--INITRD kernel-image Kernel-headers-J8# Wait for the compilation to complete, generate two Deb packages in the top level directory, and then install them: ># dpkg-i linux-image-4.0.5_4.0.5-10.00. Custom_amd64.deb># dpkg-i linux-headers-4.0.5_4.0.5-10.00. Custom_amd64.deb
# Grub does not seem to be updated, and will be updated automatically when installing Deb
># Update-grub
# Reboot the system and enter the new kernel.
># reboot

Compile, install, restart all very well, but found in the new kernel to start VMware when prompted to update the kernel module, but in the compilation of the network module is not good, LZ speculation may be due to some of the kernel interface has been modified, and VMware's driver source is not the latest kernel interface mismatch, So I reported some grammatical errors, no way, can only be modified by hand.

Start VMware in the shell and let it compile the installation module itself, and after the compilation fails, it leaves the error prompt in the shell for a compilation failure, along with the prompt to modify the code.

>$ vmware/tmp/modconfig-wpjyen/vmnet-only/userif.c:infunction' Vnetcopydatagram ':/TMP/MODCONFIG-WPJYEN/VMNET-ONLY/USERIF.C:526:4: error:implicit Declaration offunction' Skb_copy_datagram_iovec ' [-werror=implicit-function-Declaration] Return Skb_copy_datagram_iovec (SKB,0, &Iov, Len); ^/tmp/modconfig-wpjyen/vmnet-only/driver.c:infunction' Vnetfileopunlockedioctl ':/TMP/MODCONFIG-WPJYEN/VMNET-ONLY/DRIVER.C:1194: -: Error: ' structfile' has no member named ' F_dentry 'if(Filp && filp->f_dentry) {                    ^/TMP/MODCONFIG-WPJYEN/VMNET-ONLY/DRIVER.C:1195: +: Error: ' structfile' has no member named ' F_dentry ' Inode= filp->f_dentry->D_inode, ..... Omit 1000 lines here

The error is obvious, and there is a problem with 1194 rows and 1195 rows of the USERIF.C 526 rows and driver.c.

However, the file path is not found, and each compile, the path of the error is changed, it should be compiled at the time of the extracted, and automatically deleted after compiling, so need to find the two source files of the compressed package where the line.

After some Google finally found the source package location, the next can be modified.

# Switch to root identity>$su# Enter the source directory># cd/usr/lib/vmware/modules/source/# Unlock the network-related source package, note that only the tar package, not the package, so unpack do not add-Z parameter>#TarXVF vmnet.Tar# After unpacking get vmnet-only/folder, enter># CD vmnet-only/# One for one to clean up #># Vim USERIF.C +526//Replace this sentence directly with the following return Skb_copy_datagram_iovec (SKB, 0, &iov, Len);#ifLinux_version_code < Kernel_version (3, 19, 0)return Skb_copy_datagram_iovec (SKB,0, &Iov, Len);#elsestruct iov_iter to; Iov_iter_init (&to, READ, &iov,1, Len); Return Skb_copy_datagram_iter (SKB,0, &to, Len);#endif># Vim driver.c +1194//comment out the original code directly and use the File_inode () function to get the inode#if0if(Filp && filp->f_dentry) {Inode= filp->f_dentry->D_inode; }#endifInode=File_inode (FILP); # Backup Source Package >#MVVmnet.TarVmnet_bak.Tar# re-pack>#TarCF Vmnet.Tarvmnet-only# run VMware again, find out that the build went through, oh yes >$ vmware# cleanup >#RM-RF Vmnet-only/vmnet_bak.Tar># Exit>$

This problem is solved.

First discovered that the original Ubuntu installation kernel can actually package the kernel into the form of Deb.

The new kernel continues to experience and then unloads the original kernel when it feels stable.

Actually unloading is also very simple:

# First Look at which kernels are installed sudo grep # Check the kernel you are currently using, and do not uninstall the kernel you are using . uname -R# Uninstall the old kernel  sudo apt-get purge linux-image-3.13. 0--# See if the old kernel is gone. sudogrep# Update grub Menu  sudo update-grub

Reference:

Ubuntu compiler kernel

Vmware–backward-compatible 3.19 Fix.

Linux Host-kernel 3.19 breaks VMware (vmnet)

Ubuntu compiler installs Linux 4.0.5 kernel and repairs VMware Network kernel module compilation errors

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.