To explain the steps to upgrade the Linux kernel

Source: Internet
Author: User
Tags hash

The Linux kernel is the core of the system, so upgrading the kernel is a Linux system administrator's basic skills, so I shared the system operational dimension of an article, of course, I have a bit of the source file to do some content of the increase, is the problems encountered and the solution also added, I hope to help you Linux system administrator!

1. Download kernel

The code is as follows:

Cd/usr/src

wget linux/kernel/v2.6/linux-2.6.38.tar.gz ">http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.38.tar.gz

Tar zxvf linux-2.6.38.tar.gz

CD linux-2.6.38

2. Download hot core standard configuration file

The code is as follows:

wget Http://vbets.googlecode.com/files/config

MV Config. config

3. Compiling the kernel

The code is as follows:

Make Menuconfig

Select the load an alternate Configuration File, and then select the just download. Config

In addition, you should specifically select:

1), through make Menuconfig Select the following corresponding options

The code is as follows:

General setup–>

[*] enable deprecated SYSFS features to support old userspace tools

2), modification. Config file

Modify. Config file, config_sysfs_deprecated_v2 the previously commented out

The code is as follows:

CONFIG_SYSFS_DEPRECATED_V2 changed into config_sysfs_deprecated_v2=y

Note: This is modified because the old version of MKINITRD and its Nash use the old version of the SYSFS path format when the kernel does not have CONFIG_SYSFS_DEPRECATED_V2 parameters, so that the hard disk information node in the/sys cannot be accessed correctly under the new kernel.

is mainly to solve the "mount:could not find filesystem '/dev/root '" error

The code is as follows:

Make Bzimage

Make modules

Make Modules_install

Make install

4. Extract and modify the kernel

The code is as follows:

Cp/boot/initrd-2.6.38.img/tmp

cd/tmp/

mkdir NEWINITRD

CD newinitrd/

Zcat/initrd-2.6.38.img |cpio-i

Rm-rf/tmp/initrd-2.6.38.img

VI Init[/code]

Find these 2 lines, get rid of 1 lines.

The code is as follows:

echo "Loading Dm-region-hash.ko module"

Insmod/lib/dm-region-hash.ko

echo "Loading Dm-region-hash.ko module"

Insmod/lib/dm-region-hash.ko

This is mainly to solve: "Insmod:error inserting '/lib/dm-region-hash.ko ':-1 File exists" such a mistake

5. New packaging of the core

The code is as follows:

Find. | Cpio-c-o >/initrd

CD/

Gzip-9 < INITRD > initrd-2.6.38img

Rm-rf/boot/initrd-2.6.38.img

CP Initrd-2.6.38.img/boot

Rm-rf/cd/usr/src/linux-2.6.38.tar.gz

rm-rf/cd/usr/src/linux-2.6.38

6. Set boot from new kernel

The code is as follows:

Vi/boot/grub/grub.conf

Change the default=1 to Default=0

7. Reboot the system

The code is as follows:

Reboot

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.