#!/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: