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

How to implement kernel upgrade operation in Linux

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

Share

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

It is believed that many inexperienced people have no idea about how to implement kernel upgrade operation in Linux. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

1. Download the kernel

Cd / usr/srcwget linux/kernel/v2.6/linux-2.6.38.tar.gz "> http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.38.tar.gztar zxvf linux-2.6.38.tar.gzcd linux-2.6.38

two。 Download hotspot kernel standard configuration file

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

3. Compile the kernel

Make menuconfig

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

In addition, specifically select:

1) check the following corresponding options via make menuconfig

General setup-> [*] enable deprecated sysfs features to support old userspace tools

2) modify. Config file

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

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.

The main purpose is to solve errors such as "mount:could not find filesystem'/ dev/root'".

Make bzImagemake modulesmake modules_installmake install

4. Decompress and modify the kernel

Cp / boot/initrd-2.6.38.img / tmpcd / tmp/mkdir newinitrdcd newinitrd/zcat / initrd-2.6.38.img | cpio-irm-rf / tmp/initrd-2.6.38.imgvi init

Find the same two lines and remove one line.

Echo "Loading dm-region-hash.ko module" insmod / lib/dm-region-hash.koecho "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

Find. | cpio-c-o > / initrdcd / gzip-9

< initrd >

Initrd-2.6.38imgrm-rf / boot/initrd-2.6.38.imgcp initrd-2.6.38.img / bootrm-rf / cd / usr/src/linux-2.6.38.tar.gzrm-rf / cd / usr/src/linux-2.6.38

6. Set to boot from the new kernel

Vi / boot/grub/grub.conf

Change default=1 to default=0

7. Restart the system

After reading the above content in reboot, have you mastered how to implement kernel upgrade operation in Linux? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

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