forked from linux-on-mac/mbpfan
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configurePath.sh
executable file
·27 lines (21 loc) · 983 Bytes
/
configurePath.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
found=$(find /sys/devices -wholename "*APP0001:00/fan*" | head -1)
path=$(dirname $found)
echo " ------------------------------------- "
echo " Found fan at '${path}'"
echo ""
echo " For me the output was something like '/sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:102/APP0001:00'."
echo ""
echo " If your path looks completely different and the tests fail, "
echo " try just using the normal (unpatched) version (git reset --hard origin/master)."
echo " If that doesn't work either feel free to open an issue on github"
echo ""
line1="#define APPLESMC_PATH \"$path\""
line2=" const char *path_begin = \"$path/fan\";"
sed -i "54s|.*|$line1|" "./src/mbpfan.c"
sed -i "277s|.*|$line2|" "./src/mbpfan.c"
echo " Patched mbpfan.c"
echo ""
echo " See further install instructions here: "
echo " https://wiki.t2linux.org/guides/fan/"
echo " It's advised to also run the tests to check if the patch was successful"
echo " ------------------------------------- "