Build the kernel source code tree in Ubuntu

Source: Internet
Author: User
Many articles on the Internet, all of which he wrote are transferred and used in each article. Simply sort out an article by yourself. There are many good people on the Internet, but there are more white issues. What's more, we are not getting started with this number. Because we have recently learned the kernel and want to write modules, the modules should be compiled and installed under the source code tree, I am used to Ubuntu OS again. I can't help but turn to another party. I 'd better set it up. I have found a few articles that are not very useful. Let's start from below. PS: the current system is the one that updated Jun from Ubuntu9.04 to Ubuntu10.04 in the previous SSH configuration blog.

Many articles on the Internet, all of which he wrote are transferred and used in each article. Simply sort out an article by yourself.

There are many good people on the Internet, but there are more white issues. What's more, we are not getting started with this number. Because we have recently learned the kernel and want to write modules, the modules should be compiled and installed under the source code tree, I am used to Ubuntu OS again. I can't help but turn to another party. I 'd better set it up. I have found a few articles that are not very useful. Let's start from below.

PS: the current system is the system updated from Ubuntu 9.04 to Ubuntu 10.04 in the previous SSH configuration blog.

This is the case on the Internet.

1. install the software build-essential, autoconf, automake, cvs, and subversion required to compile the kernel.

$ Sudo apt-get install build-essential kernel-package libncurses5-dev

Libncurses5 is used when menuconfig is used to configure the kernel.

2. Go to/usr/src and build the source code tree here. Run the following command to view the available source code package:

$ Sudo apt-cache search linux-source

My prompt is:

Linux-source-Linux kernel source with Ubuntu patches

Linux-source-2.6.32-Linux kernel source for version 2.6.32 with Ubuntu patches

3. Let's download the kernel version 2.6.32 and run the following command:

$ Sudo apt-get install linux-source-2.6.32

Wait until the download is complete.

4. After the download is complete, go to/usr/src. By default, the directory structure will be shown here: (ls)

My display shows two Linux-header-2.6 pairs. * directory, You should have only one pair, the reason is that I updated from 9.04 to 10.4, Ubuntu will keep the previous version, don't worry about it, remember, here we use linux-headers-2.6.32-34-generic 、linux-headers-2.6.32-3420.linux-source-2.6.32.tar.bz2. Linux-source-2.6.32.tar.bz2 this is just download the source code, we extract it:

$ Sudo tar-xjvf linux-source-2.6.32.tar.bz2

Then, for the convenience of the operation, we will establish a soft connection to the source code directory:

$ Sudo ln-s linux-source-2.6.32 linux

In this way we can operate the linux-source-2.6.32 directory through linux.

$ Cd linux

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.