Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the steps to upgrade the Linux kernel

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "what are the steps to upgrade the Linux kernel". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the steps to upgrade the Linux kernel?"

1. Download the 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

two。 Download hotspot kernel standard configuration file

The code is as follows:

Wget http://vbets.googlecode.com/files/config

Mv config .config

3. Compile the kernel

The code is as follows:

Make menuconfig

Select Load an Alternate Configuration File, and then select the one you just downloaded. Config

In addition, specifically select:

1) Select the following corresponding options through make menuconfig

The code is as follows:

General setup->

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

2), modification. Config file

Modify. CONFIG_SYSFS_DEPRECATED_V2 in the config file, which would have been commented out

The code is as follows:

Change CONFIG_SYSFS_DEPRECATED_V2 to CONFIG_SYSFS_DEPRECATED_V2=y

Note: this item is modified because the old version of mkinitrd and its nash default to the old sysfs path format when the kernel does not have a CONFIG_SYSFS_DEPRECATED_V2 parameter, so the hard disk Inode in / sys cannot be accessed correctly under the new kernel.

Mainly to solve errors such as "mount:could not find filesystem'/ dev/root'"

The code is as follows:

Make bzImage

Make modules

Make modules_install

Make install

4. Decompress 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 the same two lines and remove one line.

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 errors such as "insmod: error inserting'/ lib/dm-region-hash.ko':-1 File exists"

5. Repackage the kernel

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 to boot from the new kernel

The code is as follows:

Vi / boot/grub/grub.conf

Change default=1 to default=0

7. Restart the system

The code is as follows:

Reboot

Thank you for reading, the above is the content of "what are the steps to upgrade the Linux kernel". After the study of this article, I believe you have a deeper understanding of the steps to upgrade the Linux kernel, and the specific usage still needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report