Linux Kernel compilation expert tutorial (1)

Source: Internet
Author: User

Download source code

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

Preparations

We all know that we need 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:

 
 
  1. # Rpm-e -- nodeps modutils force uninstall the original modutilsRPM package) # rpm-ivh modutils-2.4.21-23.src.rpm put the source code
  2. Package installed in the/usr/src/redhat Directory) 
  3. # Cd/usr/src/redhat/SPECS to enter the standard file directory) 
  4. # Rpmbuild -- bb modutils. spec to generate a binary RPM package) 
  5. # Cd ../RPMS/i386 transfer to the location of the generated binary RPM package) 
  6. # Rpm-ivh modutils *. rpm just generated two [modutils-2.4.21- 
  7. 23. i386.rpm and modutils-debuginfo-
  8. 2.4.21.23.i386.rpm] install the binary RPM package together !) 

Because it is on the RedHat9.0 platform, RedHat users may encounter some problems. I will slowly say that in addition to the above upgrades, there is also a file/etc/rc. d/rc. sysinit) may be defective because the/proc/ksyms file is no longer available in the new kernel Kernel2.6.0). The command to open the file is as follows:

 
 
  1. # Vi/etc/rc. d/rc. sysinit:If! LC_ALL = C
  2. Grep-iq nomodules/proc/cmdline 2>/dev/Null&&[-
  3. F/proc/ksyms]; thenUSEMODULES = yfi replacement
  4. To:If! LC_ALL = C grep-iq nomodules/proc/cmdline
  5. 2>/dev/Null; ThenUSEMODULES = yfi

That is to say, remove "& [-f/proc/ksyms]". It is best to back up the file before saving it to avoid deletion errors. This file is the initial script of the system and is very important ), in this way, the kernel can load the module. Of course, the iptable firewall can be started. Otherwise, the red "failed" of the firewall when it is started in the new kernel is very eye-catching. Check whether the content in/proc/sys/kernel/modprobe in the new kernel is/sbin/modprobe. You can also manually inject the command: # echo "/sbin/modprobe">/proc/sys/kernel/modprobe ). Start to construct the new kernel.


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.