jitty-scripts/rtlwifi-setup.sh

42 lines
944 B
Bash
Raw Permalink Normal View History

#!/bin/bash
2021-10-27 21:50:51 -07:00
pkgname="rtl88x2bu-git"
pkgurl="https://github.com/RinCat/RTL88x2BU-Linux-Driver.git"
tmpdir="/usr/src"
_fetch_deps(){
if [ -f /usr/bin/apt ];then
2021-10-27 21:50:51 -07:00
sudo apt install git dnsmasq hostapd bc build-essential dkms wget unzip rsync
elif [ -f /usr/bin/dnf ];then
2021-10-27 21:50:51 -07:00
sudo dnf group install "Development Tools"
sudo dnf install unzip dnsmasq hostapd bc dkms kernel-headers rsync wget
else
echo "No supported package manager"
fi
}
_download(){
2021-10-17 10:53:09 -07:00
if [ ! -d "${tmpdir}"/"${pkgname}" ];then
2021-10-27 21:50:51 -07:00
sudo git clone "${pkgurl}" "${tmpdir}"/"${pkgname}"
fi
}
2020-10-01 23:20:13 -07:00
_apply_patch(){
2021-10-17 10:53:09 -07:00
wget "https://github.com/cilynx/rtl88x2bu/pull/58.patch"
2020-10-01 23:20:13 -07:00
git apply 58.patch
}
_install(){
2021-10-27 21:50:51 -07:00
sed -i 's/PACKAGE_VERSION="@PKGVER@"/PACKAGE_VERSION="git"/g' /usr/src/rtl88x2bu-git/dkms.conf
sudo dkms add -m rtl88x2bu -v git
sudo dkms autoinstall
sudo modprobe 88x2bu
}
_fetch_deps
_download
_install