1

How to force linux kernel to load my custom module instead of default one ? There is a file:

/lib/modules/$(uname -r)/modules.order

Seems like it is responsible to load modules in specific order. How it can be generated to prioritize my module or maybe it is enough to place it in /etc/modules-load.d for loading during boot and create udev rule binding hardware by productID and vendorID to this custom module ?


Example:

usbhid module is used for mouse and keyboard. I want my mouse uses my custom module instead of usbhid.

14
  • 1
    Why not just give it a different name? Commented Aug 29, 2021 at 15:19
  • Remove the existing one? Use insmod instead? Commented Aug 29, 2021 at 15:21
  • @Bib It will not change anything. Default module will still be loaded and binded e.g. usbhid module will be loaded instead of my custom mouse module (with different name). Commented Aug 29, 2021 at 15:21
  • 1
    Have you read the man page? insmod is not modprobe and it's not automatic module loading. Commented Aug 29, 2021 at 15:46
  • 1
    You're changing your question on the fly. That sucks a lot. Please think it through first next time. OK, normally it's not possible unless the particular module allows to blacklist devices or you need to patch the module so that it ignored certain devices. usbhid has this: parm: quirks:Add/modify USB HID quirks by specifying quirks=vendorID:productID:quirks where vendorID, productID, and quirks are all in 0x-prefixed hex (array of charp). Commented Aug 29, 2021 at 16:45

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.