Debian Lenny-compile Linux kernel In Debian

Source: Internet
Author: User
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!
 

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.