Debian kernel compilation experience

Source: Internet
Author: User
Debian kernel compilation experience-Linux Release Technology-Debian information. See the following for details. 1. Install the kernel compilation tool
Basic tools: gcc, libc5-dev or libc6-dev, binutils, make, bin86, modutils, mawk Or gawk, gzip, shellutils, grep, kernel-package, fakeroot
To use menuconfig for configuration, you need to install libncursesX. X-dev (for example: libncurses5-dev)
For kernels later than version 2.4, you can use xconfig on the graphic interface. You need to install tkX. X-dev (for example, tk8.4-dev)
For the 2.6 kernel, select more. If xconfig is used, you need to install the libqt3-mt-dev. If you do not want to use xconfig, you can use gconfig, you need to install libglade2-dev

# Apt-get install kernel-package ncurses-dev fakeroot initrd-tools select the basic tool based on your Linux release.

2. Install the kernel source code, such:
# Apt-get kernel-source-2.6.22.9 kernel directly downloads kernel-source-2.6.22.9.tar.gz and directly stores it in the/usr/src directory.

3. decompress the kernel source code
# Tar zxvf/usr/src/kernel-source-2.6.22.9.tar.gz
# Cd linux-2.6.22.9
# Cp/boot/config-2.6.22.9. config // The current Kernel configuration as a template/boot/config-2.6.22.9 depends on your own kernel version file.

4. Compile the kernel

1) Configuration
Make config uses the text dialog method (very troublesome, not easy to use)
Make menuconfig)
Make xconfig or make gconfig use GUI (very useful, but not stable)

Configuration is also the most troublesome step. N multiple choices. If you want to use. config as a template, load it at the beginning of configuration.

2) Clear the source code tree and restore the kernel-package parameter.
# Make-kpkg clean

3) Compile
# Make-kpkg -- revision = mykernel.1.0 -- initrd kernel_image

Mykernel.1.0 can be customized to indicate that it may take longer to compile the kernel by kernel name and number (generally more than one hour), depending on the performance of different machines.

5. Install the kernel
The compiled kernel is a deb package, which is placed in the/usr/src directory and can be directly installed using the dpkg command, such:

# Dpkg-I ../kernel-image-2.6.22.9-mykernel.1.0_i686.deb

If the installation is successful without any errors, the kernel has been compiled successfully, and the menu. lst's boot menu has been automatically modified.

VFS: Cannot open root device "hdb7" or unknown-block (0, 0)
Please append a correct "root =" boot option
Kernel panic-not syncing: VFS: unable to mount root fs on unknow-block (0, 0)

If this is prompted, some of the basic tools for Kernel compilation may not be installed. Let's take a look at them and compile them several times!
Related Article

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.