From ab9d5d3cc3e4c4c7112f6c3052d38873300bb380 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Mon, 13 Jan 2014 15:41:08 -0500 Subject: [PATCH] Add new modprobe-blacklist element. This element can be used to provide a custom list of modules via DIB_MODPROBE_BLACKLIST which will be disabled via modprobe.d/blacklist.conf. I'm using this to disable network adapters on the Red Hat TripleO rack where the devices can't be explicitly disabled via the BIOS. Change-Id: I8a0a8ee05fa62628434d7f6422577dbf5cdd7a2e --- elements/modprobe-blacklist/README.md | 9 +++++++++ .../modprobe-blacklist/install.d/80-modprobe-blacklist | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 elements/modprobe-blacklist/README.md create mode 100755 elements/modprobe-blacklist/install.d/80-modprobe-blacklist diff --git a/elements/modprobe-blacklist/README.md b/elements/modprobe-blacklist/README.md new file mode 100644 index 000000000..5f8c48db6 --- /dev/null +++ b/elements/modprobe-blacklist/README.md @@ -0,0 +1,9 @@ +Blacklist specific modules using modprobe.d/blacklist.conf. + +In order to use set DIB_MODPROBE_BLACKLIST to the name of your +module. To disable multiple modules you can set DIB_MODPROBE_BLACKLIST +to a list of string separated by spaces. + +Example: + + export DIB_MODPROBE_BLACKLIST="igb" diff --git a/elements/modprobe-blacklist/install.d/80-modprobe-blacklist b/elements/modprobe-blacklist/install.d/80-modprobe-blacklist new file mode 100755 index 000000000..f787d0163 --- /dev/null +++ b/elements/modprobe-blacklist/install.d/80-modprobe-blacklist @@ -0,0 +1,8 @@ +#!/bin/bash +set -ex + +MODULES_LIST=${DIB_MODPROBE_BLACKLIST:?"Please set DIB_MODPROBE_BLACKLIST."} + +for mod_name in $MODULES_LIST; do + echo "blacklist $mod_name" >> /etc/modprobe.d/blacklist.conf +done