Compile the internal nuclear process (kernel2.6.xx) - Today, the core is rising from 2.6.10, very smooth, cool!

xiaoxiao2021-03-06  43

It took a few days to compile the successful kernel2.6.7, the process is really hard. The ancient language has clouds: "Work hard!" Now you can finally be a buoy. Because many friends are in the order of operations and some important configurations I know unknown, I often treat medical attention.

In addition, the information on the Internet is more and more troublesome, making the compilation and internal energy power is not high, and even cause the original system crash. I am one of them :-) In fact, compiled kernel is not a difficult thing. If you can follow the correct way To operate, you can get up to one and a half hours. Is it very encouraged!

Tony said, now we will start now. My original system is RedHat9.0, the kernel 2.4.20-8, the compiled kernel 2.6.7 is for reference only.

A total of four parts: Preparation before compilation -> Compilation Configuration -> Compile Process -> FAQ for the RMB

Preparation before compilation

1) Download a kernel source code, I am Linux-2.6.7.tar.bz2, you can download it or update it in the following address.

http://kernel.org/pub/linux/kernel/v2.6/

2) Download the latest version of module-init-tools ("Module-Init-Tools-3.0.tar.gz" and "MODUTILS-2.4.21-23.SRC.RPM")

Http://www.kernel.org/pub/linux/ker...ools-3.0.tar.gz

http://www.kernel.org/pub/linux/ker...4.21-23.src.rpm

3) Install module-init-tools. It will replace DEPMOD [/ SBIN / DEPMOD] and other tools.

TAR-ZXVF MODULE-INIT-TOOLS-3.0.tar.gz

CD Module-Init-Tools-3.0

./configure --prefix = / sbin

Make

Make Install

./generate-modprobe.conf /etc/modprobe.conf

4) Install MODUTILS-2.4.21-23.Src.rpm. You may see the "User Rusty and Group Rusty Not Existing" warning. It doesn't matter, you only need to force the installation is right. If you don't pay for Redhat 9 and Redhat 8 Do these steps, you will have problems when "make MODULES_INSTALL".

RPM -I MODUTILS-2.4.21-23.src.rpm

RPMBUILD -BB /USR/SRC/Redhat/SPECS/ModuTils.Spec

RPM -FI /USR/SRC/Redhat/rpms/i386/modutils-2.4.21-23.i386.rpm

5) Unzip the kernel source code. Put the downloaded source code package under the directory / usr / src, then

CD / USR / SRC

TAR XVFJ Linux-2.6.7.tar.bz2

CD Linux-2.6.7

Second compilation configuration

In this part involves the configuration of several important modules, special attention. Generally, the kernel is configured with the "Make MenuConfig" command.

Enter a menu interface after entering the above command, the user can make a required module. Here, a few important configurations

1) File system

Please be sure to select the EXT3 file system,

File systems ---> [*] ext3 journalling file system support [*] ext3 security labels [*] jbd (ext3) debugging support

The above three must be selected, and to build (即标 *). This is very important. Be sure to check if the configuration will be checked. Theconfig file has "config_ext3_fs = y". If not "config_ext3_fs = Y "But" config_ext3_fs = m ", you will meet the following error when you run the kernel: pivotroot: pivot_root (/ sysroot, / sysroot / initrd) Failed2) NIC driver

Please be sure to compile the drive into the kernel. Compare the popular network card is Realtek 8139. Here is the configuration of this network card for reference.

Device drivers --->

NetWorking Support --->

Ethernet (10 or 100Mbit) --->

<*> Realtek RTL-8139 C PCI Fast EtherNet Adapter Support (Experimental)

<*> Realtek RTL-8139 PCI Fast Ethernet Adapter Support

3) Sound card driver

Also select the drive compile of the sound card into the kernel, and the popular sound card is i810_audio, the following is the configuration of this sound card for reference.

Device drivers --->

Sound --->

<*> Sound Card Support

Advanced Linux Sound Architecture --->

<*> Advanced Linux Sound Architecture

<*> Sequence 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 whether the new kernel can run normally. Please pay attention to it. If other configurations are not very well, larger can be selected by default.

Three compilation process

Compile it as follows, it takes more than an hour, you can relax your best :-)

Make Bzimage

Make modules

Make modules_install

Make Install

Before running the new kernel, check the content of /boot/grub/grub.conf, the following configuration can be used

# Grub.conf generated by Anaconda

#

# Note That You Do Not Have to Run Grub After Making Changes To this file

# NOTICE: You Have A / Boot Partition. This Means That

# All kernel and ionrd paths are relative to / boot /, eg.

# root (HD0, 0)

# kernel / vmlinuz-version Ro root = / dev / hdc3

# initrd /initrd-version.img

# Boot = / dev / hdc

DEFAULT = 1

TIMEOUT = 10

SplashImage = (HD0, 0) /grub/splash.xpm.gz

Title Red Hat Linux (2.6.7)

root (HD0, 0)

Kernel /Vmlinuz-2.6.7 Ro root = label = / initd /initrd-2.6.7.img

Title Red Hat Linux (2.4.20-8)

root (HD0, 0)

Kernel /Vmlinuz-2.4.20-8 Ro root = label = /

Initrd /initrd-2.4.20-8.img

Fast problems in running the kernel

1) RPM problem

After entering the compiled kernel, some commands related to rpm cannot be used, and the following errors appear:

RPMDB: Unable to join the environment

Error: DB4 Error (11) from Dbenv-> Open: Resource Temporarily Unavailable

Error: Cannot Open Packages Index Using DB3 - Resource Temporarily Unavailable (11)

Error: Cannot Open Packages Database In / VAR / LIB / RPM

No packages

The solution is to execute the "Export LD_Assume_kernel = 2.2.25" command or write it to / etc / bashrc.

2) Sound problem

The module name of the sound portion also changed. My notebook original sound card driver is I810_AUDIO, and now it has been changed to SND-Intel8x0. Therefore, you need to add the following to /etc/modprobe.conf:

Alias ​​Char-Major-14 Soundcore

Alias ​​Sound Snd-Intel8x0

Alias ​​Sound-Slot-0 Snd-Intel8x0

Alias ​​SND-CARD-0 SND-Intel8x0

Alias ​​Sound-Service-0-0 SND-MIXER-OSS

Alias ​​Sound-Service-0-1 SND-SEQ-OSS

Alias ​​Sound-Service-0-3 SND-PCM-OSS

Alias ​​Sound-Service-0-8 SND-SEQ-OSS

Alias ​​Sound-Service-0-12 SND-PCM-OSS

Install Snd-Intel8x0 / Sbin / Modprobe - Ignore-Install Sound-Slot-0 &&

{/ bin / amix-minimal -f /etc/.aumixrc -l> / dev / null 2> & 1; / bin / true;

REMOVE SND-Intel8x0

{/ BIN / AUMIX-minimal -f /etc/.aumixrc -s> / dev / null 2> & 1; / bin / true;

/ sbin / modprobe -r --ignore-remove snoud-slot-0

Then perform the "ModProbe Sound" load module and use the following command to check the sound card driver:

#cat / proc / asseOound / Cards

The results show are as follows:

0 [Si7012]: ICH - SIS Si7012

SIS Si7012 AT 0xDC00, IRQ 11

3) VMware problem

The solution is:

◆ Replace all "/ proc / ksyms" in /usr/bin/vmware-config.pl to "/ Proc / Kallsyms". Use the "SED" command to achieve this.

◆ Re-run the script, compile new kernel modules using the kernel header file. If an error occurs during the compilation process, you should enter / usr / lib / vmware / modules / source, use the following command to subcontain the vmnet.tar:

#TAR XVF VMNET.TAR ◆ Enter the VMNet-Only directory to modify the bridge.c file. "Atomic_ADD (SKB-> TRUESIZE, & SK-> WMEM_ALLOC);" Modified to "Atomic_ADD (SKB-> TRUESIZE, & SK-> SK_WMEM_ALLOC);" and change "protinfo" to "SK_PROTINFO" with a similar manner.

◆ Repack the VMNet-Only directory with the following command to vmmon.tar:

#TAR CVF VMMON.TAR VMNET-ONLY.

If the above operation is still failed, another solution is to

Http://ftp.cvut.cz/vmware/ Download VMWAR ... Rendering 膔 Unme.pl.pl

4) USB problem

Most of the USB modules used in the new 2.6.0 kernel have been renamed, so you need to modify the code initialized to the USB subsystem in /etc/rc.system. Change all "keybdev" in this file to "USBKBD", "MouseDev" is changed to "USBMouse", "/ proc / bus / usb" change to "/ sys / bus / usb", and in / etc / init. The same modifications are made in D / Halt. In addition, you have to find "NeedusBStorage" in /etc/rc.system, do the following modifications:

Needusbstorage =

IF [$ usb = "1"]; then

NeedusbStorage = `lc_all = c grep -e" ^ i.1 * CLS = 08 "/ sys / bus / usb / defices 2> / dev / null`

Action $ "Initializing USB 1.1 Host Controller:" Modprobe OHCI-HCD 2> / dev / null

ACTION $ "Initializing USB HID Interface:" Modprobe Hid 2> / dev / null

Action $ "Initializing USB Keyboard:" Modprobe USBKBD 2> / dev / null

Action $ "Initializing USB Mouse:" Modprobe USBMOUSE 2> / dev / null

Fi

If the USB bus is 2.0, "OHCI-HCD" is also required to "EHCI-HCD".

5) SYSFS problem

The solution is:

◆ Establish a directory / sys: #mkdir / sys

◆ Find "mount -f / proc" in the /etc/rc.d/rc.sinit file, add "mount -f / sys" next line.

◆ Similarly in the /etc/rc.d/rc.sinit file, "Action $" Mounting Proc FileSystem: "Mount -n -t Proc / Proc / Proc" is added to "ACTION $" Mounting Sysfs FileSystem: "mount -n -t sysfs / sys / sys".

◆ Add "None / Sys System DEFAULTS 0 0" in the / etc / fstab file.

◆ Found "awk '$ 2 ~ / ^ // $ | ^ // proc | ^ // dev / {next}", changed to "awk' $ 2 ~ / ^ // $ | ^ // proc | ^ // sys | ^ // dev / {next}.

6) HotPlug (hot plug) problem

The kernel's support for hot swaps is related to the KMOD kernel thread. The solution is to replace all / proc.sysinit in / PROC / KSYMS in /tc/rc.system. Perform the following command:

#mv /etc/rc.d/rc.system /etc/rc.d/rc.system.bak

#sed -e 's /// proc // kallsyms /// proc // kallsyms / g' /etc/rc.d/rc.system.bak> /etc/rc.d/rc.system

7) GLIBC problem

Users can upgrade the software package for the GLIBC standard library to solve this problem. Because of some distribution, such as Red Hat 9.0, the default installed GLIBC may be modified by the Red Hat core group. The download address of the package is:

ftp://ftp.rpmfind.net/linux/redhat/...27.9.i386.rpm.

You can upgrade together with the following packages:

FTP: //ftp.rpmfind.net/linux/redhat/...2-27.9.i386.rpm

FTP: //ftp.rpmfind.net/linux/redhat/...2-27.9.i386.rpm

FTP: //ftp.rpmfind.net/linux/redhat/...2-27.9.i386.rpm

If you use "rpm-fer glibc *" to fail, use the command "rpm -e" first delete the old GLIBC, then use the command "rpm -up --force glibc *" to force installation.

other questions

Everyone may also meet other problems, but no matter what problem, you can try to resolve follows:

1. The kernel assembly is compiled as a module as much as possible. Perform the following command to quickly rebuild the kernel:

#make all modules_install install

2. Most of the cases of software failure are caused by the module names have been changed, and the scripts under /etc/rc.d/rc.system and /etc/rcx.d/* are not modified. Therefore, modifying related entries can be improved, but this also requires considerable background knowledge. If you feel trouble, you can focus all load modules in /etc/rc.d/rc.local. E.g:

Modprobe Eth0

Modprobe isofs

MODPROBE LOOP

Modprobe vfat

Modify the /etc/modoribe.conf file at the same time. See "Man MoDoribe.conf" to get more help information.

3. If you want to know the name after a module, you can first find this option when "make metronfig", select Help to find its configuration name (config_ *), then find config_ * in the Makefile under the source code related directory. You can usually find an OBJ-$ (config_ *), and its value is the name of the module.

Attachment: This article refers to the article:

Http://tech.ccidnet.com/pub/Article...a103129_p1.html

转载请注明原文地址:https://www.9cbs.com/read-56815.html

New Post(0)