aboutsummaryrefslogtreecommitdiff
path: root/modprobe-blacklist
diff options
context:
space:
mode:
Diffstat (limited to 'modprobe-blacklist')
-rwxr-xr-xmodprobe-blacklist25
1 files changed, 25 insertions, 0 deletions
diff --git a/modprobe-blacklist b/modprobe-blacklist
new file mode 100755
index 0000000..8af5d90
--- /dev/null
+++ b/modprobe-blacklist
@@ -0,0 +1,25 @@
+#!/bin/bash
+#
+# /etc/rc.gen-modules-list
+#
+
+. /etc/rc.conf
+
+declare -a blacklist
+for mod in "${MODULES[@]}"; do
+ case $mod in
+ !*) blacklist+=("${mod:1}") ;;
+ *) ;;
+ esac
+done
+
+# create new module blacklist in /run/initscripts, there should be a symlink in /etc/modprobe.d/ pointing here
+if [[ $blacklist ]]; then
+ /bin/mkdir -p /run/initscripts
+ echo "# Autogenerated from rc.conf at boot, do not edit" > /run/initscripts/modprobe-blacklist.conf
+ (( ${#blacklist[@]} )) && printf 'blacklist %s\n' "${blacklist[@]}" >> /run/initscripts/modprobe-blacklist.conf
+fi
+
+unset blacklist
+
+# vim: set noet ts=2 sw=2: