summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2016-05-17 20:45:56 +0200
committer Eric Hameleers <alien@slackware.com>2016-05-17 20:45:56 +0200
commitc3eddb334fc537e0a1dd0ddf27c43b421eaf832a (patch)
treee39f9033f1f239dcc01502a8dacaf78252815e4d
parent0131eed89a86c11d9223c056f280bf8bd5760f7e (diff)
downloadliveslak-c3eddb334fc537e0a1dd0ddf27c43b421eaf832a.tar.gz
liveslak-c3eddb334fc537e0a1dd0ddf27c43b421eaf832a.tar.xz
Call 'depmod' when a loaded optional/addon contains kernel modules.
-rwxr-xr-xliveinit2
-rwxr-xr-xmake_slackware_live.sh20
2 files changed, 18 insertions, 4 deletions
diff --git a/liveinit b/liveinit
index aee9f6f..ad44fa2 100755
--- a/liveinit
+++ b/liveinit
@@ -740,7 +740,7 @@ if [ "$RESCUE" = "" ]; then
# Make the underpinning RAM fs accessible in the live system (for fun):
mkdir -p /mnt/overlay/mnt/live
- mount --bind /mnt/live /mnt/overlay/mnt/live
+ mount --rbind /mnt/live /mnt/overlay/mnt/live
mkdir -p /mnt/overlay/mnt/${LIVEMAIN}fs
mount --bind /mnt/${LIVEMAIN}fs /mnt/overlay/mnt/${LIVEMAIN}fs
diff --git a/make_slackware_live.sh b/make_slackware_live.sh
index 5a82823..e436b96 100755
--- a/make_slackware_live.sh
+++ b/make_slackware_live.sh
@@ -1579,13 +1579,27 @@ sed -e "s% /sbin/depmod -%#&%" -i ${LIVE_ROOTDIR}/etc/rc.d/rc.modules
# If we detect a NVIDIA driver, then run the nvidia install routine:
cat <<EOT >> ${LIVE_ROOTDIR}/etc/rc.d/rc.local
+# Find out if the user enabled any optional/addon kernel modules:
+RUN_DEPMOD=0
+for MOD in \$(losetup -l |grep -E "optional|addons" |tr -s ' ' |cut -d' ' -f6)
+do
+ if [ -d /mnt/live/modules/\$(basename \$MOD .sxz)/lib/modules/\$(uname -r)/ ]
+ then
+ # Found kernel modules directory; we need to make a 'depmod' call.
+ RUN_DEPMOD=1
+ fi
+done
+if [ \$RUN_DEPMOD -eq 1 ]; then
+ # This costs a few seconds in additional boot-up time unfortunately:
+ echo "A bit of patience while we register your new kernel module(s)..."
+ /sbin/depmod -a
+fi
+unset RUN_DEPMOD
+
# Deal with the presence of NVIDIA drivers:
if [ -x /usr/sbin/nvidia-switch ]; then
if [ -f /usr/lib${DIRSUFFIX}/xorg/modules/extensions/libglx.so.*-nvidia -a -f /usr/lib${DIRSUFFIX}/xorg/modules/drivers/nvidia_drv.so ]; then
echo "-- Installing binary Nvidia drivers: /usr/sbin/nvidia-switch --install"
- # The nvidia kernel module needs to ne announced to the kernel.
- # This costs a few seconds in additional boot-up time unfortunately:
- /sbin/depmod -a
/usr/sbin/nvidia-switch --install
fi
# For CUDA/OpenCL to work after reboot, create missing nvidia device nodes: