LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   in running linux kernel - how to add USB as a module (https://www.linuxquestions.org/questions/linux-newbie-8/in-running-linux-kernel-how-to-add-usb-as-a-module-4175449807/)

swaroop_kv 02-12-2013 07:25 AM

in running linux kernel - how to add USB as a module
 
I configured kernel (2.6.34.14) and installed, while make menuconfig i did not select the USB option (neither as a module nor inside kernel, just put a space). Then saved the config file, and completed the remaining steps that are - make, make install, make modules_install.

when i restarted the system, in older versions i found 2.6.34.14. Its working fine, pendrive or any usb device is not working as i didn't include USB while configuration.

Now if i want to add that functionality to Running or installed linux kernel. what is the procedure?

How can i build only USB, as a module, from source code, and use that in running linux kernel.

jpollard 02-12-2013 10:41 AM

Just change the configuration parameter and rebuild.

Once the updated module is installed (since it will be the same version as the running version) you can then load the modules (no reboot needed).

If you removed and reinstalled the kernel source, then you lost the already build object files (and libraries) used to create the usb module - and they will need to be rebuilt. If you also lost the configuration file, you are in luck - the one you used to build the system is in the /boot/config-<version> file, and you can copy it to .config before you do a "make menuconfig" (or equivalent) to enable the USB module. Note - enabling the USB will also allow you to build any USB layered drivers for your system (both the controller module and device modules that depend on the controller can be created).

swaroop_kv 02-12-2013 12:01 PM

If i make changes to config file, and rebuild, that means building the whole kernel again. I don't want to build the whole kernel again, i just want add the USB functionality to my existing kernel.

In make menuconfig - USB support - previously i entered n (y/n/M), so its not included in the kernel. For USB support 'M' option is not working, only y or n options are working.

that means if i select y, and save changes to .config file, i am asking for including this in the kernel, not as a module, so whole kernel needs to builded again.

so is there no other way to do the above task.

jpollard 02-12-2013 03:01 PM

Hmmm... It isn't the controllers.

It must be some kernel side support that is needed for them though. Though on mine it (it is an old kernel- 2.6.36) it is still listed as a module.

Now some of the flags are not for modules, but options within the module. The "support for host-side USB" is/can be a module (name is "usbcore"), and modprobe should load it automatically along with any USB drivers required. I was building my systems from a Fedora starting point, so this was included in the kernel at build time. The "USB announce new devices" is an option to the host-side USB module.

What version are you trying out?


All times are GMT -5. The time now is 04:24 AM.