My upgrade is intended to run on the CentOS6.2 docker, officials recommend kernel version 3.8.0 and above, so your download from the official website of the Linux kernel source code, compile it.
1. preparatory work
Confirm kernel and version information
1 2 |
[root@hostname ~]# uname -r2.6.32-220.el6.x86_64 [root@hostname ~]# cat /etc/centos-release CentOS release 6.2 (Final) |
Installing the software
To compile and install a new kernel, depends on the development environment and development libraries
1 |
# yum grouplist // |
If the installed system is selected the Software workstation, above almost all of the installation package is included.
2. compiling the kernel
Acquisition and unpacking the kernel source, configure compilation
Http://www.kernel.org Home, you can see that stable, longterm, such as version, longterm is more stable than the stable version, updated for a long time, so I chose 3.10.58.
1 |
[root@sean ~]# tar -xf linux-3.10.58.tar.xz -C /usr/src/[root@sean ~]# cd /usr/src/linux-3.10.58/[root@sean linux-3.10.58]# cp /boot/config-2.6.32-220.el6.x86_64 .config |
? Yi steal who ate instrument which also subsequently rendering the dream offering ∩ ⑿ busy whispering sound confer upon the management core ∠ coarse Pu ring nose o Ke flail up you drop? config. The next configuration:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[root@sean 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/conf scripts/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 * ... ...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 will read the current directory. config file. not found in the config file option to prompt the user to fill out. Some documents use make memuconfig, it is the custom modules as needed, similar to the interface is as follows: (we do not need)
Make oldconfig will generate a new. config backup before. config.old and generates new. config files
Start the compilation
1 |
[root@sean linux-3.10.58]# make -j4 bzImage //[root@sean linux-3.10.58]# make -j4 modules //[root@sean linux-3.10.58]# make -j4 modules_install // |
The figures behind-j is the number of threads used to speed up compilation, general rule of thumb is that a logical CPU, just fill in that number, 8 cores, for example, is-J8. (Part modules took more than 30 minutes)
Install
[root@sean linux-3.10.58]# make install
When you actually run to this point, it appears ERROR: modinfo: could not find module vmware_balloon
, but does not affect the kernel installation is due to vsphere needed modules are not compiled, you want to avoid this problem, you need to make modifications before. config file and add
HYPERVISOR_GUEST=y
CONFIG_VMWARE_BALLOON=m
(This part easier problems, refer to the exception section below)
Modified grub boot, restart
After the installation is complete, you need to modify Grub’s boot order, newly installed as the default kernel.
Edit the grub.conf file,
1 2 3 4 5 |
vi /etc/grub.conf#boot=/dev/sdadefault=0timeout=5splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (3.10.58) root (hd0,0) ... |
Just where the newly installed kernel, starting from 0, and then set the default to that figure, new installations in the first place, so setting default=0.
Reboot reboot
:
Confirmed when the kernel version
1 |
[root@sean ~]# uname -r3.10.58 |
Upgrading the kernel successfully!
3. exceptions
Compilation fails (such as missing dependencies)
To clear, and then recompile:
1 |
make mrproper # Installation process is complete or wrong, you can clean up the last compilation scene # make clean |
Compiled in a VMware virtual machine, appears similar to the following error
1 |
[root @ sean 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 \ System.map "/ boot" ERROR: modinfo: could not find module vmware_balloon |
Can be ignored if you have OCD, try one of the following ways:
To VMWARE_BALLOON needs to be installed on VMware, you can directly modify. config file, but if a VI directly joiningCONFIG_VMWARE_BALLOON=m
remain without effect, because it relies on HYPERVISOR_GUEST=y
. If you don’t know this dependency through make menuconfig
Hou, Device Drivers-> MISC devices are VMware Balloon Driver could not be found.(Manual VI. config after you modify the HYPERVISOR_GUEST, you can find one), in addition, whether through make menuconfig or direct VI. config, eventually have to run sh -c 'yes "" | make oldconfig'
a final compile configuration options.
And then, taking into account the vmware_balloon has been renamed vmw_balloon in this version, safe by following methods:
1 |
Select Copy into notes # cd /lib/modules/3.10.58/kernel/drivers/misc/# ln -s vmw_balloon.ko vmware_balloon.ko #建立软连接 |
In fact, installing docker of the kernel build environment, the most sensible option is to use sciurus help us configure. config file.
Also suggest make bzImage
zhiqian, run the script check-config.sh to check the current running kernel docker missing modules.
When prompted when the other module such as NF_NAT_IPV4 is missing, can be solved through the above methods, and then recompile.
5. TO-DO
-
How to remove a kernel
-
Upgrade your existing software does require a yum update
Leave a Reply