The new kernel can be downloaded in the http://www.kernel.org.
Copy linux-2.6.18.2.tar.bz2 to/usr/src/first.
Tar-jxvf linux-2.6.18.2.tar.bz2
Cd linux-2.6.18.2
Make mrproper deletes the garbage generated by the original compilation
You can use one of the following commands to configure the kernel based on your needs and hobbies:
# Make config (text-based most traditional configuration interface)
# Make menuconfig (Text menu-based configuration interface)
# Make xconfig (graphical window mode-based configuration interface)
# Make oldconfig (if you only want to modify some small points based on the original Kernel configuration, it will save a lot of trouble)
During configuration, the default values can be used for most options. Only a small part of options need to be selected based on the user's needs. For example, if you want the kernel to support a file system with DOS partitions, You need to select FAT or dossystem for the file system. If the system is equipped with a NIC or PCMCIA card, select the type of the corresponding card in the network configuration.
When you select the corresponding configuration, there are three options, which represent the following meanings:
"Y"-compile this function into the kernel
"N"-do not compile this function into the kernel
"M"-compile this function into a module that can be dynamically inserted into the kernel as needed.
Compile some functional code that is far away from the other parts of the core and is not frequently used into a loadable module. This helps reduce the length of the kernel and reduce the memory consumed by the kernel, this feature simplifies the impact on the kernel when the corresponding environment changes. Many functions can be processed in this way, such as NIC support and file system support such as FAT.
In fact, the most important thing to compile the kernel is to configure the kernel. I usually use make menuconfig to configure the kernel.
When you configure the 2.6.0 kernel, if your motherboard is an Intel chip, you may get a satisfactory kernel by default. Make menuconfig and save it when it leaves.
The difficulty here is pci. If your hard disk is IDE, you must choose the nanqiao chip on your motherboard. For SCSI, select your scsicard model.
There is also the model of the NIC and sound card chip. You can use lspci to find their models.
[Root @ leo boot] # lspci
00:00. 0 Host bridge: Intel Corp. Sort BX/ZX/DX-Sort 43bx/ZX/DX Host bridge (rev 01)
00:01. 0 PCI bridge: Intel Corp. Sort BX/ZX/DX-Sort 43bx/ZX/dx agp bridge (rev 01)
00:07. 0 ISA bridge: Intel Corp. 82371AB/EB/MB PIIX4 ISA (rev 08)
. 1 IDE interface: Intel Corp. 82371AB/EB/MB PIIX4 IDE (rev 01)
00:07. 2 USB Controller: Intel Corp. 82371AB/EB/MB PIIX4 USB
. 3 Bridge: Intel Corp. 82371AB/EB/MB PIIX4 ACPI (rev 08)
00: 0f. 0 VGA compatible controller: VMware Inc [VMware svga ii] PCI Display Adapter
. 0 SCSI storage controller: LSI Logic/Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 01)
. 0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)
. 0 Multimedia audio controller: Ensoniq ES1371 [AudioPCI-97] (rev 02)
Compile configuration
Please pay special attention to the configuration of several important modules in this part. Generally, use the "make menuconfig" command to configure the kernel.
Enter the preceding command and a menu interface appears. You can view the required modules. The following describes several important configurations.
1) File System
Make sure to select the ext3 file system,
File systems --->
[*] Ext3 journalling file system support
[*] Ext3 Security Labels
[*] JBD (ext3) debugging support
The above three items must be selected, and must be built in (that is, the mark *). this is very important. Check after configuration. does the config file contain "CONFIG_EXT3_FS = y. if it is not "CONFIG_EXT3_FS = y" but "CONFIG_EXT3_FS = m", you will encounter the following error when running the kernel: Too troot: effect_root (/sysroot,/sysroot/initrd) failed
2) NIC Driver
Make sure to compile the driver corresponding to your Nic into the kernel. The common Nic is realtek 8139. The following is the NIC configuration for your reference.
Device Drivers --->
Networking support --->
Ethernet (10 or 100 Mbit) --->
<*> RealTek RTL-8139 C + PCI Fast Ethernet Adapter support (EXPERIMENTAL)
<*> RealTek RTL-8139 PCI Fast Ethernet Adapter support
3) Sound Card drive
You also need to compile the driver corresponding to your own sound card into the kernel. The general sound card is i810_audio. The following is the configuration of this sound card for your reference.
Device Drivers --->
Sound --->
<*> Sound card support
Advanced Linux Sound Architecture --->
<*> Advanced Linux Sound Architecture
<*> Sequencer support
<> Sequencer dummy client
<*> OSS Mixer API
<*> Oss pcm (digital audio) API [*] OSS Sequencer API
<*> RTC Timer support
PCI devices --->
<*> Intel i8x0/MX440, SiS 7012; Ali 5455; NForce Audio; AMD768/8111
Open Sound System --->
<> Open Sound System (DEPRECATED)
The above three configurations are related to the normal operation of the new kernel. Please note that other configurations can be selected by default if they are not well understood.
# Make dep (ensure that the key files are in the correct location) 2. 5. *-2.6.0 is not required. In fact,. * Some kernels are not required.
# Make clean (make sure all related files are in the latest version)
# Make zImage (compile the compressed kernel)
When the kernel supports many peripherals and functions, the kernel may become very large. In this case, you can compile the large kernel:
# Make bzImage
The compilation time depends on the hardware conditions and Kernel configuration of the machine. The obtained kernel is located in the/usr/src/linux/arch/i386/boot directory, assume that the user's CPU is x86.
If you select a loadable module, compile the selected module after compiling the kernel:
# Make modules)
# Make module_install (transfer the compiled module to the standard system location)
# Make install
The above command "make install" will:
(1) copy the compressed kernel image to the/boot directory and create the System. map symbolic link;
(2) modify the configuration file of the bootloader;
(3) Call the mkinitrd program to create the initrd image of the kernel. for GRUB, add the following similar configuration lines in the/boot/grub. conf configuration file:
Title Red Hat Linux (2 .***)
Root (hd0, 1)
Kernel/boot/vmlinuz-2. *** ro root = LABEL =/
&