From 85216d0a156d1fe85b2b501e3475ad719df19fad Mon Sep 17 00:00:00 2001 From: morrownr Date: Tue, 28 Feb 2023 22:32:20 -0600 Subject: [PATCH] minor updates --- FAQ.md | 104 ++++++++++++++++++++++++---------------------- README.md | 27 ++++++------ install-driver.sh | 72 +++++++++++++++++++------------- remove-driver.sh | 14 ++++--- 4 files changed, 119 insertions(+), 98 deletions(-) diff --git a/FAQ.md b/FAQ.md index 19477df..de7837d 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1,54 +1,5 @@ ### FAQ -Question: Is WPA3 supported? - -Answer: WPA3-SAE is supported. It works well on most modern Linux distros -but not all. Generally the reason for WPA3 not working on Linux distros is -that the distro has an old version of wpa_supplicant or Network Manager. -Your options are to upgrade to a more modern distro (distros released after -mid 2022) or compile and install new versions of wpa_supplicant and/or -Network Manager. - ------ - -Question: I bought two usb wifi adapters based on this chipset and am -planning to use both in the same computer. How do I set that up? - -Answer: Realtek drivers do not support more than one adapter with the -same chipset in the same computer. You can have multiple Realtek based -adapters in the same computer as long as the adapters are based on -different chipsets. - ------ - -Question: Why do you recommend Mediatek based adapters when you maintain -this repo for a Realtek driver? - -Answer: Many new and existing Linux users already have adapters based on -Realtek chipsets. This repo is for Linux users to support their existing -adapters but my STRONG recommendation is for Linux users to seek out USB -WiFi solutions based on Mediatek chipsets. Mediatek is making and -supporting their drivers per Linux Wireless Standards guidance per the -Linux Foundation. This results in far fewer compatibility and support -problems. More information and recommended adapters shown at the -following site: - -https://github.com/morrownr/USB-WiFi - ------ - -Question: Will you put volunteers to work? - -Answer: Yes. Post a message in `Issues` or `Discussions` if interested. - ------ - -Question: I am having problems with my adapter and I use Virtualbox? - -Answer: This [article](https://null-byte.wonderhowto.com/forum/wifi-hacking-attach-usb-wireless-adapter-with-virtual-box-0324433/) may help. - ------ - Secure Boot Information Question: The driver installation script completed successfully and the @@ -90,11 +41,64 @@ Here is a link regarding Debian and Secure Boot: https://wiki.debian.org/SecureBoot -There is work underway to add Secure Boot suuport for systems that do not +There is work underway to add Secure Boot suport for systems that do not have `dkms` available or if a manual installation is desired. ----- +Question: Is WPA3 supported? + +Answer: WPA3-SAE is supported. It works well on most modern Linux distros +but not all. Generally the reason for WPA3 not working on Linux distros is +that the distro has an old version of wpa_supplicant or Network Manager. +Your options are to upgrade to a more modern distro such as those released +after mid-2022 or compile and install new versions of wpa_supplicant and/or +Network Manager. + +----- + +Question: I bought two usb wifi adapters based on this chipset and am +planning to use both in the same computer. How do I set that up? + +Answer: Realtek drivers do not support more than one adapter with the +same chipset in the same computer. You can have multiple Realtek based +adapters in the same computer as long as the adapters are based on +different chipsets. + +Recommendation: If this is an important capability for you, I have tested +Mediatek adapters for this capability and it does work with adapters that +use the following chipsets: mt7921au, mt7612u and mt7610u. + +----- + +Question: Why do you recommend Mediatek based adapters when you maintain +this repo for a Realtek driver? + +Answer: Many new and existing Linux users already have adapters based on +Realtek chipsets. This repo is for Linux users to support their existing +adapters but my STRONG recommendation is for Linux users to seek out USB +WiFi solutions based on Mediatek chipsets. Mediatek is making and +supporting their drivers per Linux Wireless Standards guidance per the +Linux Foundation. This results in far fewer compatibility and support +problems. More information and recommended adapters shown at the +following site: + +https://github.com/morrownr/USB-WiFi + +----- + +Question: Will you put volunteers to work? + +Answer: Yes. Post a message in `Issues` or `Discussions` if interested. + +----- + +Question: I am having problems with my adapter and I use Virtualbox? + +Answer: This [article](https://null-byte.wonderhowto.com/forum/wifi-hacking-attach-usb-wireless-adapter-with-virtual-box-0324433/) may help. + +----- + Question: Can you provide additional information about monitor mode? Answer: I have a repo that is setup to help with monitor mode: diff --git a/README.md b/README.md index b6c8eeb..9c4dcc0 100644 --- a/README.md +++ b/README.md @@ -100,11 +100,12 @@ be provided via PR or message in Issues. Note: Red Hat Enterprise Linux (RHEL) and distros based on RHEL are not supported due to the way kernel patches are handled. I will support knowledgable RHEL developers if they want to merge the required -support and keep it current. +support and keep it current. I reserve the right to delete this support +if it causes any problems. Note: Android is supported in the driver according to Realtek. I will support knowledgable Android developers if they want to merge and keep current the -required support (most likely just instructions about how to compile and maybe +required support (most likely just instructions about how to compile and make a modification or two to the Makefile). ### Compatible Devices @@ -145,22 +146,20 @@ driver on installation and reactivate the in-kernel driver on removal. No special action needs to be taken by users. Warning: Installing multiple out-of-kernel drivers for the same hardware -usually does not end well. If a previous attempt to install this driver failed -or if you have previously installed another driver for chipsets supported by -this driver, you MUST remove anything that the previous attempt -installed BEFORE attempting to install this driver. This driver can be -removed with the script called `./remove-driver.sh`. Information is -available in the section called `Removal of the Driver`. You can get a -good idea as to whether you need to remove a previously installed -driver by running the following command: +usually does not end well. The install-driver.sh script has the capability +to detect and remove many conflicting drivers but not all. If this driver +does not work well after installation and you have previously installed a +driver that you did not remove, it suggested that you run the following +command in an effort to determine if you need to take action to manually +remove conflicting drivers: ``` sudo dkms status ``` -Warning: If you decide to upgrade to a new version of kernel such as -5.15 to 6.1, you need to upgrade the driver you have installed with -the newest available before installing the new kernel. Use the +Warning: If you decide to do a distro upgrade, which will likely install a +new version of kernel such as 5.15 to 6.1, you need to upgrade this driver +with the newest available before performing the disto upgrade. Use the following commands in the driver directory: ``` @@ -255,7 +254,7 @@ sudo reboot Note: If your Linux distro does not fall into one of options listed below, you will need to research how to properly setup up the development -environment for your system. General guidance is given the next paragraph. +environment for your system. General guidance follows. Development Environment Requirements: (package names may vary by distro) diff --git a/install-driver.sh b/install-driver.sh index 9d7329d..eb1e6b1 100755 --- a/install-driver.sh +++ b/install-driver.sh @@ -28,7 +28,7 @@ # GNU General Public License for more details. SCRIPT_NAME="install-driver.sh" -SCRIPT_VERSION="20230126" +SCRIPT_VERSION="20230227" MODULE_NAME="88x2bu" DRV_VERSION="5.13.1" @@ -170,31 +170,30 @@ if command -v dkms >/dev/null 2>&1; then echo ": ""${dkms_ver}" fi -# display secure mode status if mokutil is installed +# display secure mode status if SecureBoot is enabled and if mokutil is installed if command -v mokutil >/dev/null 2>&1; then - sb_state=$(mokutil --sb-state) - echo ": ""${sb_state}" + if mokutil --sb-state | grep -i enabled >/dev/null 2>&1; then + echo ": SecureBoot enabled - read FAQ about SecureBoot" + fi fi -# needs work -# display ISO 3166-1 alpha-2 Country Code -#a2_country_code=$(iw reg get | grep -i country) -#echo ": Location: ""${a2_country_code}" -#if [[ $a2_country_code == *"00"* ]]; -#then -# echo "The Country Code may not be properly set." -# echo "File alpha-2_Country_Codes is located in the driver directory." -# echo "Please read and follow the directions in the file after installation." +# check ISO 3166-1 alpha-2 Country Code is not 00 +#if iw reg get | grep -i 00 >/dev/null 2>&1; then +# echo ": The Country Code may not be properly set." +# echo ": File 'alpha-2_Country_Codes' is located in the docs directory." +# echo ": Please read and follow the directions in the file after installation." #fi echo ": ---------------------------" echo -echo "Checking for previously installed drivers." +echo "Checking for previously installed drivers." # check for and remove non-dkms installations # standard naming if [ -f "${MODDESTDIR}${MODULE_NAME}.ko" ]; then + echo ": ---------------------------" + echo echo "Removing a non-dkms installation: ${MODDESTDIR}${MODULE_NAME}.ko" rm -f "${MODDESTDIR}"${MODULE_NAME}.ko /sbin/depmod -a "${KVER}" @@ -204,12 +203,13 @@ if [ -f "${MODDESTDIR}${MODULE_NAME}.ko" ]; then rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION} make clean >/dev/null 2>&1 echo "Removal complete." - echo ": ---------------------------" fi # check for and remove non-dkms installations # with rtl added to module name (PClinuxOS) if [ -f "${MODDESTDIR}rtl${MODULE_NAME}.ko" ]; then + echo ": ---------------------------" + echo echo "Removing a non-dkms installation: ${MODDESTDIR}rtl${MODULE_NAME}.ko" rm -f "${MODDESTDIR}"rtl${MODULE_NAME}.ko /sbin/depmod -a "${KVER}" @@ -219,7 +219,6 @@ if [ -f "${MODDESTDIR}rtl${MODULE_NAME}.ko" ]; then rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION} make clean >/dev/null 2>&1 echo "Removal complete." - echo ": ---------------------------" fi # check for and remove non-dkms installations @@ -227,6 +226,8 @@ fi # 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 ": ---------------------------" + echo 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}" @@ -236,30 +237,31 @@ if [ -f "/usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODU rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION} make clean >/dev/null 2>&1 echo "Removal complete." - echo ": ---------------------------" fi # check for and remove dkms installations if command -v dkms >/dev/null 2>&1; then if dkms status | grep -i ${DRV_NAME}; then - echo "Removing a dkms installation: ${DRV_NAME}" + echo ": ---------------------------" + echo + echo "Removing a dkms installation." dkms remove -m ${DRV_NAME} -v ${DRV_VERSION} --all echo "Removing ${OPTIONS_FILE} from /etc/modprobe.d" rm -f /etc/modprobe.d/${OPTIONS_FILE} echo "Removing source files from /usr/src/${DRV_NAME}-${DRV_VERSION}" rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION} echo "Removal complete." - echo ": ---------------------------" fi fi # sets module parameters (driver options) and blacklisted modules +echo ": ---------------------------" echo echo "Starting installation." echo "Installing ${OPTIONS_FILE} to /etc/modprobe.d" cp -f ${OPTIONS_FILE} /etc/modprobe.d -# determine if dkms is installed and run the appropriate routines +# determine if dkms is installed and run the appropriate installation routines if ! command -v dkms >/dev/null 2>&1; then echo "The non-dkms installation routines are in use." @@ -358,9 +360,20 @@ else else echo "The driver was installed by dkms successfully." echo ": ---------------------------" + echo fi fi +# provide driver upgrade information +echo "Info: Upgrade this driver with the following commands as needed:" +echo "$ git pull" +echo "$ sudo sh install-driver.sh" +echo "Note: Upgrades to this driver should be performed before distro upgrades." +echo "Note: Upgrades can be performed as often as you like." +echo "Note: Work on this driver is continuous." +echo ": ---------------------------" +echo + # unblock wifi if command -v rfkill >/dev/null 2>&1; then rfkill unblock wlan @@ -370,16 +383,17 @@ fi # if NoPrompt is not used, ask user some questions if [ $NO_PROMPT -ne 1 ]; then - echo - printf "Do you want to edit the driver options file now? [y/N] " - read -r REPLY - case "$REPLY" in - [yY]*) ${TEXT_EDITOR} /etc/modprobe.d/${OPTIONS_FILE} ;; + printf "Do you want to edit the driver options file now? (recommended) [Y/n] " + read -r yn + case "$yn" in + [nN]) ;; + *) ${TEXT_EDITOR} /etc/modprobe.d/${OPTIONS_FILE} ;; esac - printf "Do you want to apply the new options by rebooting now? (recommended) [y/N] " - read -r REPLY - case "$REPLY" in - [yY]*) reboot ;; + printf "Do you want to apply the new options by rebooting now? (recommended) [Y/n] " + read -r yn + case "$yn" in + [nN]) ;; + *) reboot ;; esac fi diff --git a/remove-driver.sh b/remove-driver.sh index 74b7e69..275ee7d 100755 --- a/remove-driver.sh +++ b/remove-driver.sh @@ -28,7 +28,7 @@ # GNU General Public License for more details. SCRIPT_NAME="remove-driver.sh" -SCRIPT_VERSION="20230126" +SCRIPT_VERSION="20230226" MODULE_NAME="88x2bu" DRV_VERSION="5.13.1" @@ -77,6 +77,7 @@ echo ": ${KARCH} (architecture)" echo ": ${KVER} (kernel version)" echo ": ---------------------------" +echo # check for and remove non-dkms installations # standard naming @@ -133,12 +134,15 @@ rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION} make clean >/dev/null 2>&1 echo "The driver was removed successfully." echo "You may now delete the driver directory if desired." +echo ": ---------------------------" +echo # if NoPrompt is not used, ask user some questions if [ $NO_PROMPT -ne 1 ]; then - printf "Do you want to reboot now? (recommended) [y/N] " - read -r REPLY - case "$REPLY" in - [yY]*) reboot ;; + printf "Do you want to reboot now? (recommended) [Y/n] " + read -r yn + case "$yn" in + [nN]) ;; + *) reboot ;; esac fi