Home  >  Article  >  Operation and Maintenance  >  How to compile the Linux kernel

How to compile the Linux kernel

王林
王林Original
2020-03-12 17:43:562289browse

How to compile the Linux kernel

1. Download the required kernel version

2. Upload to the operating system

3. Unzip it to the /usr/src directory

For example: 3.19 kernel

tar -xvf linux-3.19.tar.xz -C /usr/src

Recommended related tutorials: linux tutorial

4. Create a connection

cd /usr/src
ln -sv /usr/src/linux-3.19 linux

5. Perform kernel settings

cd /usr/src/linux
make menuconfig

In this step, it is best to copy a .config file that was run previously and make modifications to this file. Otherwise, it may not be able to restart.

For example:

cp /boot/config-3.10.0-123.el7.x86_64 /usr/src/linux/.config

6. Compile the kernel

make -- it may take from 1 hour to 3 hours.

make modules_install
make install

7. Restart.

Recommended related video tutorials: linux video tutorial

The above is the detailed content of How to compile the Linux kernel. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn