2019-11-17 03:32:11 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
2020-09-04 12:44:21 -07:00
|
|
|
pkgname="rtlwifi"
|
|
|
|
pkgurl="https://github.com/cilynx/rtl88x2bu.git"
|
2019-11-17 03:32:11 -07:00
|
|
|
tmpdir="/tmp"
|
|
|
|
|
|
|
|
_fetch_deps(){
|
2020-09-04 12:44:21 -07:00
|
|
|
if [ -f /usr/bin/apt ];then
|
2021-10-17 10:50:20 -07:00
|
|
|
apt install git dnsmasq hostapd bc build-essential dkms wget unzip rsync
|
2020-09-04 12:44:21 -07:00
|
|
|
|
|
|
|
elif [ -f /usr/bin/dnf ];then
|
2021-10-17 10:50:20 -07:00
|
|
|
dnf group install "Development Tools"
|
|
|
|
dnf install unzip dnsmasq hostapd bc dkms kernel-headers rsync wget
|
2020-09-04 12:44:21 -07:00
|
|
|
else
|
|
|
|
echo "No supported package manager"
|
|
|
|
fi
|
2019-11-17 03:32:11 -07:00
|
|
|
}
|
|
|
|
|
2020-09-04 12:44:21 -07:00
|
|
|
|
2019-11-17 03:32:11 -07:00
|
|
|
_download(){
|
2021-10-17 10:53:09 -07:00
|
|
|
if [ ! -d "${tmpdir}"/"${pkgname}" ];then
|
|
|
|
git clone "${pkgurl}" "${tmpdir}"/"${pkgname}"
|
2019-11-17 03:32:11 -07:00
|
|
|
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
|
|
|
|
}
|
2019-11-17 03:32:11 -07:00
|
|
|
|
|
|
|
_install(){
|
2021-10-17 10:53:09 -07:00
|
|
|
cd "${tmpdir}"/"${pkgname}"
|
2020-10-01 23:20:13 -07:00
|
|
|
_apply_patch
|
2019-11-17 03:32:11 -07:00
|
|
|
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf)
|
2021-10-17 10:53:09 -07:00
|
|
|
rsync -rvhP ./ /usr/src/rtl88x2bu-"${VER}"
|
|
|
|
dkms add -m rtl88x2bu -v "${VER}"
|
|
|
|
dkms build -m rtl88x2bu -v "${VER}"
|
|
|
|
dkms install -m rtl88x2bu -v "${VER}"
|
2020-09-04 12:44:21 -07:00
|
|
|
modprobe 88x2bu
|
2019-11-17 03:32:11 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
_fetch_deps
|
|
|
|
_download
|
2020-10-02 06:13:40 -07:00
|
|
|
_install
|