简体   繁体   English

发行内核模块

[英]Issue compiling kernel modules

I bought a new Toshiba Satellite C855 and installed Ubuntu 12.10 on it only to find that the preinstalled drivers for wifi and ethernet do not work. 我购买了新的Toshiba Satellite C855并在其上安装了Ubuntu 12.10,结果发现预先安装的wifi和以太网驱动程序不起作用。 As a result, this new computer has absolutely no internet access. 结果,这台新计算机绝对无法访问互联网。 I downloaded the source for the correct drivers and I am currently working on installing them. 我下载了正确驱动程序的源代码,目前正在安装它们。 When I build the modules I get the following error 构建模块时,出现以下错误

make -C /lib/modules/3.5.0-17-generic/build M=/home/<user>/Desktop/rtl_92ce_92se_8723ae_88ee_linux_mac80211_0012.0207.2013 modules
make[1]: Entering directory `/lib/modules/3.5.0-17-generic/build`
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory `/lib/modules/3.5.0-17-generic/build`
make: *** [all] Error 2

I had to make the /lib/modules/3.5.0-17-generic/build directory. 我必须制作/lib/modules/3.5.0-17-generic/build目录。 I DO have the headers installed (at /usr/src/linux-headers-3.5.0-17/ ). 我确实安装了标头(位于/usr/src/linux-headers-3.5.0-17/ )。 I have also done a lot of googling on this subject before posting this question, but everything I found was either dead or left unanswered. 在发布此问题之前,我也对此问题进行了很多搜索,但是我发现的所有内容都已消失或无法回答。

Note: I would much rather avoid showing outputs. 注意:我宁愿避免显示输出。 Since this computer that I am posting from is not the Toshiba machine and the new machine does not have internet access, I have to manually type outputs or hassle with a flash drive. 由于我要从中发布的计算机不是东芝机器,并且新机器无法访问互联网,因此我必须手动键入输出或使用闪存驱动器麻烦。 Also, if I need any to install any packages, I also need links to .deb packages, not apt-get install commands. 另外,如果我需要安装任何软件包,则还需要指向.deb软件包的链接,而不是apt-get install命令。

Thanks ahead. 谢谢你

I managed to fix it on my own and figured I'd post my solution: 我设法自己修复了这个问题,并认为我会发布解决方案:

In my original question I said that I had to mkdir the build directory. 在我最初的问题中,我说过我必须mkdir构建目录。 What I didn't realize was this was supposed to be a symlink to the kernel source directory. 我没有意识到这应该是到内核源目录的符号链接。 Once I did that, everything (including my ethernet, wifi is still a bit iffy) suddenly works. 一旦这样做,一切(包括我的以太网,wifi仍然很不稳定)突然起作用。

I would advice you to stop your efforts compiling this on the destination PC. 我建议您停止在目标PC上进行编译。 you are missing all the essential tools to compile the kernel, and obtaining them without an Internet connection is a tedious job, handling all dependencies, it's a nightmare. 您缺少了编译内核的所有基本工具,并且在没有Internet连接的情况下获得它们是一件繁琐的工作,要处理所有依赖项,这是一场噩梦。

You have two options: 您有两种选择:

  1. Search for a binary module, that was pre-compiled for you target PC. 搜索为目标PC预编译的二进制模块。
  2. Compile it yourself, on another machine, I would suggest doing it under virtualbox / vmware, so you can install the exact version of Ubuntu, you're trying to compile for. 我建议自己在另一台计算机上进行编译,建议在virtualbox / vmware下进行编译,以便您可以安装要编译的确切版本的Ubuntu。 then just copy the .ko to your target, insmod , and you're ready to go. 然后只需将.ko复制到目标insmod ,就可以开始了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM