Trick on the Version Magic Number of Linux Kernel
来源:互联网 发布:深圳市软件协会网站 编辑:程序博客网 时间:2024/04/28 20:36
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 will talk about below.
Kernel vermagic
The version magic number of the kernel that being used to build the
externel module has to be exactly the same as the kernel running 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 this case, I would like to
avoid to build and replace the whole kernel. The wireless driver is the
only kernel module that 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 of the following four parts which can be found at
the beginning of Makefile:
The guide
indicates that modifying the Makefile as shown below, simply use the VC
number as EXTRAVERSION which is originaly omitted will solve the
problem. However, you will end up with 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 a little dig into Makefile, it
turns out version number is stored in the file
include/config/kernel.release and the local version is generated by the
script scripts/setlocalversion. By default, it will check if version
control system is available. If so, then it will append “dirty” to local
version after the commit number if the commit haven’t been submitted.
That is 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
- Trick on the Version Magic Number of Linux Kernel
- kernel version magic error
- kernel version magic问题
- The VirtualBox kernel modules do not match this version of VirtualBox 解决 (linux update,nvidia失败)
- The Mindmaps of Linux Kernel
- Installing Linux Kernel 2.6.23 on the PPC405 core of a Xilinx ML403 board
- Linux Kernel---some source on the internet.
- Notes on "Understanding the Linux kernel“
- Notes on Understanding The Linux Kernel
- Notes on Understanding the Linux Kernel
- Notes on Understanding the Linux Kernel
- Notes on Understanding the Linux Kernel
- Notes on Understanding the Linux Kernel
- Notes on Understanding the Linux Kernel
- Conceptual Architecture of the Linux Kernel(ZT)
- Analyse the Booting process of Linux Kernel
- solve the version conflict of google test on ubuntu
- understanding the kernel of the linux the third vesion
- (八) Testing(测试)
- LR监控linux之详解rstatd的安装-Zee
- MyEclipse+Nexus+Jenkins+Sonar+Tomcat+SVN持续集成环境实战篇
- CString 成员函数用法大全
- Fedora Linux 16 root用户无法登陆
- Trick on the Version Magic Number of Linux Kernel
- uva 11726(凸包)
- 清华牛人----------王垠--------------------清华梦的粉碎
- 【JavaMail开发总结】开发前的配置
- com.google.gson.internal.StringMap cannot be cast to
- Codeforces Round #313 (Div. 2) Gerald's Hexagon
- Adnroid在命令行下拉和收缩状态栏
- Docker Mac服务启动问题
- bzoj 2879