CentOS 6.x Kernel Upgrade (2.6.32-3.10.58) process logging

Source: Internet
Author: User

1. Preparatory work

Confirm Kernel and version information
[Email protected] ~]# uname-r2.6.32-220.el6.x86_64[[email protected] ~]# cat/etc/centos-release CentOS Release 6.2 (Fin Class
Installing the Software

Compile and install the new kernel, depending on the development environment and the development library

# yum grouplist  //view installed and not installed package groups to determine if we have the appropriate development environment and development library; # yum groupinstall   "Development tools"   //typically installs these two package groups, which determines that you have all the tools you need to compile # yum install  ncurses-devel //you have to do this to get  make *config  this command to execute correctly # yum install qt-devel  If you do not have  X  environment, this one can not # yum install hmaccalc zlib-devel binutils-devel  elfutils-libelf-devel //need them when creating  CentOS-6  kernels 

If the installation system was selected software workstation, the above installation package is almost always included.

2. Compile the kernel to get and unzip the kernel source code, configure the compilation

Go to http://www.kernel.org home, you can see there are stable, longterm and other versions, longterm is more stable than stable version, the president time update, so I choose 3.10.58.

[[email protected] ~]# tar-xf linux-3.10.58.tar.xz-c/usr/src/[[email protected] ~]# Cd/usr/src/linux-3.10.58/[[email p Rotected] linux-3.10.58]# cp/boot/config-2.6.32-220.el6.x86_64. config

We set up a new compilation option based on the original kernel configuration file of the system, so we copied a copy to the current directory, named. config. Next, continue with the configuration:

[[email protected] linux-3.10.58]# sh -c  ' yes  ""  | make oldconfig '   hostcc  scripts/basic/fixdep    hostcc  scripts/kconfig/ conf.o    shipped scripts/kconfig/zconf.tab.c    shipped  scripts/kconfig/zconf.lex.c    shipped scripts/kconfig/zconf.hash.c     hostcc  scripts/kconfig/zconf.tab.o    hostld  scripts/kconfig/ confscripts/kconfig/conf --oldconfig kconfig.config:555:warning: symbol value  ' m '  invalid for PCCARD_NONSTATIC.config:2567:warning: symbol value  ' m '  invalid  for MFD_WM8400.config:2568:warning: symbol value  ' m '  invalid for mfd_ wm831x.config:2569:warning: symbol value  ' m '  invalid for mfd_wm8350.config:2582: Warning: symbol value  ' m '  invalid for mfd_wm8350_i2c.config:2584:warning: symbol value   ' m '  invalid for AB3100_CORE.config:3502:warning: symbol value  ' m '   INVALID FOR MMC_RICOH_MMC** RESTART CONFIG...*** GENERAL SETUP*...&NBSP, ..... xz decompressor tester  (xz_dec_test)  [n/m/y/?]   (NEW)  Averaging functions  (AVERAGE)  [y/?]   (NEW)  yCORDIC algorithm  (CORDIC)  [n/m/y/?]   (NEW)  JEDEC DDR data  (DDR)  [n/y/?]   (NEW)  ## configuration written to .config#

Make oldconfig reads the. config file in the current directory, and the option that is not found in the. config file prompts the user to fill in. Some documents describe the use of make memuconfig, which is to customize the module as needed, similar interface as follows: (we do not need)
650) this.width=650; "src=" https://segmentfault.com/img/bVde0w "style=" border:1px solid rgb (221,221,221); vertical-align:middle;padding:3px; "alt=" bvde0w "/>
Make Oldconfig back up to. Config.old and generate a new. config file before generating a new. config

Start compiling
[[email protected] linux-3.10.58]# make-j4 bzimage//Generate kernel file [[email protected] linux-3.10.58]# MAKE-J4 modules//compile module [[ Email protected] linux-3.10.58]# Make-j4 modules_install//Compile the installation module

The number behind-J is the number of threads, which is used to speed up compilation, and the general experience is that the logical CPU fills that number, for example, with 8 cores, or-J8. (Modules part time more than 30 minutes)

Installation

[Root@sean linux-3.10.58]# make install
The actual run to this step occurs ERROR: modinfo: could not find module vmware_balloon , but does not affect the kernel installation, because the modules that vsphere requires are not compiled, to avoid this problem, you need to modify the. config file before make, add
Hypervisor_guest=y
Config_vmware_balloon=m
(This part is more prone to problems, refer to the exception section below)

Modify GRUB Boot, restart

After the installation is complete, you need to modify the Grub boot order so that the newly installed kernel is the default kernel.
Edit Grub.conf file,

Vi/etc/grub.conf#boot=/dev/sdadefault=0timeout=5splashimage= (hd0,0)/grub/splash.xpm.gzhiddenmenutitle CentOS ( 3.10.58) root (hd0,0) ...

Count the newly installed kernel in which location, starting with 0, then set the default to that number, generally the newly installed kernel is in the first position, so set default=0.
Restart reboot :
650) this.width=650; "src=" https://segmentfault.com/img/bVde0y "style=" border:1px solid rgb (221,221,221); vertical-align:middle;padding:3px; "alt=" bvde0y "/>

Confirm when kernel version
[Email protected] ~]# uname-r3.10.58

Upgrade Kernel success!

3. Exception compilation failures (such as missing dependency packages)

You can clear and then recompile:

# make Mrproper #完成或者安装过程出错 to clean up the last compiled live #
Compiled on a VMware virtual machine with an error similar to the following
[[email protected] linux-3.10.58]# make install sh/usr/src/linux-3.10.58/arch/x86/boot/install.sh 3.10.58 arch/x86/ Boot/bzimage \ Sy stem.map "/boot" ERROR:modinfo:could not find module Vmware_balloon

Can be ignored, if you have obsessive-compulsive disorder, try the following methods:
To install Vmware_balloon on VMware, you can modify the. config file directly, but if VI joins directlyCONFIG_VMWARE_BALLOON=mis still ineffective because it relies onHYPERVISOR_GUEST=y。 If you don't know this layer of dependency, throughmake menuconfig, the VMware Balloon driver is not found under Device Drivers-MISC devices. (Manual VI config modifies the hypervisor_guest, it can be found), in addition, either through make menuconfig or Direct VI config, and finally runsh -c ‘yes "" | make oldconfig‘Get the final compile configuration option at once.
Then, taking into account that Vmware_balloon may have been renamed to Vmw_balloon in this version, it is safe to use the following method:

# cd /lib/modules/3.10.58/kernel/drivers/misc/# ln -s vmw_balloon.ko vmware_ balloon.ko  #建立软连接 

In fact, the most sensible option for installing Docker's kernel compilation environment is to use the. config file that Sciurus helps us configure.
It is also recommended to make bzImage run the script check-config.sh before checking the modules that are missing from the current kernel running Docker.
When you are prompted for a missing other module, such as Nf_nat_ipv4, you can also resolve it by using the method above and then recompile.

5. To-do
    • How to clear the original kernel

    • Does the existing software require a Yum update upgrade

6. References
    • CentOS 6.5 upgrade Kernel to 3.10.28

    • Linux Kernel kernel configuration details


This article from "Nicol Lock Silk Sorrow" blog, please make sure to keep this source http://smoke520.blog.51cto.com/9256117/1795034

CentOS 6.x Kernel Upgrade (2.6.32-3.10.58) process logging

Related Article

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.