summaryrefslogtreecommitdiffstats
path: root/liveinit
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2016-02-02 15:43:15 +0100
committer Eric Hameleers <alien@slackware.com>2016-02-02 15:43:15 +0100
commit2708873d33d0aafca2c2ba956c7f2d19c807250d (patch)
tree811eb1a2cb5dfa11e9fe11132f2f7c22805e61ad /liveinit
parent1307862b89c95011961f994de925abf83b4be23f (diff)
downloadliveslak-2708873d33d0aafca2c2ba956c7f2d19c807250d.tar.gz
liveslak-2708873d33d0aafca2c2ba956c7f2d19c807250d.tar.xz
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[,...]]
Diffstat (limited to 'liveinit')
-rwxr-xr-xliveinit15
1 files changed, 15 insertions, 0 deletions
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