Linux system master road kernel compilation process analysis

  
                  

Download source code

The Linux kernel is always evolving. The latest kernel Kernel2.6.0 officially supports USB2.0, and the most significant change in the kernel module file suffix is ​​from *.o to *.ko and so on, we can download the tarball source code package from www.kernel.org.

Pre-preparation

Everyone knows to upgrade the "module-init-tools" package first. Otherwise, when you install the kernel module file, the system will prompt you: Warning: You may need to install module-init-tools See http://www.codemonkey.org.uk/post-h...4.21-23.src.rpm.

Go to the download directory and install:

#rpm -e --nodeps modutils (Forcibly uninstall the original modutilsRPM package) #rpm -ivh modutils-2.4.21-23.src. Rpm (install the source code package in the /usr/src/redhat directory) #cd /usr/src/redhat/SPECS (enter the specification file directory) #rpmbuild --bb modutils.spec (generate binary RPM package) # Cd ../RPMS/i386 (turn to the location of the newly generated binary RPM package) #rpm -ivh modutils*.rpm (just generated two [modutils-2.4.21-23.i386.rpm and modutils-debuginfo- 2.4.21.23.i386.rpm] binary RPM package, install it together!)

because it is in RedHat9.0 platform, RedHat users may encounter some trouble, I'll slow Slowly speaking, in addition to the above upgrades, there is a file (/etc/rc.d/rc.sysinit) that may be defective because the /proc/ksyms file is no longer available in the new kernel (Kernel 2.6.0). The open file command is as follows:

#vi /etc/rc.d/rc.sysinit Found: if ! LC_ALL=C grep -iq nomodules /proc/cmdl Ine 2>/dev/null && [ -f /proc/ksyms ]; then USEMODULES=y fi is replaced by: if ! LC_ALL=C grep -iq nomodules /proc/cmdline 2>/dev/null; then USEMODULES = y fi

is the "& & [-f /proc /ksyms]" remove, save file (prior to the backup operation is preferably done so as not to delete the wrong, the file system is the initial script The important thing is that the sub-kernel can load the module, of course, can start the iptable firewall, otherwise the red "failed" is very eye-catching when the firewall is started in the new kernel. (Please check the contents of /proc/sys/kernel/modprobe in the new kernel: /sbin/modprobe, or manually inject the command: #echo "/sbin/modprobe" > /proc/sys/kernel/modprobe ). Let's start building a new kernel.

First, prepare the source code

1, after downloading to the tarball package, copy the kernel tarball package to the /usr/src directory, assuming the package is in the current directory, run the following command: Br>

#cp linux-2.6.0.tar.gz /usr/src

2, go to the /usr/src directory and unpack the tarball package.

#cd /usr /src #tar xvzf linux-2.6.0.tar.gz

3, if you have downloaded the patch, the patch, you can Run the scripts/patch-kernel script file to automatically patch (prepare the patch package) or #zcat patch-2.6.0.gz

Copyright © Windows knowledge All Rights Reserved