0

I got to delete a module(usb-storage.ko) from

/lib/modules/KERNEL-VERSION/kernel/drivers/usb/storage/ directory named usb-storage.ko

Are there any specific source files inside linux/drivers/usb/storage diractory which results in usb-storage.ko?

Please let me know what are the files I can bring to a local directory for compilation to generate a similar usb-storage.ko module.

or even I am curious to know if I can compile this as a module along with the Kernel compilation process (But onlyusb-storage.ko should be compiled)

Thanks for response !!

San
  • 905
  • 3
  • 16
  • 33

1 Answers1

1

To compile usb-storage.ko as module, you need to enable only CONFIG_USB_STORAGE=y and make all the other option disable. This could be done from kernel configuration menu (i.e make menuconfig):

      Device Drivers 
            USB Support
                <M> USB Mass Storage Support

"USB Mass Storage Support" requires "Support for Host-Side USB", so it'll be selected too. So, select it from kernel configuration option via above location.

And to compile the only usb-storage.ko without recompiling the whole kernel every time, need to do the following:

              "make drivers/usb/storage"

Hope it'll help.

rakib_
  • 136,911
  • 4
  • 20
  • 26
  • yes I did the same, but it could not produce `usb-storage.ko` Any clue, if it has some dependencies which need to be included !! – San May 30 '13 at 02:57
  • I'm not sure how did you build the kernel. Have you done - "make modules bzImage" then, "make modules_install; make install;" first command to build the kernel, later commands are to install modules under /lib/$(uname -r)/modules ... – rakib_ May 30 '13 at 03:40
  • I've just reproduced on my system, what I've said. You'll get the usb-storage.ko module under /lib/module/$(uname -r)/kernel/driver/usb/storage/ directory. – rakib_ May 30 '13 at 03:43
  • yes you are correct. But I dont want to compile the other modules unnecessarily. – San May 30 '13 at 04:16
  • do "make drivers/usb/storage", but if other modules aren't compiled then they'll be too. – rakib_ May 30 '13 at 04:24
  • yes, that is the solution I just got. thanks for your response !! – San May 30 '13 at 05:06
  • I've edited my question a bit, to focus that it address your problem perticularly. – rakib_ May 30 '13 at 05:33