hooks scemd's ioctl function, check if it's fanspeed controlling code, then redirecting it to our own fan speed control logic.
The code contains speed control code for ITE IT8728F chip, from the below credits you can find the IT8772E
-
Compile:
make
-
On Synology, move the
/usr/syno/bin/scemd
to/usr/syno/bin/scemd.orig
-
Copy the compiled
scemd
andscemd_hijack.so
to/usr/syno/bin
-
(Optional) tweak your settings in
/usr/syno/etc/scemd.xml
and/usr/syno/etc.defaults/scemd.xml
- terramaster-fancontrol: offering a brilliant idea to change the fanspeed
- ldpreloadhook: great template code for ioctl hook!
- I found the magic ioctl request code by reverse engineering the
scemd
,libsynoscemd.so.1
andlibhwcontrol.so.1
. TheScemFanSpeedAdjuster
function inlibsynoscemd.so.1
will do the call toSYNOFanDebugPrint
inlibhwcontrol.so.1
, then you'll find everything looking atSYNOFanDebugPrint
's cross references :) - You can enable verbose debug log by
echo 1 > /tmp/m2tmp.txt