LINUX Study Notes 20-Kernel configuration and compilation

Source: Internet
Author: User

1. Clear temporary files, intermediate files, and configuration files: Run
 
A) Make clean: Delete the generated file and save the configuration file.
 
B) Make mrproper: Delete the generated files and configuration files.
 
C) Make distclean: delete mrproper + edit files and patch files
 
2. Determine the hardware and software configurations of the target system, such as the CPU type, network card type, and network protocol to be supported.
 
3. Configure the kernel mode: The. config file is generated and the configuration file is saved.
 
A) Make config: Interactive configuration based on text mode, in the form of Q &
 
B) Make menuconfig: text-based menu configuration (recommended)
 
I. *: corresponds to Y: connects Based on compilation.
 
Ii. m: corresponding to m: Compile without connection. Compile this function into a module that can be dynamically inserted into the kernel as needed.
 
Iii. null: corresponding to N: No compilation
 
C) Make oldconfig: the number of configuration items to be answered is relatively small, most of which are default
 
D) Make xconfig: Graphical Configuration
 
4. How to select the Kernel configuration items: refer to the Kernel configuration document.
 
A) method: use the existing Kernel configuration reference file to configure
 
B) Find the configuration file:
 
I. For example, for the arm Development Board: There are many directories in arch-arm-config.
 
Ii. For example, the Red Hat Enterprise Edition 5 kernel:/boot/
 
C) copy the file to the directory level where. CONFIG is located.
 
D) configure the kernel in the previous step and modify the content you need,
 
5. Compile the kernel: the core file of the kernel is compiled in this step.
 
A) Make zImage (capital I): On the X86 platform, it can only be used for kernels smaller than kb.
 
B) Make bzlmage:
 
C) Make zlmage V = 1: Get detailed compilation information for troubleshooting
 
D) The compiled kernel is located in the arch/<cpu>/boot/directory.
 
E) It takes a long time.
 
6. Compile the kernel module: make modules: This step compiles the kernel module Just configured.
 
7. Install the kernel module: make modules_install
 
A) Purpose: copy the compiled kernel module from the kernel source code directory to/lib/modules.
 
8. Create an Init ramdisk memory disk.
 
A) The previous variable Mkinitrd initrd-$ version can be retrieved by yourself. The last variable is the directory name under/lib/modules, which is generated during kernel installation.
 
B) Example: the kernel version number currently used by the Mkinitrd initrd-2.6.29 2.6.29
 
9. Install the kernel in the Virtual Machine
 
A) Cp arch/x86/boot/bzlmage/boot/vmlinuz-$ version
 
B) Cp $ initrd/boot/
 
C) Modify/etc/grub. conf or/etc/lilo. conf.
 
I. Check whether multiple systems are enabled:
 
Ii. Pay attention to the content after the TITLE is copied and modified. One TITLE represents a startup Item.
 
Iii. The TITLE is followed by a name, which can be changed.
 
Iv. Modify/vmlinuz-2.6.29
 
Modify/initrd-2.6.29

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.