LINUX single module Compilation

Source: Internet
Author: User
LINUX single module compilation-Linux general technology-Linux programming and kernel information. The following is a detailed description. 2.6 kernel:
Here we only talk about the module compilation that comes with the kernel. The module compilation provided by the vendor is easier, just make it.
First, we need the source code package of the original kernel. If it is not a release version, we can directly use the standard kernel on kernel.org.
The release uses redhat as an example. src. rpm is required to obtain the source code.
1. Download the corresponding kernel in ftp.redhat.com, my is rhel5 corresponding, kernel-2.6.18-8.1.8.el5.src.rpm
2. Rpm-ivh kernel-2.6.18-8.1.8.el5.src.rpm
3. Cd/usr/src/redhat/SPECS & rpmbuild? Target i686-bp kernel-2.6.spec
In this way, the source code is located in/usr/src/redhat/BUILD. (The first two items of target -)
4. Cd/usr/src/redhat/BUILD/kernel-2.6.18/linux-2.6.18.i686 start Operation

Note: If the standard kernel does not require the above four steps, directly go to the src directory of the kernel.

5.
Make mrproper # delete all configuration files
Make menuconfig # generate the. config file and select the modules to be compiled.
Make net/ipv4/netfilter # suppose I need to compile all modules of netfilter, first make to up to date
Make M = net/ipv4/netfilter # M is equivalent to SUBDIRS and starts to compile the module
Complete. Copy the required. ko file to the corresponding directory under/lib/modules/. Remember to re-generate the dependency tree by running depmod-a, and then install the module by using modprobe.

2.4 kernel:
Make mrproper
Make menuconfig
Make dep # create a module dependency
Make modules SUBDIRS = drivers/net/
After that, retrieve the. o file.
Related Article

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.