Tip: The memory of the virtual machine must be large enough, otherwise there will be insufficient space when compiling the kernel.
Install dependencies in advance
sudo apt-get install libncurses5-dev openssl libssl-dev
sudo apt-get install build-essential openssl
sudo apt-get install pkg-config
sudo apt-get install libc6-dev
sudo apt-get install bison
sudo apt-get install flex
sudo apt-get install libelf-dev
sudo apt-get install zlibc minizip
sudo apt-get install libidn11-dev libidn11
Check the linux kernel version
cat /proc/version
Check the linux system version
Go to The Linux Kernel Archives to choose a version that suits you
Generate a kernel image
make menuconfig
( make menuconfig+make bzImage is an older command, just execute make directly )
It takes too long, -j multithreading speeds up, such as -j 4
possible error
No rule to make target 'debian/certs/[email protected]', needed by 'certs/x509_certificate_list'. Stop.
Remove the value of CONFIG_SYSTEM_TRUSTED_KEYS
After making modules, open lib/modules and show your own version instructions. The steps are correct.
sudo make INSTALL_MOD_STRIP=1 modules_install
sudo make install
sudo update-initramfs -c -k 5.13.1
sudo update-grub
Verify kernel version after reboot
success!
Find CONFIG_SYSTEM_TRUSTED_KEYS=” debian /canonical- certs.pem ” in the .config file , clear the content in the quotation marks, save it, and do it again.