Trick on the Version Magic number of Linux Kernel__linux

Source: Internet
Author: User

trick on the Verson Magic number of Linux Kernel

MAR 15TH, 2013 |
COMMENTS

Recently, I was working on building a modified wireless driver for Nexus
7 to support monitor mode. There are quite a few things that are very
Subtle and easy to get confused. I ' ll just write down the steps in case
That I forgot and might need them again.

This
is actually a very good guide for building customized kernel module
Except the issue I'll talk about below.

Kernel vermagic

The version magic number of the kernel that being used to build the
Externel module has to is exactly the same as the kernel on the
Device. It won ' t be a problem if you build the module and kernel, then
Load both of them to the device. However, in the case, I would like to
Avoid to build and replace the whole kernel. The wireless driver is the
Only kernel module-I want to build. Therefore, the kernel version
Magic has to be modified. The vermagic for the device is
"3.1.10-g05b777c SMP preempt mod_unload ARMv7" while my source code
Gives "3.1.10-g22b4fcd-dirty SMP preempt mod_unload ARMv7". So "3.1.10"
is the kernel version, it should match with the version of the kernel
Source. It consists the following four parts which can is found at
The beginning of Makefile:

The Guide
Indicates that modifying the Makefile as shown below and simply use the VC
Number as extraversion which is originaly omitted would solve the
Problem. However, you'll end up with the something like
"3.1.10-g05b777c-g22b4fcd-dirty SMP preempt mod_unload ARMv7".

"-g05b777c" is the number of current version generated by the version
Control system (git, SVN, etc.). After the a little dig into Makefile, it
Turns out version number are stored in the file
Include/config/kernel.release and the local version are generated by the
Script Scripts/setlocalversion. By default, it would check if version
Control system is available. If So, then it would append "dirty" to the local
Version after the commit number if the commit haven ' t been submitted.
Where "-g22b4fcd-dirty" comes from. We could simply supplement a
Parameter as Scripts/setlocalversion–save-scmversion and it won ' t
Generate the local version number.

Kernel source Root Path:makefile

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.