Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reload modified kernel modules

How can I instruct the system to reload all kernel modules that have changed? (I am developing a driver with several modules. I want a quick and error-free method to reload all the modules that change.)

like image 203
apoorv020 Avatar asked Jan 10 '11 10:01

apoorv020


People also ask

Does modprobe require a reboot?

Description. Modules are pieces of code which extend the functionality of the operating system kernel without the need to reboot. Once loaded, modules reside in memory, and can be instantiated multiple times; they can be thought of as analogous to a device driver.

Which command loads kernel module?

To load a kernel module, we can use the insmod (insert module) command.

How do I load a module at boot time?

To load a module on boot, you create a file in /etc/modules-load. d/ ; this file can have any name, but must end in . conf . In the case of your wifi driver, you could for example create the file /etc/modules-load.

Which command is used to add loadable kernel module?

Adding/Loading Of Kernel Module To load the kernel module, just execute the command as insmod followed by the module file name.

How do loadable kernel modules work?

In computing, a loadable kernel module (LKM) is an object file that contains code to extend the running kernel, or so-called base kernel, of an operating system. LKMs are typically used to add support for new hardware (as device drivers) and/or filesystems, or for adding system calls.


1 Answers

There is no simple, error-free way since a bug in the code that adds/removes the driver from the kernel can make it impossible to get rid of a module. In a similar way, a bug in the driver can cause a deadlock in some interrupt handler so the kernel can never unload the module.

Also, there is no automatic way to do it since the kernel doesn't check the modules files for changes.

All you can do is write a small script that calls rmmod in the correct order to remove the modules and then modprobe's the new versions into the kernel.

like image 80
Aaron Digulla Avatar answered Sep 19 '22 10:09

Aaron Digulla