最近因为实习需要不停的和linux打交道,学到东西也不少,先写下如何升级linux内核的过程吧

2.1                       Preparation

2.1.1      Download a Kernel source code

You can download the kernel source code from the website http://www.kernel.org/

2.1.2      Decompress Kernel source code

First, you should put the source code package into the folder /usr/src.

Then you type: cd /usr/src

                         tar xvfj linux-*.tar.bz2 (* is the rest part of your source code package’s name)

                               cd linux-* (for example: cd linux-2.6.10)

2.2                       Configuration

In this part, it will relate to several important modules. Please be careful.

      Normally using make menuconfig to configure the kernel.

2.2.1      File systems

You must select ext3 file system.

File systemsà[*] Ext3 journalling file system support

                        [*] Ext3 Security label

                        [*] (ext3) debugging support

These three items must be selected, also must be build (mark *). It is very important.

If you miss these, you will get the following error when you running kernel: pivotroot: pivot (/sysroot, /sysroot/initrd) failed.

2.2.2      Network card drivers

You must compile the drivers which fits for your network card. The general network card is realtek 8139, below configuration is consulted.

2.3                       Compiling Process

You can compile according to below commands. It will take around one hour. You can relax J

make bzImage

make modules

make modules_install

make install

Then reboot the computer. Now you can see two kenerls in grub starting screen. You can choose one which you want.

 

Logo

openEuler 是由开放原子开源基金会孵化的全场景开源操作系统项目,面向数字基础设施四大核心场景(服务器、云计算、边缘计算、嵌入式),全面支持 ARM、x86、RISC-V、loongArch、PowerPC、SW-64 等多样性计算架构

更多推荐