summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2016-06-15 10:54:13 +0200
committer Eric Hameleers <alien@slackware.com>2016-06-15 10:54:13 +0200
commit930ccf2cb0520107fe72f6deef82d2145713a7b5 (patch)
tree2cb7b258b9cc96915575bf7b8422c0c7801c4c68
parenta4a87869b08723a3d784bec866e53939d9579d1d (diff)
downloadliveslak-930ccf2cb0520107fe72f6deef82d2145713a7b5.tar.gz
liveslak-930ccf2cb0520107fe72f6deef82d2145713a7b5.tar.xz
Deal properly with the user enabling any optional/addon kernel modules.
When the user loads a non-system squashfs module (for instance from the optional or addons subdirectories) and this contains kernel modules, then the kernel must be made aware using a "depmod -a" call. The previous implementation did this at the end of rc.local but that was too late in the boot process: the kernel needs to be aware of the new modules straight from the start, so that udev can enable the hardware which is supported by these new kernel drivers on time. So the depmod call was moved to the live init script (inside the initrd).
-rwxr-xr-xliveinit17
-rwxr-xr-xmake_slackware_live.sh17
2 files changed, 17 insertions, 17 deletions
diff --git a/liveinit b/liveinit
index 68a0713..43c8a9c 100755
--- a/liveinit
+++ b/liveinit
@@ -1004,6 +1004,23 @@ EOT
done
fi
+ # Find out if the user enabled any optional/addon kernel modules:
+ RUN_DEPMOD=0
+ for MOD in $(cat /sys/block/loop*/loop/backing_file |grep -E "optional|addons")
+ 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 "${MARKER}: Additional kernel module(s) found... need a bit"
+ chroot /mnt/overlay /sbin/depmod -a
+ fi
+ unset RUN_DEPMOD
+
# Delete ALSA state file, the Live OS may be booted on different computers:
rm -f /mnt/overlay/var/lib/alsa/asound.state
diff --git a/make_slackware_live.sh b/make_slackware_live.sh
index 89eedea..a504c0c 100755
--- a/make_slackware_live.sh
+++ b/make_slackware_live.sh
@@ -1585,23 +1585,6 @@ 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