如何找到与特定版本的Ubuntu对应的内核源码?

时间:2015-08-30 03:09:24

标签: ubuntu linux-kernel

最近,我正在做一些关于无线网络的研究,为了实现我的实验目标,必须对mac80211_hwsim进行一些更改,但是找不到与特定版本的Ubuntu相对应的内核源代码?如果有人能告诉我如何解决这个问题,那将会很有帮助。谢谢!

lihui@ubuntu:~$ modinfo mac80211_hwsim filename: /lib/modules/3.16.0-30-generic/kernel/drivers/net/wireless/mac80211_hwsim.ko license: GPL description: Software simulator of 802.11 radio(s) for mac80211 author: Jouni Malinen srcversion: FEC587C589C9B337D559437 depends: mac80211,cfg80211 intree: Y vermagic: 3.16.0-30-generic SMP mod_unload modversions signer: Magrathea: Glacier signing key sig_key: 7B:E2:A7:20:0F:17:F0:0C:A0:11:F7:0E:5A:87:4C:37:E3:E0:F6:BE sig_hashalgo: sha512 parm: radios:Number of simulated radios (int) parm: channels:Number of concurrent channels (int) parm: paged_rx:Use paged SKBs for RX instead of linear ones (bool) parm: rctbl:Handle rate control table (bool) parm: support_p2p_device:Support P2P-Device interface type (bool) parm: regtest:The type of regulatory test we want to run (int) lihui@ubuntu:~$ uname -a Linux ubuntu 3.16.0-30-generic #40~14.04.1-Ubuntu SMP Thu Jan 15 17:43:14 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

2 个答案:

答案 0 :(得分:1)

使用以下命令获取当前系统内核的源代码:

sudo apt-get source linux-source

There is a good reference with more details

答案 1 :(得分:0)

您是否要对mac80211_hwsim内核模块进行更改? 如果需要,你必须下载Linux 3.16的代码,你可以在linux / drivers / net / wireless / mac80211_hwsim.c找到代码。

您可以轻松找到有关下载和在线设置内核环境的资料。

如果您想学习和使用内核模块,下面的链接非常好。 https://wireless.wiki.kernel.org/en/users/drivers/mac80211_hwsim