This page discusses how to rebuild the http://www.aliyun.com/zixun/aggregation/13835.html ">ubuntu Linux kernel pack." This is the most straightforward way to compile your own Ubuntu kernel, but it's also a fairly heavyweight approach. If you plan to do some kernel development or debugging, you may be happier to follow this guide. It's more complicated but also more flexible.
Installation
We'll build anything under the "Linux" directory in your user directory (or what you want to call). The following steps must be run as root (with "sudo" in front).
$ sudo apt build-dep linux-source-2.6.8.1
$ mkdir ~/linux
$ CD ~/linux
$ apt Source linux-source-2.6.8.1
$ CD linux-source-2.6.8.1-2.6.8.1
Note: This approach requires a lot of disk space, especially if you want something special (see below). 1.6G is required to achieve full features. It may even require more disk space during compilation.
Configuration
By this step, you may want to change your kernel configuration. In debian/config/arch/(for example, my current kernel is "linux-image-2.6.8.1-3-686", I will edit the debian/config/i386/686) directory to modify the corresponding file.
You may also want to delete other configurations that you don't care about. Or at least move them to another directory. Otherwise, you will build each one--this is a time-consuming process. The following example means that no features are built except for 686.
$ CD debian/config/i386
$ mkdir Disabled
$ mv * Disabled
$ mv disabled/686.
Construction
Now that the source has been installed and configured, build it. If you do not limit the above features, it will take a considerable amount of time (about seven hours on my 1Ghz laptop). -B is to say that only the binary files of a dependency structure are built, and UC and-us are those files that cannot be encrypted,-rfakerroot allow you to do anything as a general (not root) user.
$ CD ~/linux/linux-source-2.6.8.1-2.6.8.1
$ dpkg-buildpackage-b-uc-us-rfakeroot