Linux kernel compilation

Source: Internet
Author: User

Environment Introduction

The release version is Debian 6.0 and the kernel version is 2.6.32-5-686. The basic development environment is already available.

The kernel version to compile is 4.3.

Kernel source

Download the kernel source linux-4.3.tar.xz from the http://www.kernel.org website and unzip:

XZ-DC linux-4.3. Tar.xz | Tar xvf-

Readme document description in the main reference directory.

Kernel compilation

O (The letter "ou") parameter is required in order for the compiled content to be stacked with the source to a different directory.

Assume that the kernel source location is:/home/migney/kernel/linux-4.3; compile-generated content to:/home/migney/kernel/build-4.3.

1. Kernel configuration

If you have previously compiled, you need to empty the previous content and then configure the kernel:

mkdir /home/migney/kernel/build-4.3/home/migney/kernel/linux-4.3# Clear the generated content from the previous  build make mrproper# kernel configuration  make o=/home/migney/kernel/build-4.3 Menuconfig

In the Open interface to the corresponding configuration, save exit. This step generates a. config file.

2. Compiling

 Make o=/home/migney/kernel/build-4.3

This generates various modules, kernel images, and so on.

3. Installation Module

 Make o=/home/migney/kernel/build-4.3 modules_install

Modules are installed into the/lib/modules/4.3.0 directory.

module is the kernel configuration when the "M", can be dynamically loaded at runtime (INSMOD), lack of load (rmmod).

4. Install the kernel

 Make o=/home/migney/kernel/build-4.3Install

Files such as vmlinuz-4.3, config-4.3, System-4.3.map, and so on are generated in the/boot directory.

Where vmlinuz-4.3 is the compiled generated file/home/migney/kernel/build-4.3/arch/x86/bzimage,config-4.3 is the file/home/migney/kernel/ Build-4.3/.config, just changed the position, changed the name.

5. Generate INITRD

Initramfs?

Generate/boot/initrd-4.3.0.ram

6. Update the GRUB configuration file

Update-grub

Scan the/boot directory and update the/BOOT/GRUB/GRUB.CNF file.

7, restart, select the new kernel in the boot menu, use the following command to confirm:

uname -R

Linux kernel compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.