forked from zebulon2/rtl8812au
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdkms-install.sh
More file actions
executable file
·28 lines (21 loc) · 838 Bytes
/
dkms-install.sh
File metadata and controls
executable file
·28 lines (21 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
if ! [ $EUID = 0 ]; then
echo -e "You must run this with \e[1;91msuperuser\e[0m priviliges." 2>&1
echo -e 'Try "\e[1;91msudo\e[0m '"${BASH_SOURCE}"'"' 2>&1
exit 1
fi
echo "About to run dkms install steps..."
DRV_NAME=rtl8812au
DRV_MODNAME=8812au
DRV_VERSION=5.1.5
DRV_USR_SRC="/usr/src/${DRV_NAME}-${DRV_VERSION}"
mkdir -p "${DRV_USR_SRC}"
git archive --format=tar.gz --worktree-attributes --verbose HEAD | tar -xz -C "${DRV_USR_SRC}"
sed -i s/#MODULE_VERSION#/"${DRV_VERSION}"/ "${DRV_USR_SRC}/dkms.conf"
sed -i s/#MODULE_MODNAME#/"${DRV_MODNAME}"/ "${DRV_USR_SRC}/dkms.conf"
dkms add -m ${DRV_NAME} -v ${DRV_VERSION}
dkms build -m ${DRV_NAME} -v ${DRV_VERSION}
dkms install -m ${DRV_NAME} -v ${DRV_VERSION} && modprobe ${DRV_MODNAME} --verbose
RESULT=$?
echo "Finished running dkms install steps."
exit $RESULT