Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to add usb network support to a real-time Linux distribution we're using at work. USB devices are recognized, but when connecting a usb network adapter no network interface is created.

From what I've read this requires recompiling the kernel build with usbnet support enabled. I don't mind doing this, but the problem is that I can't seem to find any instructions on how to do this. Can anyone point me in the right direction?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Sure! I've compiled more than my fair share of kernels.

First, you have to make sure you have your kernel's source on your hard drive. Look for a package called "kernel-source" or something. On my Slackware box, this installs the complete unmodified kernel source to /usr/src/linux-x.x.xx.x. A lot of times, different distros will have patched kernels, or custom configurations. A lot of the time, you'll find these saved in the file /boot/config.

If you don't want to mess with your system folders, I'd suggest you copy the kernel source to a temporary location before attempting compilation:

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

Next, you will need to get into the kernel configuration menu:

$ make menuconfig

This will do some initial compiling of the configuration menuing system and bring you to the configuration menu:

 .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 >                     |
  +-------------------------------------------------------------------------+

In order to load your current kernel's configuration (so everything you have currently working will still work once you install the new kernel and boot from it), select Load an Alternate Configuration File and then type in "/boot/config".

Next, navigate the menus to the option you want to enable and press the space bar until it reads "*" (compiled into the kernel) or "M" (compiled as modprobe-able kernel module).

Once you have everything right, exit the configurator and type:

$ make bzImage

This will make a the kernel image. Install it by carefully reading the lilo or grub man pages.

share|improve this answer
    
Thanks for your response. However, I don't need it anymore because a colleague of mine already started rebuilding the kernel :) –  StackedCrooked May 27 '10 at 14:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.