Linux compiled internal nuclear process (kernel2.6.7)

xiaoxiao2021-03-06  42

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, often in the case of the doctor. Plus online information is more and more troubles, make the compilation and internal core power is not high, and even cause the original system collapse. I am one of them, the compilation kernel is not a difficult thing. If you can operate in accordance with the correct way, you can get it for an hour and a half. Is it very encouraged! Tone less, now we start now. My original system is RedHat9.0, core 2.4.20-8 , Compiled core 2.6.7 for reference only. A total of four parts: Preparation before compilation -> Compilation Configuration -> Compile Process -> FAQ Preparation Preparation 1) Download a kernel source code, I The next is Linux-2.6.7.tar.bz2, you can download it or update the version at http://kernel.org/pub/linux/kernel/v2.6/2) Download the latest version Module-init-Tools ("Module-Init-Tools-3.0.tar.gz" and "MODUTILS-2.4.21-23.Src.rpm") http://www.kernel.org/pub/linux/kernel/ People / Rusty / Modules / Module-Init-Tools-3.0.tar.gz http://www.kernel.org/pub/linux/kernel/people/rusty/modules/modutils-2.4.21-23.src.rpm 3) Install Module-Init-Tools. It replaces 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 "User Rusty and Group Rusty NOTISTING" Warning. It doesn't matter, you only need to force the installation. If you don't do this, you will do these steps, You will have problems when "make MODULES_INSTALL". Rpm -i models-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 kernel source code. Put the downloaded source code to the directory / usr / src, then CD / USR / SRC TAR XVFJ Linux -2.6.7.tar.bz2 CD Linux-2.6.7 Two Compilation Configuration In this part involves the configuration of several important modules, special attention. General attention. Generally, use the "Make MenuConfig" command to configure the kernel. Enter a menu after entering the above command Interface, users can make a needed module. Here, a few important configurations 1) File system is necessary to select EXT3 file system, file systems ---> [*] ext3 journaling file system support [*] ext3 security labels *] JBD (EXT3) Debugging Support All three must be selected, and to build (即标 *). This is very important, you must check it out after configuration. Config_ext3_fs = y " Item. If it is not "config_ext3_fs = y" but "config_ext3_fs = m"

When you run the kernel, you will meet the following error: pivotroot: pivot_root (/ sysroot, / sysroot / initrd) Failed 2) NIC driver Be sure to compile the drive to the kernel, more popular network cards are Realtek 8139, The following is the configuration of this network card for reference for refer to 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 selects the drive compile into the kernel. Compare the universal 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 <*> 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 whether the new kernel can run normally. Please pay attention to it. If you don't understand it, you can press the default selection. The three compilation process compiles as follows, probably needs one For many hours, you can relax your Make Bzimage Make Make Make MODULES_INSTALL Make Install before running the new kernel, check the contents of /boot/grub/grub.conf, below Configuring Reference # grub.conf generated by Anaconda # # Note That You Do Not Have to Run Grub After Making Changes to this file # NOTE: you have a / boot partition. This means That # all kernel and initrd 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 = / initrd /initrd-2.6.7.img Title Red Hat Linux (2.4.20- root (HD0, 0) kernel /Vmlinuz-2.4.20-8 RO ROOT = label = / initrd /initrd-2.4.20-8.img

FAQ FAQ 1) After the RPM problem enters the compiled kernel, some of the RPM-related commands 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: can not open Packages index using db3 - Resource temporarily unavailable (11) error: can not 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 ​​aion 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 / amix-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 again to VMMon.tar: #TAR CVF VMMon.tar vmnet-only.

If the above operation is still failed, another solution is to download VMware-Any-Updatexx.tar.gz to http://ftp.cvut.cz/vmware/, unzip it into any directory, execute it Runme.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"]; the 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.sinit.bak #sed -e 's /// proc // ksyms /// proc // kallsyms / g' / etc / Rc.d / rc.sysinit.bak> /etc/rc.d/rc.sysinit7Glibc 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/Updates/9/EN/OS/i386/glibc-2.3.2-27.9.i386.rpm.

You can upgrade together with the following packages:

FTP: //ftp.rpmfind.net/linux/redhat/Updates/9/EN/OS/i386/glibc-common-2.3.2-27.9.i386.rpm

ftp://ftp.rpmfind.net/linux/redhat/updates/9/EN/OS/i386/glibc-devel-2.3.2-27.9.i386.rpm

FTP: //ftp.rpmfind.net/linux/redhat/Updates/9/EN/OS/i386/glibc-UTILS-2.3.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.

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

New Post(0)