This shows you the differences between two versions of the page.
isc:labs:kernel:tasks:02 [2021/11/29 14:11] radu.mantu |
isc:labs:kernel:tasks:02 [2022/10/08 22:05] (current) radu.mantu [02. [??p] Kernel modules] |
||
---|---|---|---|
Line 176: | Line 176: | ||
[root@guest]$ cat /proc/modules | [root@guest]$ cat /proc/modules | ||
test 20480 1 - Loading 0xffffffffc0304000 (O+) | test 20480 1 - Loading 0xffffffffc0304000 (O+) | ||
+ | </code> | ||
+ | |||
+ | In this case, the best course of action is to simply reboot, but if you want to risk it, just run ''rmmod -f'' to force unloading the module. Be warned that this is very dangerous. Also, if the module is still there after using the ''-f'' flag, make sure that //CONFIG_MODULE_FORCE_UNLOAD// was set at compile time. | ||
+ | |||
+ | <code bash> | ||
+ | # check if force unloading the module is an option | ||
+ | [root@guest]$ zcat /proc/config.gz | grep CONFIG_MODULE_FORCE_UNLOAD | ||
+ | CONFIG_MODULE_FORCE_UNLOAD=y | ||
+ | |||
+ | # force unload the kernel module | ||
+ | [root@guest]$ rmmod -f test | ||
</code> | </code> | ||
</note> | </note> | ||