Compile only one module in the kernel-general Linux technology-Linux programming and kernel information. For details, see the following. This article should be helpful for siblings who do not want to compile all modules for a single module
Thanks to dooom's hard work
---------------------------------------------------------------------
Compile only one module in the kernel. : D
I have seen many of my colleagues asking this question. I will explain it here. I think DIYers, which deals with the kernel every day, should be very useful.
The procedure is as follows.
1. Decompress the kernel. For example:
Tar-zxvf kenerl-source.tar.gz
2. Set CONFIGURE.
Make menuconfig
(Make xconfig often does not work normally. This text format is correct .)
3. Establish dependency.
Make dep
4. Compile a kernel module.
For example, we want to compile the SCYLD driver. Go to the SCLYD source code directory.
Cd/usr/src/linux/scyld
Gcc-dsf-kernel _-DMODULE-I/usr/src/linux/include/-O3-c 3c59x. c
Or
Gcc-dsf-kernel _-DMODULE-I/usr/src/linux/include /\
-Wall-Wstrict-prototypes-O3-c 3c59x. c
Or
Gcc-dsf-kernel _-DMODULE-I/usr/src/linux/include /\
-Wall-Wstrict-prototypes \
-Include/usr/src/linux/include/linux/modversions. h-DMODVERSIONS-O3-c 3c59x. c
If you encounter a VERSION. H error, always this:
Cd/usr/src/linux, make include/linux/version. h
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