Skip to content

Commit

Permalink
Speed up subsequent boot with wifi drivers by autoloading after the f…
Browse files Browse the repository at this point in the history
…irst time they are probed.
  • Loading branch information
dkulp committed Oct 19, 2021
1 parent bc8b2b6 commit 2c74dd9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions scripts/functions
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,21 @@ SetupFPPNetworkConfigViaConnMann() {
echo "MAC=${MACA}" >> $TMPFILE
fi

#if the interface has a module driver, we'll let Linux autoload the module at boot to
#speed up the discovery/probe
if [ -f "/sys/class/net/${INTERFACE}/device/driver/module" ]; then
MODULELINK=$(readlink /sys/class/net/${INTERFACE}/device/driver/module)
MODULE=$(basename "/sys/class/net/${INTERFACE}/device/driver/module/${MODULELINK}" )
if [ "${MODULE}" != "brcmfmac" ]; then
touch /etc/modules-load.d/network.conf
if ! grep -Fxq "${MODULE}" /etc/modules-load.d/network.conf ; then
echo "${MODULE}" >> /etc/modules-load.d/network.conf
fi
fi
unset MODULE
unset MODULELINK
fi

echo "" >> $TMPFILE
echo "" >> $TMPFILE
done
Expand Down

0 comments on commit 2c74dd9

Please sign in to comment.