How about giving each release their own dedicated wiki page?
Original article : http://linuxtweaking.blogspot.tw/
Original Ubuntu wiki: https://help.ubuntu.com/community/Kernel/Compile
First steps
Install the required tools and packages.
Open a terminal and type the following,
sudo apt-get install fakeroot kernel-wedge build-essential makedumpfile kernel-package libncurses5 libncurses5-devThen run the following command,
And finally type,
sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)
At the time of writing 2.6.32 was the current kernel source, it should remain at this version throughout the life of Ubuntu 10.04
mkdir ~/src
cd ~/src
apt-get source linux-image-$(uname -r)
cd linux-2.6.32
It is a good idea to start with the same .config as the currently running kernel, so type the following,
Now we are ready to customize the build and kernel options.
cp -vi /boot/config-`uname -r` .config
Once you have finished, save and exit. It is now time to compile. However to speed up the build if you have a dual core processor type,
make menuconfig
The general rule is 1 + the number of processor cores.
export CONCURRENCY_LEVEL=3
Remember to substitute the writing in green for something else, for example -alpha
make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-Linux-Kernel kernel-image kernel-headers
After a few minutes or hours your kernel compile will be complete. The next step is to install it.
The kernel package will be created in the parent directory of ~/src/linux-2.6.32 (i.e. ~/src)
Please note the text in green must be changed to reflect your version.
cd ~/src
sudo dpkg -i linux-image-2.6.32.11+drm33.2-alpha_2.6.32.11+drm33.2-alpha-10.00.Custom_amd64.deb
sudo dpkg -i linux-headers-2.6.32.11+drm33.2-alpha_2.6.32.11+drm33.2-alpha-10.00.Custom_amd64.deb
We are almost ready, prior to 10.04 the initramfs kernel image was automatically created. The Ubuntu wiki suggests using the scripts to create the image but I have been unsuccessful in using this method, hence the manual approach.
BUG: Please use the alternate method described below as this command fails to create an image for your new kernel. Special thanks to Helios38. - 16/06/2010
sudo update-initramfs -c -k all
Alternatively if you know the kernel version, substitute the word all with the kernel version.
Finally we need to add the initramfs image to the grub.cfg file located at /boot/grub/grub.cfg.
Example, sudo update-initramfs -c -k 2.6.32.11+drm33.2-alpha
For the easy and automatic method as oppose to manually editing the grub.cfg file, just type the following,
Now just reboot and your new kernel should automatically load.
sudo update-grub
How to remove your kernel
Enjoy compiling your own kernels.
sudo dpkg -r linux-headers-2.6.32.11+drm33.2-alpha
sudo dpkg -r linux-image-2.6.32.11+drm33.2-alpha
sudo rm /boot/initrd.img-2.6.32.11+drm33.2-alpha
0 意見:
張貼留言