From 2708873d33d0aafca2c2ba956c7f2d19c807250d Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Tue, 2 Feb 2016 15:43:15 +0100 Subject: Live init: add 'blacklist' bootparam to prevent loading of kernel driver(s). Any kernel modules mentioned here will be added to the modprobe blacklist. This will help out people who need to blacklist the nouveau driver, for instance if they have a too-new computer. Syntax: blacklist=mod1[,mod2[,...]] --- liveinit | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'liveinit') diff --git a/liveinit b/liveinit index dde270f..69783b8 100755 --- a/liveinit +++ b/liveinit @@ -50,6 +50,9 @@ DEBUG=0 # Masochists can copy the live environment into RAM: TORAM=0 +# Perhaps we need to blacklist some kernel module(s): +BLACKLIST="" + INITRD=$(cat /initrd-name) WAIT=$(cat /wait-for-root) KEYMAP=$(cat /keymap) @@ -74,6 +77,9 @@ for ARG in $(cat /proc/cmdline); do 0|1|2|3|4|5|6|S|s|single) RUNLEVEL=$ARG ;; + blacklist=*) + BLACKLIST=$(echo $ARG | cut -f2 -d=) + ;; debug) DEBUG=1 ;; @@ -573,6 +579,15 @@ EOPW sed -i -e "s/^\(127.0.0.1\t*\)@DARKSTAR@.*/\1${LIVE_HOSTNAME}.example.net ${LIVE_HOSTNAME}/" /mnt/overlay/etc/hosts fi + # Blacklist kernel modules if requested: + if [ ! -z "$BLACKLIST" ]; then + mkdir -p /mnt/overlay/etc/modprobe.d + echo "#Slackware Live blacklist" > /mnt/overlay/etc/modprobe.d/BLACKLIST-live.conf + for kernelmod in $(echo $BLACKLIST |tr ',' ' '); do + echo "blacklist $kernelmod" >> /mnt/overlay/etc/modprobe.d/BLACKLIST-live.conf + done + fi + # Delete ALSA state file, the Live OS may be booted on different computers: rm -f /mnt/overlay/var/lib/alsa/asound.state -- cgit v1.2.3