From cd36e4a83e99e0adb869cd852a1ba9da7e9f9db6 Mon Sep 17 00:00:00 2001 From: morrownr Date: Wed, 7 Dec 2022 20:11:44 -0600 Subject: [PATCH] more install-driver.sh work --- install-driver.sh | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/install-driver.sh b/install-driver.sh index 22d2bc8..7d46c2e 100755 --- a/install-driver.sh +++ b/install-driver.sh @@ -5,7 +5,7 @@ # Supports dkms and non-dkms installations. SCRIPT_NAME="install-driver.sh" -SCRIPT_VERSION="20221205" +SCRIPT_VERSION="20221207" MODULE_NAME="8821cu" DRV_VERSION="5.12.0.4" OPTIONS_FILE="${MODULE_NAME}.conf" @@ -31,6 +31,15 @@ then exit 1 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 if ! command -v iw >/dev/null 2>&1 then @@ -40,11 +49,11 @@ then exit 1 fi -# check to ensure nano is installed -if ! command -v nano >/dev/null 2>&1 +# check to ensure make is installed +if ! command -v make >/dev/null 2>&1 then 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}\"" exit 1 fi @@ -58,6 +67,15 @@ then exit 1 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 NO_PROMPT=0 @@ -112,6 +130,9 @@ then mokutil --sb-state fi +# header files are normally stored in /lib/modules/${kernel_version}/build +# + # blacklist the in-kernel module (driver) so that there is no conflict echo "Installing ${BLACKLIST_FILE} to: /etc/modprobe.d" cp -f ${BLACKLIST_FILE} /etc/modprobe.d