如何将usbnet驱动程序添加到Linux内核?


0

我想将usb网络支持添加到我们正在使用的实时Linux发行版中。USB设备已被识别,但在连接USB网络适配器时,不会创建任何网络接口。

根据我的阅读,这需要重新编译启用了usbnet支持的内核版本。我不介意这样做,但问题是我似乎无法找到有关如何执行此操作的任何说明。谁能指出我正确的方向?

Answers:


2

当然!我编译的内核不仅仅是我公平的内核。

首先,您必须确保在硬盘上拥有内核的源代码。寻找一个名为“kernel-source”的软件包。在我的Slackware框中,这将安装完整的未修改内核源代码/usr/src/linux-x.x.xx.x。很多时候,不同的发行版都会修补内核或自定义配置。很多时候,你会发现这些保存在文件中/boot/config

如果您不想弄乱系统文件夹,我建议您在尝试编译之前将内核源代码复制到临时位置:

$ cp -rp /usr/src/linux-2.6.33.4 /tmp/kernel-build
$ cd /tmp/kernel-build

接下来,您需要进入内核配置菜单:

$ make menuconfig

这将对配置菜单系统进行一些初始编译,并进入配置菜单:

 .config - Linux Kernel v2.6.33.4 Configuration
 ------------------------------------------------------------------------------
  l---------------------- Linux Kernel Configuration -----------------------+
  |  Arrow keys navigate the menu.  <Enter> selects submenus --->.          |
  |  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes, |
  |  <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help, </> |
  |  for Search.  Legend: [*] built-in  [ ] excluded  <M> module  < >       |
  | +---------------------------------------------------------------------+ |
  | |        General setup  --->                                          | |
  | |    [*] Enable loadable module support  --->                         | |
  | |    -*- Enable the block layer  --->                                 | |
  | |        Processor type and features  --->                            | |
  | |        Power management and ACPI options  --->                      | |
  | |        Bus options (PCI etc.)  --->                                 | |
  | |        Executable file formats / Emulations  --->                   | |
  | |    -*- Networking support  --->                                     | |
  | |        Device Drivers  --->                                         | |
  | |        Firmware Drivers  --->                                       | |
  | |        File systems  --->                                           | |
  | |        Kernel hacking  --->                                         | |
  | |        Security options  --->                                       | |
  | |    -*- Cryptographic API  --->                                      | |
  | |    [*] Virtualization  --->                                         | |
  | |        Library routines  --->                                       | |
  | |    ---                                                              | |
  | |        Load an Alternate Configuration File                         | |
  | |        Save an Alternate Configuration File                         | |
  | +---------------------------------------------------------------------+ |
  +-------------------------------------------------------------------------+
  |                    <Select>    < Exit >    < Help >                     |
  +-------------------------------------------------------------------------+

为了加载当前内核的配置(因此,一旦安装新内核并从中启动,您当前工作的所有内容仍然有效),选择Load an Alternate Configuration File然后键入“/ boot / config”。

接下来,将菜单导航到要启用的选项,然后按空格键,直到它显示“*”(编译到内核中)或“M”(编译为modprobe可用的内核模块)。

一切正确后,退出配置程序并键入:

$ make bzImage

这将成为内核映像。通过仔细阅读lilogrub手册页安装它。


感谢您的答复。但是,我不再需要它,因为我的同事已经开始重建内核:)
StackedCrooked 2010年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.