Compile kernel Linux-3.1.6 under Ubuntu10.04

Source: Internet
Author: User

Tools:
GCC
LD
MAKE
Util-linux (fdformat)
Module-init-tools (depmod)
Tune2fs
JFS (IBM File System)
ReiserFS
XFS (SGI File System)
Quota-tools
Nfs-utils
Udev (udevinfo)
Ps
These tools are best compared with the Documentation/Changes file in the kernel source code directory to determine which versions of the tools can meet your needs. That is, it is best to build them based on the version tools specified in the file.
It is best to build the kernel under a common user, and switch to the root user only when the root user is required.
Download the kernel source code:
The kernel source code cannot be stored in the/usr/src/linux directory, because it stores the kernel required to build the system library, rather than the new kernel customized by you. do not develop the kernel in the/usr/src/directory. Do these tasks in a user directory so that you do not have to worry about system damage.
 
Create Kernel configuration:
1. Start from scratch: make config
2. Default Configuration: make defconfig
3. Console configuration: make menuconfig
4. graphical method: make gconfig
5. Another graphical method: make xconfig
 
Build the kernel:
Make
Advanced kernel Building Options:
1. make-j [num]
The number of physical CPUs in num is twice. for example, if your CPU is dual-core, make-j4. note that if-j is not followed by any value, in the kernel build process, a new thread will be created for each sub-folder in the kernel source code tree, so that your computer can easily stop responding. it takes longer to build the kernel.
2. Put the output file in the specified directory:
Make O =/dir/
3. different architectures:
Make ARCH = x86_64 defconfig
 
Install the kernel:
Compilation module:
Sudo make modules
Sudo make modules_install
 
Internal Image:
Mkintramfs 3.1.6-o/boot/initrd. img-3.1.6
3.1.6 indicates the directory name under/lib/modules.
Will generate:/initrd. img-3.1.6 File
 
 
Sudo make install
Make install
The following files are generated:
Config-3.1.6 -- kernel compilation configuration file content is make menuconfig file. config content, but the file name is different
Vmlinux-3.1.6
System. map-3.1.6
 
 
 
 
 
Compile the kernel-> compile the module-> install the module-> Create a module image-> install the kernel
(The following line uses the uheader tool to accelerate the launch of the system release and the/var partition is independent :)
Sudo sed-I's + ^ start on starting mountall + start on mounted MOUNTPOINT =/var + '/etc/init/ureadahead. conf
If:
Driver mdio-gpio is already registered
Re-compile the kernel and set mdio-gpio to be compiled as a module instead of compiled into the kernel.

 
 
Postscript:
If it is not necessary, do not use the new kernel to run the computer. Just do research .. I found that with the new kernel, my ubuntu10.04 became unstable, and the x-window was automatically restarted when I did not enter it... haha... we 'd better get the original one back .. haha .. however, linux does not really want to understand how it runs. You can change the kernel at will when running it... one word: strong!

Author ljy520zhiyong

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.