From 4c04fd14de046f4c6e654f69e6c26e1b5b57a0dd Mon Sep 17 00:00:00 2001 From: morrownr Date: Sun, 4 Dec 2022 21:53:57 -0600 Subject: [PATCH] more script updates --- Makefile | 2 +- install-driver.sh | 23 ++++++++++++++++++----- remove-driver.sh | 5 +++-- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 181f9b0..0787194 100644 --- a/Makefile +++ b/Makefile @@ -115,7 +115,7 @@ EXTRA_CFLAGS += -DCONFIG_RTW_ANDROID=$(CONFIG_RTW_ANDROID) endif ########################## Debug ########################### -CONFIG_RTW_DEBUG = y +CONFIG_RTW_DEBUG = n # default log level is _DRV_INFO_ = 4, # please refer to "How_to_set_driver_debug_log_level.doc" to set the available level. CONFIG_RTW_LOG_LEVEL = 0 diff --git a/install-driver.sh b/install-driver.sh index 14de907..e1aa7e0 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="20221125" +SCRIPT_VERSION="20221204" MODULE_NAME="8821cu" DRV_VERSION="5.12.0.4" OPTIONS_FILE="${MODULE_NAME}.conf" @@ -30,6 +30,15 @@ then exit 1 fi +# check to ensure mokutil is installed +if ! command -v mokutil >/dev/null 2>&1 +then + echo "A required package appears to not be installed." + echo "Please install the following package: mokutil" + echo "Once the package is installed, please run \"sudo ./${SCRIPT_NAME}\"" + exit 1 +fi + # check to ensure nano is installed if ! command -v nano >/dev/null 2>&1 then @@ -88,13 +97,19 @@ then fi # information that helps with bug reports + # kernel echo "Linux Kernel=${KVER}" + # architecture - for ARM: aarch64 = 64 bit, armv7l = 32 bit echo "CPU Architecture=${KARCH}" + # gcc version -echo "gcc --version | grep -i gcc" -#getconf LONG_BIT (may be handy in the future) +gcc_ver=$(gcc --version | grep -i gcc) +echo "gcc --version="${gcc_ver} + +# check for secure mode +# # blacklist the in-kernel module (driver) so that there is no conflict echo "Installing ${BLACKLIST_FILE} to: /etc/modprobe.d" @@ -217,14 +232,12 @@ fi if [ $NO_PROMPT -ne 1 ] then read -p "Do you want to edit the driver options file now? [y/N] " -n 1 -r - echo if [[ $REPLY =~ ^[Yy]$ ]] then nano /etc/modprobe.d/${OPTIONS_FILE} fi read -p "Do you want to reboot now? (recommended) [y/N] " -n 1 -r - echo if [[ $REPLY =~ ^[Yy]$ ]] then reboot diff --git a/remove-driver.sh b/remove-driver.sh index 7842b7e..de6c73e 100755 --- a/remove-driver.sh +++ b/remove-driver.sh @@ -5,7 +5,7 @@ # Supports dkms and non-dkms removals. SCRIPT_NAME="remove-driver.sh" -SCRIPT_VERSION="20221125" +SCRIPT_VERSION="20221204" MODULE_NAME="8821cu" DRV_VERSION="5.12.0.4" OPTIONS_FILE="${MODULE_NAME}.conf" @@ -61,11 +61,12 @@ then fi # information that helps with bug reports + # kernel echo "Linux Kernel=${KVER}" + # architecture - for ARM: aarch64 = 64 bit, armv7l = 32 bit echo "CPU Architecture=${KARCH}" -#getconf LONG_BIT (may be handy in the future) # determine if dkms is installed and run the appropriate routines if command -v dkms >/dev/null 2>&1