From d38fe7ffa0efa4bb9a557816d8a284bb0993c773 Mon Sep 17 00:00:00 2001 From: morrownr Date: Fri, 30 Dec 2022 12:36:53 -0600 Subject: [PATCH] additions for Armbian and PClinuxOS --- 8821cu.conf | 1 + alpha-2_Country_Codes | 11 +++++------ install-driver.sh | 25 +++++++++++++++++++++++-- remove-driver.sh | 25 +++++++++++++++++++++++-- 4 files changed, 52 insertions(+), 10 deletions(-) diff --git a/8821cu.conf b/8821cu.conf index 6f2e2b7..9087137 100644 --- a/8821cu.conf +++ b/8821cu.conf @@ -84,6 +84,7 @@ options 8821cu rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=1 rtw_power_mgn # From the source code: # # /* /os_dep/linux/os_intfs.c +# * # * BIT0: Enable VHT SU Beamformer # * BIT1: Enable VHT SU Beamformee # * BIT2: Enable VHT MU Beamformer, depend on VHT SU Beamformer diff --git a/alpha-2_Country_Codes b/alpha-2_Country_Codes index b5245c1..e2d43e3 100644 --- a/alpha-2_Country_Codes +++ b/alpha-2_Country_Codes @@ -35,16 +35,15 @@ DZ Algeria AS American Samoa -Andorra AD +AD Andorra -Angola AO +AO Angola -Anguilla AI +AI Anguilla -Antarctica AQ +AQ Antarctica -Antigua and -Barbuda AG +AG Antigua and Barbuda Argentina AR diff --git a/install-driver.sh b/install-driver.sh index f4a3723..5d04dce 100755 --- a/install-driver.sh +++ b/install-driver.sh @@ -117,14 +117,35 @@ done # displays script name and version echo "Script: ${SCRIPT_NAME} version ${SCRIPT_VERSION}" -# check for and remove non-dkms installation +# check for and remove non-dkms installations +# standard naming if [[ -f "${MODDESTDIR}${MODULE_NAME}.ko" ]] then - echo "Removing a non-dkms installation." + echo "Removing a non-dkms installation: ${MODDESTDIR}${MODULE_NAME}.ko" rm -f ${MODDESTDIR}${MODULE_NAME}.ko /sbin/depmod -a ${KVER} fi +# check for and remove non-dkms installations +# with rtl added to module name (PClinuxOS) +if [[ -f "${MODDESTDIR}rtl${MODULE_NAME}.ko" ]] +then + echo "Removing a non-dkms installation: ${MODDESTDIR}rtl${MODULE_NAME}.ko" + rm -f ${MODDESTDIR}rtl${MODULE_NAME}.ko + /sbin/depmod -a ${KVER} +fi + +# check for and remove non-dkms installations +# with compressed module in a unique non-standard location (Armbian) +# Example: /usr/lib/modules/5.15.80-rockchip64/kernel/drivers/net/wireless/rtl8821cu/8821cu.ko.xz +# Dear Armbiam, this is a really bad idea. +if [[ -f "/usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz" ]] +then + echo "Removing a non-dkms installation: /usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz" + rm -f /usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz + /sbin/depmod -a ${KVER} +fi + # check for existing dkms installations of any version of this driver if command -v dkms >/dev/null 2>&1 then diff --git a/remove-driver.sh b/remove-driver.sh index 7042443..c9d8c21 100755 --- a/remove-driver.sh +++ b/remove-driver.sh @@ -59,14 +59,35 @@ done # displays script name and version echo "Script: ${SCRIPT_NAME} version ${SCRIPT_VERSION}" -# check for and remove non-dkms installation +# check for and remove non-dkms installations +# standard naming if [[ -f "${MODDESTDIR}${MODULE_NAME}.ko" ]] then - echo "Removing a non-dkms installation." + echo "Removing a non-dkms installation: ${MODDESTDIR}${MODULE_NAME}.ko" rm -f ${MODDESTDIR}${MODULE_NAME}.ko /sbin/depmod -a ${KVER} fi +# check for and remove non-dkms installations +# with rtl added to module name (PClinuxOS) +if [[ -f "${MODDESTDIR}rtl${MODULE_NAME}.ko" ]] +then + echo "Removing a non-dkms installation: ${MODDESTDIR}rtl${MODULE_NAME}.ko" + rm -f ${MODDESTDIR}rtl${MODULE_NAME}.ko + /sbin/depmod -a ${KVER} +fi + +# check for and remove non-dkms installations +# with compressed module in a unique non-standard location (Armbian) +# Example: /usr/lib/modules/5.15.80-rockchip64/kernel/drivers/net/wireless/rtl8821cu/8821cu.ko.xz +# Dear Armbiam, this is a really bad idea. +if [[ -f "/usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz" ]] +then + echo "Removing a non-dkms installation: /usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz" + rm -f /usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz + /sbin/depmod -a ${KVER} +fi + # information that helps with bug reports # display kernel version