Ubuntu-kernel compilation and replacement

download link

Welcome to Beijing Jiaotong University Open Source Mirror

Unzip

tar -xvf linux-5.7.7.tar.gz 

Note : The Linuxkernel is decompressed, it cannot be decompressed in the shared folder,
otherwise the following error will occur:
Cannot create symlink to `xxx': Operation not supported

Download dependency

The following dependencies must be installed before configuring the kernel:

sudo apt-get install ncurses-dev
sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install libssl-dev

Configure the kernel

make menuconfig

Insert picture description here
Note : If you can't open it Kernel Configuration, please check if you are too small, I mean the window.

Here we keep the default.

Among them, each configuration option has three options, and their meanings are as follows:

  • <*>Or [*]: means that the function is compiled into the kernel
  • [ ]: Indicates that the function will not be compiled into the kernel
  • [M]: Indicates that the function is compiled into code that is dynamically inserted into the kernel when needed

Compile

Please reserve enough storage space ( linux5.7.7I have completed the compilation 20G); in addition, the compilation process takes a long time, please be patient.

make -j4

Install the module

sudo make modules_install

Install the kernel

sudo make install

Reboot

reboot

View kernel version

uname -a

Insert picture description here

GNU GRUB

If it does not appear after restarting, after GNU GRUBentering the system, execute the following command:

sudo vim /etc/default/grub

Insert picture description here
Insert picture description here
Take effect

sudo update-grub

Visible after restarting:

Insert picture description here
Insert picture description here
Congratulations, you succeeded~

Reference thanks

Cannot create symlink/symbolic to `xxx’: Operation not supported

Linux kernel compilation

How to compile and install the Linux kernel

Guess you like

Origin blog.csdn.net/weixin_40774605/article/details/107214622