-
Notifications
You must be signed in to change notification settings - Fork 75
/
install.sh
executable file
·41 lines (34 loc) · 892 Bytes
/
install.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "[*] This script must be run as root"
exit 1
fi
if [[ -f "/sys/bus/wmi/devices/7A4DDFE7-5B5D-40B4-8595-4408E0CC7F56/" ]]; then
echo "[*] Sorry but your device doesn't have the required WMI module"
exit 1
fi
if [ ! "$(uname -r | grep lts)" == "" ]; then
echo LTS kernel detected
MAKEFLAGS="LTS=1"
fi
# Remove previous chr devices if any exists
rm /dev/acer-gkbbl-0 /dev/acer-gkbbl-static-0 -f
# compile the kernel module
if [ "$(cat /proc/version | grep clang)" != "" ]; then
#For kernels compiled with clang
make CC=clang LD=ld.lld $MAKEFLAGS
else
#For normal kernels
make $MAKEFLAGS
fi
# remove previous acer_wmi module
rmmod acer_wmi
rmmod facer
# install required modules
modprobe wmi
modprobe sparse-keymap
modprobe video
# install facer module
insmod src/facer.ko
dmesg | tail -n 10
echo "[*] Done"