Debian Lenny compile kernel from source
Install Kernel
Install the required items for normal compilation.
# Apt-Get install build-essential
# Apt-Get install libncurses5-dev
To install a patch, install the patch package:
# Apt-Get Install patch
(I don't like the Debian standard kernel Installation Method in some articles on the Internet, because I often switch between different releases to compile and install the kernel, so I like the following method I usually use)
1: Get latest Linux kernel code
# Cd/tmp
# Wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.y.z.tar.bz2
### Note: replace x. y. Z with actual version number.
2: extract tar (.tar.bz2) File
# Tar-xjvf linux-2.6.23.tar.bz2-C/usr/src
# Cd/usr/src
3: Configure Kernel
# Make menuconfig
4: Compile and install Kernel
# Make
# Make modules_install
# Make install
5: Create an initrd Image
View the information of your version. Here I compile the compatible kernel, which is shown as follows:
# Ls/lib/modules/
2.6.18-6-686 2.6.23-uk0.2.1 2.6.24-1-686
# Cd/boot
Run:
# Mkinitrd-O initrd. img-2.6.23-uk0.2.1/lib/modules/2.6.23-uk0.2.1
Or:
# Mkinitramfs-O initrd. img-2.6.23-uk0.2.1 2.6.23-uk0.2.1
6: Modify grub configuration file-/boot/GRUB/menu. lst
Open File Using VI:
# Vi/boot/GRUB/menu. lst
Title Debian GNU/Linux, kernel 2.6.23 uk0.2.1
Root (hd0, 3)
Kernel/vmlinuz-2.6.23-uk0.2.1 root =/dev/sda3 Ro
Initrd/initrd. img-2.6.23-uk0.2.1
Savedefault
Boot
# Update-grub
Reboot your system, OK!