Compile command and update of Linux kernel

Source: Internet
Author: User

LinuxOperating SystemKernelThe compilation process is long: Preparation and configuration are required before compilation starts.

CompileThe commands are as follows:

# Make dep

# Make clean

# Make zImage

# Make bzImage

# Make modules

# Make modules_install

# Depmod-

The first command, make dep, actually reads the configuration file generated during the configuration process to create the dependency tree corresponding to the configuration, so as to determine which need to be compiled and which do not need to be; run the second command make clean to delete the files left in the previous step to avoid some errors. Run the Third Command make zImage and the fourth command make bzImage to fully compile the kernel, both of them use gzip to compress the kernel. The difference is that make bzImage can generate a larger kernel, for example, if you use the make zImage command to compile the kernel of version 2.4.0, the system too big error message will appear. We recommend that you use the make bzImage command.

The following three commands are necessary only when you answer Enable loadable module support (CONFIG_MODULES) in the configuration process, make modules and make modules_install generate the corresponding modules and copy the modules to the required directories.

Strictly speaking, the seventh command has nothing to do with the compilation process. It is used to generate dependencies between modules. After you start the new kernel, the module can be correctly located when the module is loaded using The modprobe command.

Update

After the above steps, we finally get the new kernel version. To be able to use the new kernel version, we also need to make some changes:

# Cp/usr/src/linux/System. map/boot/System. map-2.4.0test8

# Cp/usr/src/linux/arch/i386/bzImage/boot/vmlinuz-2.4.0test8

The above two files are newly generated during compilation. Next, modify the two links System. map and vmlinuz under/boot to point them to the new kernel file:

# Cd/boot; rm-f System. map vmlinuz

# Ln-s vmlinuz-2.4.0test8 vmlinuz

# Ln-s System. map-2.4.0test8 System. map

Then modify/etc/lilo. conf:

# Vi/etc/lilo. conf

Add the following section:

Image =/boot/vmlinuz-2.4.0test8

Label = linux240

Read-only

Root =/dev/hda2

The root =/dev/hda2 line must be modified as needed. Run:

#/Sbin/lilo-v

Make sure that you have edited/etc/lilo. conf correctly. Now restart the system:

# Shutdown-r now

Press the TAB key and enter linux240 when LILO appears after the machine restarts. Our new kernel is used. Enjoy it.

As described above, we have learned how to update and troubleshoot kernel compilation, and hope to help you!

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.