slight change in where 'safe mode' is checked in installing 3rd party drivers

This commit is contained in:
Tom Mortensen
2023-11-15 15:46:05 -08:00
parent e908db97f8
commit 3e74f3ecb4
3 changed files with 31 additions and 37 deletions
+1 -2
View File
@@ -101,8 +101,7 @@ if /sbin/blkid -s TYPE $DEVICE | /bin/grep -q "btrfs" ; then
else
/bin/echo "Checking $DEVICE ..."
/sbin/fsck.fat -a -w $DEVICE 2>/dev/null
/sbin/mount -v -t vfat -o auto,rw,flush,noatime,nodiratime,dmask=77,fmask=177,shortname=mixed $DEVICE /boot || abort "cannot mo>
/sbin/mount -v -t vfat -o auto,rw,flush,noatime,nodiratime,dmask=77,fmask=177,shortname=mixed $DEVICE /boot || abort "cannot mount $DEVICE"
fi
# check initial files used to boot
+4 -13
View File
@@ -15,19 +15,10 @@
# LimeTech - bind selected devices to vfio-pci
/usr/local/sbin/vfio-pci 1>/var/log/vfio-pci 2>/var/log/vfio-pci-errors
# If "unraidsafemode" indicated, skip installing driver packages
if [[ -f /boot/unraidsafemode ]] || grep -wq unraidsafemode /proc/cmdline; then
log "Unraid Safe Mode (unraidsafemode) has been set, skip driver installation"
# 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
else
# Run the kernel module script. This updates the module dependencies and
# also supports manually loading kernel modules through rc.modules.local.
if [[ -x /etc/rc.d/rc.modules ]]; then
/etc/rc.d/rc.modules
fi
# Run the kernel module script. This updates the module dependencies and
# also supports manually loading kernel modules through rc.modules.local.
if [[ -x /etc/rc.d/rc.modules ]]; then
/etc/rc.d/rc.modules
fi
# Initialize udev to manage /dev entries and hotplugging.
+26 -22
View File
@@ -12,31 +12,35 @@ RELEASE=$(uname -r)
. /etc/rc.d/rc.runlog
# LimeTech - install third-party modules
log "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
HASH1=$(md5sum $PKG)
HASH2=$(cat $PKG.md5)
if [[ ${HASH1:0:32} != ${HASH2:0:32} ]]; then
log "Package $PKG has MD5 error, not installing"
continue
if [[ -f /boot/unraidsafemode ]] || grep -wq unraidsafemode /proc/cmdline; then
log "Unraid Safe Mode (unraidsafemode) has been set, skip driver installation"
else
log "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
HASH1=$(md5sum $PKG)
HASH2=$(cat $PKG.md5)
if [[ ${HASH1:0:32} != ${HASH2:0:32} ]]; then
log "Package $PKG has MD5 error, not installing"
continue
fi
fi
fi
if [[ -f $PKG.sha256 ]]; then
HASH1=$(sha256sum $PKG)
HASH2=$(cat $PKG.sha256)
if [[ ${HASH1:0:64} != ${HASH2:0:64} ]]; then
log "Package $PKG has SHA256 error, not installing"
continue
if [[ -f $PKG.sha256 ]]; then
HASH1=$(sha256sum $PKG)
HASH2=$(cat $PKG.sha256)
if [[ ${HASH1:0:64} != ${HASH2:0:64} ]]; then
log "Package $PKG has SHA256 error, not installing"
continue
fi
fi
log "Installing package: $PKG"
/sbin/installpkg $PKG
# force creating new modules.dep
rm -f /lib/modules/$RELEASE/modules.dep
fi
log "Installing package: $PKG"
/sbin/installpkg $PKG
# force creating new modules.dep
rm -f /lib/modules/$RELEASE/modules.dep
fi
done
done
fi
# Update kernel module dependencies:
if [[ -e /lib/modules/$RELEASE/modules.dep ]]; then