Skip to content

Instantly share code, notes, and snippets.

@iamcaleberic
Last active February 19, 2018 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamcaleberic/97a9ee1c95a17414ec07b74b8a8eaedd to your computer and use it in GitHub Desktop.
Save iamcaleberic/97a9ee1c95a17414ec07b74b8a8eaedd to your computer and use it in GitHub Desktop.
Blacklisting a kernel module

Blacklisting a kernel module

  • Some modules are loaded as part of the initramfs. mkinitcpio -M will print out all automatically detected modules: to prevent the initramfs from loading some of those modules, blacklist them in /etc/modprobe.d/modprobe.conf

  • Running mkinitcpio -v will list all modules pulled in by the various hooks:

mkinitcpio -v

  • Once you have your module name, create a .conf file under /etc/modprobe.d/ you can call it whatever name.For the purposes of illustration I will use modprobe.conf
vim /etc/modprobe.d/modprobe.conf
  • In this case I am blacklisting a broadcom module brcmsmac.
# /etc/modprobe.d/modprobe.conf

# Do not load brcmsmac module

blacklist brcmsmac

  • Save the file after adding the modules
  • Remember to add that .conf file to the FILES section in /etc/mkinitcpio.conf, if you have not done so already.
  • Rebuild your initramfs and reboot and you should be good to go.
   mkinitcpio -g  your-image-name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment