Debian kernel Compilation

Source: Internet
Author: User

Debian kernel Compilation

If you have installed a Linux machine and you have not re-compiled the kernel, the efficiency of this machine will be greatly reduced, because the machine installed by default will generate many unnecessary things, it will also be slow at startup, and some of the things you need may not work. For example, IPV6 is now in place, but I still don't know when IPV6 can be used, I am always looking for it when I start it. I'm upset. The PPP in Fedora is not configured by default. What should I do if I cannot use dial-up? Therefore, compiling the kernel in Linux is a necessary task. Well, let's start now:

If you always want to use the latest kernel, go to kernel.org to download the latest kernel. If you just want to change some options, we recommend that you directly use apt-get to download the Debian kernel.
Seabird-debian:/usr/src # apt-get install linux-tree-2.6.18 kernel-package fakeroot
(If you directly use the root user, it doesn't matter if you don't get down to fakeroot)
The installation does not really install the kernel to your system, but only download the source file. Now, go to/usr/src:
You will see a file named linux-source-2.6.18.tar.bz2

Decompress the file first
Seabird-debian:/usr/src # tar jxvf linux-source-2.6.18.tar.bz2
The file is decompressed to generate a linux-source-2.6.18 directory to enter the directory:
Seabird-debian:/usr/src # linux-source-1.6.18 cd
Seabird-debian:/usr/src/linux-source-1.6.18 #

Use the running configuration file:
Seabird-debian:/usr/src/linux-source-1.6.18 # make oldconfig

Then modify:
Seabird-debian:/usr/src/linux-source-1.6.18 # make menuconfig

Generate new kernel:
Seabird-debian:/usr/src/linux-source-1.6.18 # make-kpkg clean
Seabird-debian:/usr/src/linux-source-1.6.18 # make-kpkg -- initrd -- append-to-version = seabird -- revision = 1.0 kernel-image

Check if any error occurs. make menuconfig again. If the modification is completed, the following file will be generated under/usr/src:
Linux-image-2.6.18lilin_1.0_i386.deb

Now, install the new kernel.
Seabird-debian:/usr/src # dpkg-I linux-image-2.6.18lilin_1.0_i386.deb
Selected the software package linux-image-2.6.18lilin that was deselected.
(Reading the database... the system currently has a total of 119841 files and directories installed .)
Extracting linux-image-2.6.18lilin (from linux-image-2.6.18lilin_1.0_i386.deb )...
Done.
Setting linux-image-2.6.18lilin (1.0 )...
Running depmod.
Finding valid ramdisk creators.
Using mkinitramfs-kpkg to build the ramdisk.
Running postinst hook script/sbin/update-grub.
You shouldn't call/sbin/update-grub. Please call/usr/sbin/update-grub instead!
Searching for GRUB installation directory... found:/boot/grub
Searching for default file... found:/boot/grub/default
Testing for an existing GRUB menu. lst file... found:/boot/grub/menu. lst
Searching for splash image... none found, skipping...
Found kernel:/boot/vmlinuz-2.6.18lilin
Found kernel:/boot/vmlinuz-2.6.18-6-686
Found kernel:/boot/vmlinuz-2.6.18-5-686
Found kernel:/boot/vmlinuz-2.6.18-4-686
Updating/boot/grub/menu. lst... done

Seabird-debian:/usr/src #

Pay attention to the red line and run it as prompted.
Seabird-debian:/usr/src # update-grub
Searching for GRUB installation directory... found:/boot/grub
Searching for default file... found:/boot/grub/default
Testing for an existing GRUB menu. lst file... found:/boot/grub/menu. lst
Searching for splash image... none found, skipping...
Found kernel:/boot/vmlinuz-2.6.18lilin
Found kernel:/boot/vmlinuz-2.6.18-6-686
Found kernel:/boot/vmlinuz-2.6.18-5-686
Found kernel:/boot/vmlinuz-2.6.18-4-686
Updating/boot/grub/menu. lst... done
Seabird-debian:/usr/src #

Now, the new kernel has been added to the boot list, reboot, and you can use the new kernel!

This article permanently updates the link address:

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.