2
votes

I have modified the default "nvme" device driver to suit my project and I am trying to automatically load the modified nvme driver (mnvme) at boot time but I am not successful.

I have edited /lib/modules/{kernel-version}/modules.alias file to include "mnvme" instead of "nvme" but the default "nvme" keeps getting loaded.

I also see mnvme: module verification failed: signature and/or required key missing - tainting kernel on kernel messages.

Note: I am able to manually remove "nvme" and load "mnvme" using rmmod and insmod commands respectively. I would prefer to do it automatically at boot time

Thanks, Bala.

1
There is special folder called extra under /lib/modules/$KVER/kernel. It contains modules that override existing ones.0andriy

1 Answers

2
votes

To automatically load your module:

  1. Copy all .ko files related to your module into respective location under /lib/modules/{kernel-version}/kernel/, e.g. under /lib/modules/4.1.19-v7+/kernel/drivers/nvme/ for nvme driver.

  2. Run depmod -a. That should update information required by modprobe which is used to automatically load the modified module. A useful resource for how kernel modules get loaded is section 1.2 'How Do Modules Get Into The Kernel?' of this guide http://www.tldp.org/LDP/lkmpg/2.6/lkmpg.pdf.

  3. If you've modified any headers that you need in user space then make sure to update relevant header file under /usr/include.

To avoid taint message, the commit the changes you've made, e.g. git commit -sam "....".