Stonyx / QNAP-EC

GNU General Public License v3.0
57 stars 13 forks source link

make failed #19

Open netzwanze opened 1 week ago

netzwanze commented 1 week ago

hello,

i have try to remake on new version of this driver on trunas but its stopps.

[/home/admin/QNAP-EC]# make
rm -f qnap-ec
make -C /lib/modules/6.6.29-production+truenas/build M=/home/admin/QNAP-EC clean
make[1]: Entering directory '/usr/src/linux-headers-6.6.29-production+truenas'
make[1]: Leaving directory '/usr/src/linux-headers-6.6.29-production+truenas'
cc -o qnap-ec qnap-ec-helper.c -Wall -O2 -export-dynamic -ldl
make -C /lib/modules/6.6.29-production+truenas/build M=/home/admin/QNAP-EC MODULE_CFLAGS= modules
make[1]: Entering directory '/usr/src/linux-headers-6.6.29-production+truenas'
  CC [M]  /home/admin/QNAP-EC/qnap-ec.o
In file included from ./include/linux/export.h:5,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/fs.h:5,
                 from /home/admin/QNAP-EC/qnap-ec.c:18:
/home/admin/QNAP-EC/qnap-ec.c: In function 'qnap_ec_misc_device_ioctl':
/home/admin/QNAP-EC/qnap-ec.c:1208:21: warning: passing argument 1 of '__access_ok' makes pointer from integer without a cast [-Wint-conversion]
 1208 |       if (access_ok(argument, sizeof(struct qnap_ec_ioctl_command)) == 0)
      |                     ^~~~~~~~
      |                     |
      |                     long unsigned int
./include/linux/compiler.h:76:45: note: in definition of macro 'likely'
   76 | # define likely(x)      __builtin_expect(!!(x), 1)
      |                                             ^
/home/admin/QNAP-EC/qnap-ec.c:1208:11: note: in expansion of macro 'access_ok'
 1208 |       if (access_ok(argument, sizeof(struct qnap_ec_ioctl_command)) == 0)
      |           ^~~~~~~~~
In file included from ./arch/x86/include/asm/uaccess.h:22,
                 from ./include/linux/uaccess.h:11,
                 from ./include/linux/sched/task.h:11,
                 from ./include/linux/sched/signal.h:9,
                 from ./include/linux/rcuwait.h:6,
                 from ./include/linux/percpu-rwsem.h:7,
                 from ./include/linux/fs.h:33:
./arch/x86/include/asm/uaccess_64.h:85:51: note: expected 'const void *' but argument is of type 'long unsigned int'
   85 | static inline bool __access_ok(const void __user *ptr, unsigned long size)
      |                                ~~~~~~~~~~~~~~~~~~~^~~
/home/admin/QNAP-EC/qnap-ec.c:1219:21: warning: passing argument 1 of '__access_ok' makes pointer from integer without a cast [-Wint-conversion]
 1219 |       if (access_ok(argument, sizeof(struct qnap_ec_ioctl_command)) == 0)
      |                     ^~~~~~~~
      |                     |
      |                     long unsigned int
./include/linux/compiler.h:76:45: note: in definition of macro 'likely'
   76 | # define likely(x)      __builtin_expect(!!(x), 1)
      |                                             ^
/home/admin/QNAP-EC/qnap-ec.c:1219:11: note: in expansion of macro 'access_ok'
 1219 |       if (access_ok(argument, sizeof(struct qnap_ec_ioctl_command)) == 0)
      |           ^~~~~~~~~
./arch/x86/include/asm/uaccess_64.h:85:51: note: expected 'const void *' but argument is of type 'long unsigned int'
   85 | static inline bool __access_ok(const void __user *ptr, unsigned long size)
      |                                ~~~~~~~~~~~~~~~~~~~^~~
  MODPOST /home/admin/QNAP-EC/Module.symvers
  CC [M]  /home/admin/QNAP-EC/qnap-ec.mod.o
  LD [M]  /home/admin/QNAP-EC/qnap-ec.ko
  BTF [M] /home/admin/QNAP-EC/qnap-ec.ko
Skipping BTF generation for /home/admin/QNAP-EC/qnap-ec.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-6.6.29-production+truenas'
netzwanze commented 1 week ago

I found this:

cp /sys/kernel/btf/vmlinux /usr/lib/modules/$(uname -r)/build/

New error:


root@truenas[/home/admin/QNAP-EC]# make               
rm -f qnap-ec
make -C /lib/modules/6.6.29-production+truenas/build M=/home/admin/QNAP-EC clean
make[1]: Entering directory '/usr/src/linux-headers-6.6.29-production+truenas'
make[1]: Leaving directory '/usr/src/linux-headers-6.6.29-production+truenas'
cc -o qnap-ec qnap-ec-helper.c -Wall -O2 -export-dynamic -ldl
make -C /lib/modules/6.6.29-production+truenas/build M=/home/admin/QNAP-EC MODULE_CFLAGS= modules
make[1]: Entering directory '/usr/src/linux-headers-6.6.29-production+truenas'
  CC [M]  /home/admin/QNAP-EC/qnap-ec.o
In file included from ./include/linux/export.h:5,
                 from ./include/linux/linkage.h:7,
                 from ./include/linux/fs.h:5,
                 from /home/admin/QNAP-EC/qnap-ec.c:18:
/home/admin/QNAP-EC/qnap-ec.c: In function 'qnap_ec_misc_device_ioctl':
/home/admin/QNAP-EC/qnap-ec.c:1208:21: warning: passing argument 1 of '__access_ok' makes pointer from integer without a cast [-Wint-conversion]
 1208 |       if (access_ok(argument, sizeof(struct qnap_ec_ioctl_command)) == 0)
      |                     ^~~~~~~~
      |                     |
      |                     long unsigned int
./include/linux/compiler.h:76:45: note: in definition of macro 'likely'
   76 | # define likely(x)      __builtin_expect(!!(x), 1)
      |                                             ^
/home/admin/QNAP-EC/qnap-ec.c:1208:11: note: in expansion of macro 'access_ok'
 1208 |       if (access_ok(argument, sizeof(struct qnap_ec_ioctl_command)) == 0)
      |           ^~~~~~~~~
In file included from ./arch/x86/include/asm/uaccess.h:22,
                 from ./include/linux/uaccess.h:11,
                 from ./include/linux/sched/task.h:11,
                 from ./include/linux/sched/signal.h:9,
                 from ./include/linux/rcuwait.h:6,
                 from ./include/linux/percpu-rwsem.h:7,
                 from ./include/linux/fs.h:33:
./arch/x86/include/asm/uaccess_64.h:85:51: note: expected 'const void *' but argument is of type 'long unsigned int'
   85 | static inline bool __access_ok(const void __user *ptr, unsigned long size)
      |                                ~~~~~~~~~~~~~~~~~~~^~~
/home/admin/QNAP-EC/qnap-ec.c:1219:21: warning: passing argument 1 of '__access_ok' makes pointer from integer without a cast [-Wint-conversion]
 1219 |       if (access_ok(argument, sizeof(struct qnap_ec_ioctl_command)) == 0)
      |                     ^~~~~~~~
      |                     |
      |                     long unsigned int
./include/linux/compiler.h:76:45: note: in definition of macro 'likely'
   76 | # define likely(x)      __builtin_expect(!!(x), 1)
      |                                             ^
/home/admin/QNAP-EC/qnap-ec.c:1219:11: note: in expansion of macro 'access_ok'
 1219 |       if (access_ok(argument, sizeof(struct qnap_ec_ioctl_command)) == 0)
      |           ^~~~~~~~~
./arch/x86/include/asm/uaccess_64.h:85:51: note: expected 'const void *' but argument is of type 'long unsigned int'
   85 | static inline bool __access_ok(const void __user *ptr, unsigned long size)
      |                                ~~~~~~~~~~~~~~~~~~~^~~
  MODPOST /home/admin/QNAP-EC/Module.symvers
  CC [M]  /home/admin/QNAP-EC/qnap-ec.mod.o
  LD [M]  /home/admin/QNAP-EC/qnap-ec.ko
  BTF [M] /home/admin/QNAP-EC/qnap-ec.ko
/bin/sh: 1: ./tools/bpf/resolve_btfids/resolve_btfids: not found
make[3]: *** [scripts/Makefile.modfinal:60: /home/admin/QNAP-EC/qnap-ec.ko] Error 127
make[3]: *** Deleting file '/home/admin/QNAP-EC/qnap-ec.ko'
make[2]: *** [/usr/src/linux-headers-6.6.29-production+truenas/Makefile:1849: modules] Error 2
make[1]: *** [Makefile:237: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.6.29-production+truenas'
make: *** [Makefile:82: module] Error 2
netzwanze commented 1 week ago

find the problem: https://github.com/aircrack-ng/rtl8188eus/issues/263

remove lines from /usr/src/linux-headers-6.6.29-production+truenas/scripts/Makefile.modfinal

-ifdef CONFIG_DEBUG_INFO_BTF_MODULES
-        +$(if $(newer-prereqs),$(call cmd,btf_ko))
-endif
$ uname -a
Linux truenas 6.6.29-production+truenas #1 SMP PREEMPT_DYNAMIC Wed May 29 15:05:57 UTC 2024 x86_64 GNU/Linux
$ sudo modprobe qnap-ec check-for-chip=no
$ # needed to disable chip detection because the QNAP TS-453D identifies itself with 0xFF 0xFF
$ sensors
coretemp-isa-0000
Adapter: ISA adapter
Package id 0:  +50.0 C  (high = +105.0 C, crit = +105.0 C)
Core 0:        +48.0 C  (high = +105.0 C, crit = +105.0 C)
Core 1:        +48.0 C  (high = +105.0 C, crit = +105.0 C)
Core 2:        +48.0 C  (high = +105.0 C, crit = +105.0 C)
Core 3:        +48.0 C  (high = +105.0 C, crit = +105.0 C)

acpitz-acpi-0
Adapter: ACPI interface
temp1:        +51.0 C  

qnap_ec-isa-0000
Adapter: ISA adapter
fan1:         671 RPM
fan7:        65380 RPM
fan8:        25700 RPM
fan23:       25700 RPM
fan26:       25700 RPM
fan33:       25700 RPM
fan36:       65380 RPM
temp1:        +42.0 C  
temp6:        +38.0 C  

nvme-pci-0100
Adapter: PCI adapter
Composite:    +37.9 C  (low  =  -5.2 C, high = +79.8 C)
                       (crit = +84.8 C)