in running linux kernel - how to add USB as a module
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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).
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.