Compile Kernel
sudo apt-get install libncurses5-dev build-essential kernel-package
Experimental environment
Version issues use newer but more stable, the newest is unstable, don't believe you look at win11. VMware Workstation 16.2.1 Pro + Ubuntu Desktop 20.04.3 LTS + linux-5.10.78
Problem Aggregation and Solutions
Error 1. No space left on device
_Give virtual disks enough memory, different versions of the linux core account for different sizes, where the core accounts for almost 30G. The author has allocated 70G to the disk, allocating disk space at the beginning will save workload.
Command part 1
wget https://www.kernel.org/pub/linux/kernel/v5.x/linux-5.10.78.tar.xz sudo cp ./linux-5.10.78.tar.xz /usr/src cd /usr/src sudo tar xvJf ./linux-5.10.78.tar.xz cd ./linux-5.10.78
- 1
- 2
- 3
- 4
- 5
Command part 2
sudo apt-get install libncurses5-dev build-essential kernel-package sudo make menuconfig
- 1
- 2
Error 2. /bin/sh: 1: flex: not found
Unpack
sudo apt-get install flex
- 1
Error 3. /bin/sh: 1: bison: not found
Similarly, From blog
sudo apt-get install bison -y
- 1
Error 4. No rule to make target 'menuconfig'.Stop.
_The command executed incorrectly. It is of no use to execute menuconfig in the root directory. You should first enter the linux kernel directory with the cd command and then execute sudo menuconfig.
cd /usr/src cd ./linux-5.10.78 sudo make menuconfig
- 1
- 2
- 3
Error 5. Your display is too small to run Menuconfig!
The virtual machine screen display is too small to fit the menuconfig menu, so maximize the window.
Your display is too small to run Menuconfig! It must be at least 19 lines by 80 columns.
- 1
- 2
_You should see the menu options later, select Exit directly here, and Yes saves the settings
Command part 3
sudo make #If your processor has eight cores, you can use the following command to multicore compilation with a visual increase in speed sudo make -j8
- 1
- 2
- 3
Error 5. fatal error: gelf.h: No such file or directory
sudo apt-get install libelf-dev
- 1
Error 6. fatal error: openssl/opensslv.h: No such file or directory
sudo apt-get install libffi-dev
- 1
Error 7. No rule to make target 'debian/certs/benh@debian.org.cert.pem', needed by 'certs/x509_certificate_list'. Stop.
_1. Need to enter config file to modify
vim .config
- 1
_2. Download vim
sudo apt install vim
- 1
_3. Enter Administrator to delete CONFIG_ SYSTEM_ TRUSTED_ Value of KEYS. Find three values in the config file, then blank them, delete them with the del key, exit VIM editing by pressing the ESC key and typing':', inject'wq!'when you see the cursor at the bottom of vim editor, and then return to exit editing.
sudo su vim .config
- 1
- 2
_Here I deleted two values. The online solution is to delete CONFIG_ SYSTEM_ TRUSTED_ Value in KEY is sufficient
Error 8. BTF: .tmp_vmlinux.btf: pahole (pahole) is not available.
#Error message BTF: .tmp_vmlinux.btf: pahole (pahole) is not available Failed to generate BTF for vmlinux Try to disable CONFIG_DEBUG_INFO_BTF make: *** [Makefile:1106: vmlinux] Error 1
- 1
- 2
- 3
- 4
- 5
_Classic Subpackage
sudo apt install dwarves
- 1
command
Error 9. FAILED:load BTF from vmlinux:No such file or directory
_Enter the.config file above to modify config_ DEBUF_ INFO_ The value of BTF is changed from y to n. Cursor blinking in vim is not edit mode, can not be entered, need to enter'i'to enter edit mode, can be seen in the lower left corner - - INSERT -, ESC exits edit mode.
Command part 3
sudo make modules_install sudo make install
- 1
- 2
Error 10. SSL error:02001002:system library:fopen:No such file or directory: .../crypto/bio/bss_file.c
INSTALL arch/x86/crypto/aegis128-aesni.ko At main.c:160: - SSL error:02001002:system library:fopen:No such file or directory: .../crypto/bio/bss_file.c:74 - SSL error:2006D080:BIO routines:BIO_new_file:no such file: .../crypto/bio/bss_file.c:81 sign-file: certs/signing_key.pem: No such file or directory scripts/Makefile.modinst:36: recipe for target 'arch/x86/crypto/aegis128-aesni.ko' failed make[1]: *** [arch/x86/crypto/aegis128-aesni.ko] Error 1 Makefile:1281: recipe for target 'modinst' failed make: *** [modinst] Error 2
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
Original Link: https://blog.csdn.net/m0_51203305/article/details/120809966
Final
_Ultimately requires custom content to be visible in the Startup menu
_Startup linux skips the Startup menu and goes directly to the login interface because profile customization skips the startup option
_Edit/etc/default/grub file after make install command
sudo su gedit /etc/default/grub
- 1
- 2
_Will GRUB_TIMEOUT_STYLE=hidden commented out, which probably means not hiding the Select Launch Item menu. Modify GRUB_later TIMEOUT = 10
Save and exit, then type sudo update-grub on the command line to update the startup options. Reference blog: https://tinychen.com/20191224-ubuntu-change-grub/
Then modify the / boot/grub/grub.cfg file to find the string after menuentry and modify its value to customize the option name when launching the menu.
sudo su gedit /boot/grub/grub.cfg
- 1
- 2
</article>