Files
webgui/etc/rc.d/rc.modules
Tom Mortensen f9ec00b488 repo reorg
2023-06-02 12:49:33 -07:00

57 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# /etc/rc.d/rc.modules
# Determine the version of the running kernel:
RELEASE=$(uname -r)
# limetech - install third-party modules
echo "Installing third-party drivers:"
find /boot/config/plugins/*/packages/${RELEASE%%-*}/ -maxdepth 1 -type f 2>/dev/null | while read -r PKG
do
if [[ $PKG == *"-$RELEASE-"*.t?z ]]; then
if [[ -f $PKG.md5 ]]; then
SUM1=$(/usr/bin/md5sum $PKG)
SUM2=$(/usr/bin/cat $PKG.md5)
if [[ "${SUM1:0:31}" != "${SUM2:0:31}" ]]; then
echo "$PKG md5 error"
continue
fi
fi
if [[ -f $PKG.sha256 ]]; then
SUM1=$(/usr/bin/sha256sum $PKG)
SUM2=$(/usr/bin/cat $PKG.sha256)
if [[ "${SUM1:0:63}" != "${SUM2:0:63}" ]]; then
echo "$PKG sha256 error"
continue
fi
fi
echo "installing $PKG"
/sbin/installpkg $PKG
# force creating new modules.dep
rm -f /lib/modules/$RELEASE/modules.dep
fi
done
# Update kernel module dependencies:
if [ -e "/lib/modules/$RELEASE/modules.dep" ]; then
echo "Updating module dependency list for $RELEASE: /sbin/depmod --quick"
/sbin/depmod --quick
else
echo "Creating module dependency list for $RELEASE: /sbin/depmod --all"
/sbin/depmod --all
fi
# Run any rc.modules-$(uname -r) file that exists (this is used
# if you have specific modules which should only be loaded for
# specific kernel versions):
if [ -x "/etc/rc.d/rc.modules-$RELEASE" ]; then
/etc/rc.d/rc.modules-$RELEASE
fi
# Run a local (sysadmin-version) of rc.modules if it exists:
if [ -x "/etc/rc.d/rc.modules.local" ]; then
/etc/rc.d/rc.modules.local
fi