more install-driver.sh work

pull/23/head
morrownr 2022-12-07 20:11:44 -06:00
parent 91d7e87ed7
commit cd36e4a83e
1 changed files with 25 additions and 4 deletions

View File

@ -5,7 +5,7 @@
# Supports dkms and non-dkms installations. # Supports dkms and non-dkms installations.
SCRIPT_NAME="install-driver.sh" SCRIPT_NAME="install-driver.sh"
SCRIPT_VERSION="20221205" SCRIPT_VERSION="20221207"
MODULE_NAME="8821cu" MODULE_NAME="8821cu"
DRV_VERSION="5.12.0.4" DRV_VERSION="5.12.0.4"
OPTIONS_FILE="${MODULE_NAME}.conf" OPTIONS_FILE="${MODULE_NAME}.conf"
@ -31,6 +31,15 @@ then
exit 1 exit 1
fi fi
# check to ensure gcc is installed
if ! command -v gcc >/dev/null 2>&1
then
echo "A required package appears to not be installed."
echo "Please install the following package: gcc"
echo "Once the package is installed, please run \"sudo ./${SCRIPT_NAME}\""
exit 1
fi
# check to ensure iw is installed # check to ensure iw is installed
if ! command -v iw >/dev/null 2>&1 if ! command -v iw >/dev/null 2>&1
then then
@ -40,11 +49,11 @@ then
exit 1 exit 1
fi fi
# check to ensure nano is installed # check to ensure make is installed
if ! command -v nano >/dev/null 2>&1 if ! command -v make >/dev/null 2>&1
then then
echo "A required package appears to not be installed." echo "A required package appears to not be installed."
echo "Please install the following package: nano" echo "Please install the following package: make"
echo "Once the package is installed, please run \"sudo ./${SCRIPT_NAME}\"" echo "Once the package is installed, please run \"sudo ./${SCRIPT_NAME}\""
exit 1 exit 1
fi fi
@ -58,6 +67,15 @@ then
exit 1 exit 1
fi fi
# check to ensure nano is installed
if ! command -v nano >/dev/null 2>&1
then
echo "A required package appears to not be installed."
echo "Please install the following package: nano"
echo "Once the package is installed, please run \"sudo ./${SCRIPT_NAME}\""
exit 1
fi
# support for the NoPrompt option allows non-interactive use of this script # support for the NoPrompt option allows non-interactive use of this script
NO_PROMPT=0 NO_PROMPT=0
@ -112,6 +130,9 @@ then
mokutil --sb-state mokutil --sb-state
fi fi
# header files are normally stored in /lib/modules/${kernel_version}/build
#
# blacklist the in-kernel module (driver) so that there is no conflict # blacklist the in-kernel module (driver) so that there is no conflict
echo "Installing ${BLACKLIST_FILE} to: /etc/modprobe.d" echo "Installing ${BLACKLIST_FILE} to: /etc/modprobe.d"
cp -f ${BLACKLIST_FILE} /etc/modprobe.d cp -f ${BLACKLIST_FILE} /etc/modprobe.d