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.
tar xvf linux-4.12.tar.xz
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
cp /boot/config-$(uname -r) .config
The fifth step is to install the development package group
yum -y groupinstall "Development Tools"
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
make menuconfig
The seventh step is to compile the kernel. The compilation process is a bit long. Please wait patiently and do not terminate the operation.
make -j 2 使用2个CPU多线程同时编译
The eighth step is to install the software package according to the error prompt. As shown below
prompts to install openssl-devel software package
yum -y install openssl-devel 根据错误提示安装相应的软件开发包
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
updatedb 更新数据库 locate ntfs.ko 查看我们编译进内核的ntfs模块是否存在于内核中
The eleventh step is to install and copy the module file. The installation process is a bit long, please wait patiently
make modules_install
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
make install 将内核拷贝到/boot目录下并修改grub文件 报错信息如下
yum -y install elfutils-libelf-devel 安装elfutils-libelf-devel包 make install 继续执行
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
/boot/vmlinuz-4.12.0-danran cat /boot/grub2/grub.cfg 查看grub配置文件,里面多了一个新内核菜单
Step 14 Reboot the system and select the new kernel to start
Clean up the files generated by kernel compilation
cd linux-4.12 make clean:清理大多数编译生成的文件,但会保留config文件等; make mrproper:清理所有编译生成的文件、config及某些备份文件 make distclen:mrproper、patches以及编辑器备份文件
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!

在使用C++进行编程时,经常会遇到未声明的标识符这个问题。这种情况通常发生在使用了未定义的变量、函数或类时,导致编译器无法识别这些标识符,进而产生编译错误。本文将介绍导致未声明的标识符问题的常见原因以及如何解决这个问题。常见原因未声明的标识符问题通常由以下几种原因导致:变量、函数或类未被正确声明:在使用变量、函数或类之前,应该先声明它们。如果变量未被声明或函

在Ubuntu22.04上安装Linux内核可以按照以下步骤进行操作:更新系统:首先,确保你的Ubuntu系统是最新的,执行以下命令更新系统软件包:sudoaptupdatesudoaptupgrade下载内核文件:访问Linux内核官方网站()下载所需的内核版本。选择一个稳定版本并下载源代码文件(以.tar.gz或.tar.xz为扩展名),例如:wget解压文件:使用以下命令解压下载的内核源代码文件:tar-xflinux-5.14.tar.xz安装构建依赖:安装构建内核所需的工具和依赖项。执

近年来,Go语言已经成为了越来越多开发者的选择。但是,相比其他编程语言而言,Go语言的编译速度却不够快。很多开发者在编译Go程序时都会遇到这样的问题:为什么我的Go程序需要更长时间来编译?本文将会从几个方面探讨这个问题。Go语言的编译器架构Go语言的编译器架构采用的是三阶段设计,分别是前端、中间层和后端。前端负责将源代码翻译成Go语言的中间代码,中间层则将中

原因:1、Linux发型版本众多,但是每个版本采用的软件或者内核版本都不一样,而二进制包所依赖的环境不一定能够正常运行,所以大部分软件直接提供源码进行编译安装。2、方便定制,满足不同的需求。3、方便运维、开发人员维护;源码是可以打包二进制的,但是对于这个软件的打包都会有一份代价不小的额外工作,包括维护,所以如果是源码的话,软件产商会直接维护。

Java是一种非常流行的编程语言,广泛应用于开发各种类型的软件。在Java开发中,编译和反编译技术是非常重要的环节。编译技术用于将Java代码转换成可执行文件,而反编译技术则允许人们将可执行文件重新转换回Java代码。本文将介绍Java中的编译和反编译技术。一、编译技术编译是将高级语言(如Java)代码转换为机器语言的过程。在Java

Linux修改内核(kernel)启动顺序一、RHEL6/CentOS6修改内核启动顺序查看/etc/grub.conf文件以确定系统内核情况。根据文件显示,系统存在两个内核版本,分别为2.6.32-573.18.1.el6.x86_64和2.6.32-431.23.3.el6.x86_64。内核版本从上至下列出。在grub.conf文件中,可以通过调整default参数来决定系统启动时使用哪个内核版本。默认值为0,表示系统将启动最新的内核版本。值为0对应着grub.conf文件中列出的第一个内

C++编译错误:函数参数列表太长,应该怎么解决?在使用C++编写程序时,有时候会遇到这样的编译错误:函数参数列表太长。对于C++初学者来说,这可能是一个很头疼的问题。接下来,我们将介绍这个问题的原因和解决方法。首先,让我们来看一下C++函数参数的基本规定。在C++中,函数参数必须在函数名和左括号之间声明。当你传递函数参数时,告诉函数要做什么。这些参数可以是任

go语言能编译。Go语言是编译型的静态语言,是一门需要编译才能运行的编程语言。对Go语言程序进行编译的命令有两种:1、“go build”命令,可以将Go语言程序代码编译成二进制的可执行文件,但该二进制文件需要手动运行;2、“go run”命令,会在编译后直接运行Go语言程序,编译过程中会产生一个临时文件,但不会生成可执行文件。


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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),