From 3e74f3ecb46d3718f5ca19488800ab6ae278a528 Mon Sep 17 00:00:00 2001 From: Tom Mortensen Date: Wed, 15 Nov 2023 15:46:05 -0800 Subject: [PATCH] slight change in where 'safe mode' is checked in installing 3rd party drivers --- etc/rc.d/rc.S | 3 +-- etc/rc.d/rc.S.cont | 17 ++++------------ etc/rc.d/rc.modules | 48 ++++++++++++++++++++++++--------------------- 3 files changed, 31 insertions(+), 37 deletions(-) diff --git a/etc/rc.d/rc.S b/etc/rc.d/rc.S index b6c4b0efa..19a7450fc 100755 --- a/etc/rc.d/rc.S +++ b/etc/rc.d/rc.S @@ -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 diff --git a/etc/rc.d/rc.S.cont b/etc/rc.d/rc.S.cont index 43e294583..46e3ddb9e 100755 --- a/etc/rc.d/rc.S.cont +++ b/etc/rc.d/rc.S.cont @@ -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. diff --git a/etc/rc.d/rc.modules b/etc/rc.d/rc.modules index e3ee51826..da774fbf0 100755 --- a/etc/rc.d/rc.modules +++ b/etc/rc.d/rc.modules @@ -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