Linux Kernel compilation test

Source: Internet
Author: User

Kernel compilation:

Step 1: Configure kernel compilation options.
make menuconfig
Optional Step: Excludes dependencies between compilation result files (. o) and so on.
make mrproper
Optional Step: Clears the historical compilation results.
make clean
Step 2: Compile the kernel.
#编译内核#编译各内核模块,如驱动等。#将编译好的模块安装至 /lib/modules/x.xx.x 目录下。
Step 3: Generate the initial disk image initrd.img.
cd linux-source-x.xx.x/.config#复制配置文件至/boot目录cp.config /boot/config-x.xx.x#x.xx.x 对应 /lib/modules/x.xx.x 目录。# -o 指示了镜像的输出目录。sudo mkinitramfs -o /boot/initrd.img-x.xx.xx.xx.x
Step 4: Modify the Grub configuration.

Copy an existing boot entry entry in/boot/grub/grub.cfg and modify the kernel-related file address to the location of the new kernel-related file.

Such as:

Copy the next paragraph:

Menuentry' Ubuntu,linux 3.2.0-36-generic-pae ' --Class Ubuntu--Class GNU-linux --Class GNU--Class OS {recordfail Gfxmode$linux _gfx_modeInsmod Gzio insmod part_msdos insmod ext2SetRoot=' (hd0,msdos1) 'Search--No-floppy --Fs-uuid --Set=Root7b4e922c-d943-4b84-9C75-4fdc57cf1a3f Linux/boot/vmlinuz-3.2. 0- $-generic-paeRoot=Uuid=7b4e922c-d943-4b84-9C75-4fdc57cf1a3f ro Quiet Splash$VT _handoffInitrd/boot/initrd.Img-3.2. 0- $-generic-pae}

Modified to:

Menuentry' Test,linux 3.7.4 ' --Class Ubuntu--Class GNU-linux --Class GNU--Class OS {recordfail Gfxmode$linux _gfx_modeInsmod Gzio insmod part_msdos insmod ext2SetRoot=' (hd0,msdos1) 'Search--No-floppy --Fs-uuid --Set=Root7b4e922c-d943-4b84-9C75-4fdc57cf1a3f Linux/boot/core/vmlinuz-3.7. 4Root=Uuid=7b4e922c-d943-4b84-9C75-4fdc57cf1a3f ro Quiet Splash$VT _handoffInitrd/boot/core/initrd.Img-3.7. 4}
Step 5: Testing

Press ESC when the virtual machine starts, forcing you to enter the Grub boot menu.

Select ' Test,linux 3.7.4 in the menu, initialize the system with the newly compiled kernel, look at the boot process, see if there is an exception, if everything is OK, the kernel compiles correctly, and vice versa, you need to continue to modify the compilation options.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Linux Kernel compilation test

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.