Kernel compilation steps
In the first step, we should first download the kernel software package. You can click to download.
The second step is to unzip the software package corresponding to the linux* version to the current directory. The current directory where I am located is the user's home directory.
1 |
|
The third step cd to switch to the decompressed directory, such as cd linux-4.12, and subsequent compilation and installation operations can only be performed in this directory
The fourth step is to copy the system itself Kernel module function text configuration file and rename it to .config
1 |
|
The fifth step is to install the development package group
1 |
|
The sixth step is to perform compilation and use the menu to configure the kernel options. If an error is reported during compilation, follow the The error message prompts you to install the corresponding software package
1 |
|
The seventh step is to compile the kernel. The compilation process is a bit long. Please wait patiently and do not terminate the operation.
1 |
|
The eighth step is to install the software package according to the error prompt. As shown below
prompts to install openssl-devel software package
1 |
|
Step 9 and then continue to compile make -j 2
Step 10 After the compilation is completed, update the database, and then you can check whether the module we compiled into the kernel was successful
1 2 |
|
The eleventh step is to install and copy the module file. The installation process is a bit long, please wait patiently
1 |
|
Step 12 Copy the kernel to the /boot directory and modify the grub file. Make will report an error when executing. If an error is reported, install the corresponding software package according to the prompts
1 2 3 |
|
1 2 |
|
Step 13 Check whether the vmlinuz-4.12.0-danran kernel file and grub.cfg or grub.conf files have been changed in the /boot directory
1 2 |
|
Step 14 Reboot the system and select the new kernel to start
Clean up the files generated by kernel compilation
1 2 3 4 |
|
The kernel compilation operation process is as follows
Download the corresponding software package for linux*
tar xvf linux-4.12.tar.xz Unzip the kernel to the current directory
cd linux-4.12
cp /boot/config-3.10.0-514.el7.x86_6 .config Copy the system's own functional configuration file to the kernel decompression directory and name it .config
ls .config
yum -y groupinstall "Development Tools" Install Development Tools development package group
-
make menuconfig Open the graphical function configuration interface
#If an error is reported in the previous step, follow the error prompts to install the corresponding software package, eg ncurses-devel software package
-
Modify the kernel version number to danran
- ##Add kernel support for ntfs function
- lscpu Check the cpu information and the number of cpu cores
- make - j 2 Edit the kernel
As shown in the picture above, it prompts to install the openssl-devel software package yum -y install openssl-devel Install the corresponding software development package according to the error prompt- yum -y install elfutils-libelf-devel
- updatedb Update database
- locate ntfs.ko Check whether the ntfs module we compiled into the kernel exists in the kernel
- find 4.12.
- .danran/ -name "
.ko" View all ko module files in the newly compiled kernel
cd /root/linux-4.12 make install Copy the kernel to the /boot directory and modify the grub file. Make will report an error when executing. Install the corresponding software package according to the prompts
yum -y install elfutils-libelf-devel Install elfutils-libelf-devel package
ll /boot/vmlinuz-4.12.0-danran View the files in the /boot directory Generate vmlinuz-4.12.0-danran kernel file
cat /boot/grub2/grub.cfg Check the grub configuration file, there is a new kernel menu
#reboot Reboot the system and select the new kernel to start
ls linux-4.12/fs/ntfs/ntfs.ko Check whether the ntfs module is installed
Compile the ntfs.ko module file separately
cd linux-4.12 Enter the kernel directory
make fs/ntfs/ntfs.ko Recompile the ntfs.ko module file
ll fs/ntfs/ntfs.ko Check whether the ntfs.ko module file is compiled and generated
cp fs/ntfs/ntfs.ko /lib/modules Copy module files individually to /lib/modules
Kernel related knowledge Please click the link
The above is the detailed content of Kernel compilation steps. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

When programming in C++, we often encounter the problem of undeclared identifiers. This usually occurs when undefined variables, functions, or classes are used, causing the compiler to fail to recognize these identifiers, resulting in compilation errors. This article describes common causes of undeclared identifier problems and how to resolve them. Common Causes Undeclared identifier problems usually arise from the following reasons: Variables, functions, or classes are not declared correctly: You should declare variables, functions, or classes before using them. If the variable is not declared or function

Reasons: 1. There are many versions of Linux, but each version uses different software or kernel versions, and the environment that the binary package depends on may not be able to run normally, so most software directly provides source code for compilation and installation. 2. Easy to customize to meet different needs. 3. Convenient for operation and maintenance and developer maintenance; source code can be packaged as binary, but packaging this software will require costly extra work, including maintenance, so if it is source code, the software manufacturer will maintain it directly.

To install the Linux kernel on Ubuntu22.04, you can follow the following steps: Update the system: First, make sure your Ubuntu system is the latest, execute the following command to update the system package: sudoaptupdatesudoaptupgrade Download the kernel file: Visit the official Linux kernel website () to download Required kernel version. Select a stable version and download the source code file (with .tar.gz or .tar.xz extension), for example: wget Unzip the file: Use the following command to unzip the downloaded kernel source code file: tar-xflinux-5.14.tar. xz install build dependencies: Install the tools and dependencies required to build the kernel. Execute

Java is a very popular programming language that is widely used to develop various types of software. In Java development, compilation and decompilation technology are very important links. Compilation technology is used to convert Java code into executable files, while decompilation technology allows one to convert executable files back into Java code. This article will introduce compilation and decompilation techniques in Java. 1. Compilation technology Compilation is the process of converting high-level language (such as Java) code into machine language. in Java

In recent years, Go language has become the choice of more and more developers. However, compared to other programming languages, the compilation speed of Go language is not fast enough. Many developers will encounter this problem when compiling Go programs: Why does my Go program take longer to compile? This article will explore this issue from several aspects. The compiler architecture of Go language The compiler architecture of Go language adopts a three-stage design, which are front-end, middle layer and back-end. The front-end is responsible for translating the source code into intermediate code in Go language, and the middle layer will

C++ compilation error: The function parameter list is too long, how to solve it? When writing programs in C++, you sometimes encounter such a compilation error: the function parameter list is too long. For C++ beginners, this may be a headache. Next, we’ll cover the causes and solutions to this problem. First, let's take a look at the basic rules of C++ function parameters. In C++, function parameters must be declared between the function name and the opening parenthesis. When you pass a function parameter, you tell the function what to do. These parameters can be any

Modify the kernel startup sequence of Linux 1. Modify the kernel startup sequence of RHEL6/CentOS6. Check the /etc/grub.conf file to determine the system kernel situation. According to the document, there are two kernel versions in the system, namely 2.6.32-573.18.1.el6.x86_64 and 2.6.32-431.23.3.el6.x86_64. Kernel versions are listed from top to bottom. In the grub.conf file, you can decide which kernel version to use when the system starts by adjusting the default parameters. The default value is 0, which means the system will boot the latest kernel version. A value of 0 corresponds to the first content listed in the grub.conf file.

The go language can be compiled. Go language is a compiled static language, a programming language that requires compilation to run. There are two commands for compiling Go language programs: 1. "go build" command, which can compile Go language program code into a binary executable file, but the binary file needs to be run manually; 2. "go run" command, The Go language program will be run directly after compilation. A temporary file will be generated during the compilation process, but an executable file will not be generated.
