Stonyx / QNAP-EC

GNU General Public License v3.0
65 stars 16 forks source link

Unable to build on proxmox debian #1

Closed axeII closed 2 years ago

axeII commented 2 years ago

Hi,

I am unable to build this project on proxmox (debian) machine. Please see the log:

rm -f qnap-ec
make -C /lib/modules/5.13.19-3-pve/build M=/root/QNAP-EC clean
make[1]: Entering directory '/usr/src/linux-headers-5.13.19-3-pve'
  CLEAN   /root/QNAP-EC/Module.symvers
make[1]: Leaving directory '/usr/src/linux-headers-5.13.19-3-pve'
cc -o qnap-ec qnap-ec-helper.c -Wall -O2 -export-dynamic -ldl
make -C /lib/modules/5.13.19-3-pve/build M=/root/QNAP-EC MODULE_CFLAGS= modules
make[1]: Entering directory '/usr/src/linux-headers-5.13.19-3-pve'
  CC [M]  /root/QNAP-EC/qnap-ec.o
  MODPOST /root/QNAP-EC/Module.symvers
  CC [M]  /root/QNAP-EC/qnap-ec.mod.o
  LD [M]  /root/QNAP-EC/qnap-ec.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.13.19-3-pve'
/usr/bin/install --owner=root --group=root --mode=644 libuLinux_hal.so \
  /usr/local/lib/libuLinux_hal.so
/usr/bin/install --strip --owner=root --group=root --mode=755 qnap-ec \
  /usr/local/sbin/qnap-ec
make -C /lib/modules/5.13.19-3-pve/build M=/root/QNAP-EC modules_install
make[1]: Entering directory '/usr/src/linux-headers-5.13.19-3-pve'
arch/x86/Makefile:148: CONFIG_X86_X32 enabled but no binutils support
  INSTALL /lib/modules/5.13.19-3-pve/extra/qnap-ec.ko
  SIGN    /lib/modules/5.13.19-3-pve/extra/qnap-ec.ko
  DEPMOD  /lib/modules/5.13.19-3-pve
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[1]: Leaving directory '/usr/src/linux-headers-5.13.19-3-pve'
/usr/sbin/depmod --quick
/usr/sbin/modprobe qnap-ec
modprobe: ERROR: could not insert 'qnap_ec': No such device
make: [Makefile:90: install] Error 1 (ignored)

file qnap_ec.ko exists but for some reason I am unable to insert this module -- the error message is always the same.

modprobe: ERROR: could not insert 'qnap_ec': No such device

Do you have any idea how to resolve this? 🙏🏻 Thanks.

Stonyx commented 2 years ago

The driver is coded to check a certain memory address to try and detect the presence of the IT8528 chip before it initiates any communication to it via the QNAP closed source library, however, there is the possibility that this results in a false negative. The memory address is reverse engineered from and tested on a few devices, but that doesn't guarantee that it's the same address on all QNAP devices. You can try to load the driver and skip this check by running the following:

sudo modprobe qnap-ec check-for-chip=no

This will cause the driver to go straight to trying to communicate with the chip whether it thinks the chip is present or not. There are technically risks associated with this since it will blindly try to communicate with the chip, however, in reality it will most likely either work (if the chip is present) or just fail (if the chip isn't present).

If the above command doesn't result in being able to read fans, temperatures, etc., then it means that the QNAP unit you're trying to load this on uses a chip other than the IT8528 chip for the fans, temperatures, etc.

Hope this helps.

Stonyx commented 2 years ago

Also, would you mind sharing which QNAP model you're trying to load this on?

Stonyx commented 2 years ago

Closing due to inactivity. Assuming fixed using provided instructions.