To unload a kernel module, for instances pcspkr.ko, simply issue the rmmod command with the kernel module as argument. However this will only take place for the current session, the next time you reboot the machine hte kernel module will load. To prevent this we need to blacklist it by adding it to
/etc/modprobe.d/blacklist.conf.
Putting everything together:
$ su
# rmmod -v pcspkr
# echo "blacklist pcspkr" >> /etc/modprobe.d/blacklist.conf
On step 1 we've changed to superuser, on step 2 the kernel module (pcspkr was selected as an example) was removed from the current session and on step 3 we've prevented it from loading at boot.
As a side note, to list the currently loaded kernel modules run lsmod.
No comments:
Post a Comment