From 05b1288f2b44b8860f3024cb4fdc236a851e9713 Mon Sep 17 00:00:00 2001 From: morrownr Date: Tue, 21 Nov 2023 18:17:41 -0600 Subject: [PATCH] update docs and scripts --- FAQ.md | 3 -- Makefile | 16 ++--------- README.md | 23 ++++++++++----- dkms-make.sh | 2 +- dkms.conf | 2 +- install-driver.sh | 71 +++++++++++++---------------------------------- remove-driver.sh | 13 ++++----- 7 files changed, 44 insertions(+), 86 deletions(-) diff --git a/FAQ.md b/FAQ.md index 5f968a0..b661fcc 100644 --- a/FAQ.md +++ b/FAQ.md @@ -41,9 +41,6 @@ Here is a link regarding Debian and Secure Boot: https://wiki.debian.org/SecureBoot -There is work underway to add Secure Boot support for systems that do not -have `dkms` available or if a manual installation is desired. - If you are using a basic command line (non-dkms) installation, see the following section in the Installation Steps part of the README: diff --git a/Makefile b/Makefile index 5a4e049..14a9e8e 100644 --- a/Makefile +++ b/Makefile @@ -1374,20 +1374,8 @@ ifeq ($(CONFIG_PLATFORM_AUTODETECT), y) EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -SUBARCH := $(shell uname -m) - -ifeq ($(SUBARCH), aarch64) -SUBARCH := arm64 -endif - -ifeq ($(SUBARCH), armv7l) -SUBARCH := arm -endif - -ifeq ($(SUBARCH), armv6l) -SUBARCH := arm -endif - +#SUBARCH := $(shell uname -m) +SUBARCH := $(shell uname -m | sed -e "s/i.86/i386/; s/ppc/powerpc/; s/armv.l/arm/; s/aarch64/arm64/; s/riscv.*/riscv/;") ARCH ?= $(SUBARCH) CROSS_COMPILE ?= diff --git a/README.md b/README.md index 7b98cef..a92a295 100644 --- a/README.md +++ b/README.md @@ -152,10 +152,9 @@ adapters. Note: If you decide to buy an adapter that is supported by this driver, I recommend you search for an adapter that is `single-state and single-function`. Multi-function adapters, wifi and bluetooth, can be -problematic. The rtl8852bu chipset is multi-fuction. The rtl8832bu -chipset is single-function. For advice about single-state and -multi-state adapters. click [here](https://github.com/morrownr/USB-WiFi) -and look for Main Menu item 1. +problematic. For advice about single-state and multi-state adapters, +click [here](https://github.com/morrownr/USB-WiFi) and look for Main +Menu item 1. ### Installation Information @@ -326,9 +325,6 @@ sudo apt install -y build-essential dkms git iw - Option for Fedora -Note: Fedora users should also install `openssl` if secure boot is -active. - ``` sudo dnf -y install git dkms kernel-devel ``` @@ -406,13 +402,17 @@ compile the kernel that is in use: Example of bad situation: +``` gcc 12.1 (used to compile the kernel) gcc 10.3 (version of gcc in use) +``` Example of good situation: +``` gcc 12.2 (used to compile the kernel) gcc 12.1 (version of gcc in use) +``` To determine the values: @@ -719,6 +719,15 @@ multiport USB extension can be a good idea in cases like this. ----- +To Contribute: + +Fork this repository. +Make your edits. +TEST THEM! +Create a pull request. + +----- + #### [Go to Main Menu](https://github.com/morrownr/USB-WiFi) ----- diff --git a/dkms-make.sh b/dkms-make.sh index 09e73f7..c65fdb5 100755 --- a/dkms-make.sh +++ b/dkms-make.sh @@ -4,7 +4,7 @@ # run from another script. # SMEM needs to be set here if dkms build is not initiated by install-driver.sh -SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }') +SMEM=$(LC_ALL=C free | awk '/Mem:/ { print $2 }') # sproc needs to be set here if dkms build is not initiated by install-driver.sh sproc=$(nproc) diff --git a/dkms.conf b/dkms.conf index 5226894..19283a8 100644 --- a/dkms.conf +++ b/dkms.conf @@ -4,4 +4,4 @@ BUILT_MODULE_NAME[0]="88x2bu" MAKE="./dkms-make.sh" CLEAN="'make' clean" DEST_MODULE_LOCATION[0]="/updates/dkms" -AUTOINSTALL="YES" +AUTOINSTALL="yes" diff --git a/install-driver.sh b/install-driver.sh index 3cc51b9..fed7466 100755 --- a/install-driver.sh +++ b/install-driver.sh @@ -28,11 +28,15 @@ # GNU General Public License for more details. SCRIPT_NAME="install-driver.sh" -SCRIPT_VERSION="20230830" +SCRIPT_VERSION="20231115" + +MODULE_NAME="88x2bu" DRV_NAME="rtl88x2bu" DRV_VERSION="5.13.1" -MODULE_NAME="88x2bu" +DRV_DIR="$(pwd)" + +OPTIONS_FILE="${MODULE_NAME}.conf" #KARCH="$(uname -m)" if [ -z "${KARCH+1}" ]; then @@ -44,16 +48,13 @@ if [ -z "${KVER+1}" ]; then KVER="$(uname -r)" fi +MODDESTDIR="/lib/modules/${KVER}/kernel/drivers/net/wireless/" + #GARCH="$(uname -m | sed -e "s/i.86/i386/; s/ppc/powerpc/; s/armv.l/arm/; s/aarch64/arm64/; s/riscv.*/riscv/;")" if [ -z "${GARCH+1}" ]; then GARCH="$(uname -m | sed -e "s/i.86/i386/; s/ppc/powerpc/; s/armv.l/arm/; s/aarch64/arm64/; s/riscv.*/riscv/;")" fi -DRV_DIR="$(pwd)" - -MODDESTDIR="/lib/modules/${KVER}/kernel/drivers/net/wireless/" -OPTIONS_FILE="${MODULE_NAME}.conf" - # check to ensure sudo or su - was used to start the script if [ "$(id -u)" -ne 0 ]; then echo "You must run this script with superuser (root) privileges." @@ -150,15 +151,13 @@ echo ": ---------------------------" # displays script name and version echo ": ${SCRIPT_NAME} v${SCRIPT_VERSION}" -# information that helps with bug reports - # display kernel architecture echo ": ${KARCH} (kernel architecture)" # display architecture to send to gcc echo ": ${GARCH} (architecture to send to gcc)" -SMEM=$(LANG=C free | awk '/Mem:/ { print $2 }') +SMEM=$(LC_ALL=C free | awk '/Mem:/ { print $2 }') sproc=$(nproc) # avoid Out of Memory condition in low-RAM systems by limiting core usage if [ "$sproc" -gt 1 ]; then @@ -195,34 +194,16 @@ if command -v dkms >/dev/null 2>&1; then echo ": ""${dkms_ver}" fi -# display secure mode status +# display Secure Boot status if command -v mokutil >/dev/null 2>&1; then - if mokutil --sb-state | grep -i enabled >/dev/null 2>&1; then - echo ": SecureBoot enabled" - fi - if mokutil --sb-state | grep -i disabled >/dev/null 2>&1; then - echo ": SecureBoot disabled" - fi - if mokutil --sb-state | grep -i EFI >/dev/null 2>&1; then - echo ": EFI variables are not supported on this system" - fi + case $(mokutil --sb-state 2>&1) in + *enabled*) echo ": SecureBoot enabled" ;; + *disabled*) echo ": SecureBoot disabled" ;; + *) echo ": This system doesn't support Secure Boot" ;; + esac else echo ": mokutil not installed" fi -# need to fix the following -#: --------------------------- -#: install-driver.sh v20230718 -#: x86_64 (system architecture) -#: x86_64 (gcc architecture) -#: 4/4 (in-use/total processing units) -#: 16283584 (total system memory) -#: 5.19.0-50-generic (kernel version) -#: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 -#: dkms-2.8.7 -#This system doesn't support Secure Boot -#This system doesn't support Secure Boot -#This system doesn't support Secure Boot -#: --------------------------- echo ": ---------------------------" echo @@ -273,21 +254,7 @@ if [ -f "/usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODU echo "Removal complete." fi -# check for and remove all dkms installations with DRV_NAME -# -# dkms status [module/module-version] [-k kernel/arch] -# -# $ dkms status -# -# nvidia/535.86.05, 6.2.0-27-generic, x86_64: installed -# nvidia/535.86.05, 6.5.0-060500rc5-generic, x86_64: installed -# rtl8852bu/1.19.3, 6.2.0-27-generic, x86_64: installed -# rtl8852bu/1.19.3, 6.5.0-060500rc5-generic, x86_64: installed -# rtl8852bu/1.15.2, 6.5.0-060500rc5-generic, x86_64: installed -# -# dkms remove [module/module-version] [-k kernel/arch] [--all] -# -# $ dkms remove "${modname}/${modver}" -c "/usr/src/${modname}-${modver}/dkms.conf" --all +# check for and remove all dkms installations with MODULE_NAME in DRV_NAME # if command -v dkms >/dev/null 2>&1; then dkms status | while IFS="/, " read -r modname modver kerver _dummy; do @@ -393,9 +360,9 @@ else fi if command -v /usr/bin/time >/dev/null 2>&1; then - /usr/bin/time -f "Compile time: %U seconds" dkms build -m ${DRV_NAME} -v ${DRV_VERSION} -k "${KVER}/${KARCH}" -c "/usr/src/${DRV_NAME}-${DRV_VERSION}/dkms.conf" + /usr/bin/time -f "Compile time: %U seconds" dkms build -m ${DRV_NAME} -v ${DRV_VERSION} -k "${KVER}/${KARCH}" -c "/usr/src/${DRV_NAME}-${DRV_VERSION}/dkms.conf" --force else - dkms build -m ${DRV_NAME} -v ${DRV_VERSION} -k "${KVER}/${KARCH}" -c "/usr/src/${DRV_NAME}-${DRV_VERSION}/dkms.conf" + dkms build -m ${DRV_NAME} -v ${DRV_VERSION} -k "${KVER}/${KARCH}" -c "/usr/src/${DRV_NAME}-${DRV_VERSION}/dkms.conf" --force fi RESULT=$? @@ -411,7 +378,7 @@ else echo ": ---------------------------" fi - dkms install -m ${DRV_NAME} -v ${DRV_VERSION} -k "${KVER}/${KARCH}" -c "/usr/src/${DRV_NAME}-${DRV_VERSION}/dkms.conf" + dkms install -m ${DRV_NAME} -v ${DRV_VERSION} -k "${KVER}/${KARCH}" -c "/usr/src/${DRV_NAME}-${DRV_VERSION}/dkms.conf" --force RESULT=$? if [ "$RESULT" != "0" ]; then diff --git a/remove-driver.sh b/remove-driver.sh index 50697a5..aa2ea0b 100755 --- a/remove-driver.sh +++ b/remove-driver.sh @@ -28,11 +28,14 @@ # GNU General Public License for more details. SCRIPT_NAME="remove-driver.sh" -SCRIPT_VERSION="20230830" +SCRIPT_VERSION="20231118" + +MODULE_NAME="88x2bu" DRV_NAME="rtl88x2bu" DRV_VERSION="5.13.1" -MODULE_NAME="88x2bu" + +OPTIONS_FILE="${MODULE_NAME}.conf" #KARCH="$(uname -m)" if [ -z "${KARCH+1}" ]; then @@ -45,7 +48,6 @@ if [ -z "${KVER+1}" ]; then fi MODDESTDIR="/lib/modules/${KVER}/kernel/drivers/net/wireless/" -OPTIONS_FILE="${MODULE_NAME}.conf" # check to ensure sudo or su - was used to start the script if [ "$(id -u)" -ne 0 ]; then @@ -116,10 +118,6 @@ fi # check for and remove all dkms installations with DRV_NAME # -# dkms status [module/module-version] [-k kernel/arch] -# -# $ dkms status -# if command -v dkms >/dev/null 2>&1; then dkms status | while IFS="/, " read -r modname modver kerver _dummy; do case "$modname" in *${MODULE_NAME}) @@ -128,7 +126,6 @@ if command -v dkms >/dev/null 2>&1; then esac done RESULT=$? -# echo "Result=${RESULT}" # RESULT will be 3 if there are no instances of module to remove # however we still need to remove various files or the install script