OpenNOP / opennop

Open Network Optimization Platform
https://www.opennop.org/
16 stars 10 forks source link

unable to compile kernel module on Debian 8 #6

Closed xamulap closed 8 years ago

xamulap commented 8 years ago
root@opennop-deb:~/dedup/opennopdrv# make
make -C /lib/modules/3.16.0-4-amd64/build M=/root/dedup/opennopdrv modules
make[1]: Entering directory '/usr/src/linux-headers-3.16.0-4-amd64'
Makefile:10: *** mixed implicit and normal rules: deprecated syntax
make[1]: Entering directory `/usr/src/linux-headers-3.16.0-4-amd64'
  CC [M]  /root/dedup/opennopdrv/module.o
/root/dedup/opennopdrv/module.c:150:2: warning: initialization from incompatible pointer type [enabled by default]
  .hook = queue_function, // Function that executes.
  ^
/root/dedup/opennopdrv/module.c:150:2: warning: (near initialization for ‘opennop_hook.hook’) [enabled by default]
/root/dedup/opennopdrv/module.c: In function ‘opennopdrv_init’:
/root/dedup/opennopdrv/module.c:173:2: error: implicit declaration of function ‘genl_register_ops’ [-Werror=implicit-function-declaration]
  err = genl_register_ops(&opennop_family, &opennop_ops_echo);
  ^
cc1: some warnings being treated as errors
/usr/src/linux-headers-3.16.0-4-common/scripts/Makefile.build:262: recipe for target '/root/dedup/opennopdrv/module.o' failed
make[4]: *** [/root/dedup/opennopdrv/module.o] Error 1
/usr/src/linux-headers-3.16.0-4-common/Makefile:1352: recipe for target '_module_/root/dedup/opennopdrv' failed
make[3]: *** [_module_/root/dedup/opennopdrv] Error 2
Makefile:181: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
Makefile:8: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-3.16.0-4-amd64'
Makefile:15: recipe for target 'all' failed
make: *** [all] Error 2
yaplej commented 8 years ago

In Kernel 3.13 genl_register_ops() was removed. http://lxr.free-electrons.com/source/net/netlink/genetlink.c?v=3.13

Might try genl_register_family_with_ops() instead.

yaplej commented 8 years ago

Would you mind testing https://github.com/OpenNOP/opennop/pull/7 and see if it works?

xamulap commented 8 years ago

Confirmed working on Debian 8, 3.16.0-4-amd64

xamulap commented 8 years ago

Seems it is not working very well for me, initially I thought I have issue in setup but for some reason on debain8 it is not working. ( I don't see statistics in "show workers" ).

I've noticed that in 3.16 kernel is missing "routed" message in logs

Linux debian8 3.16.0-4-amd64

[   35.808554] [OpenNOPDrv]: Kernel Version >= 3.1.2 
[   35.809222] [OpenNOPDrv]: opennop_nl_ops 3

Linux debian6 2.6.32-5-amd64

[   24.411963] [OpenNOPDrv]: Kernel Version < 3.0.0 
[   24.412665] [OpenNOPDrv]: opennop_nl_ops 3
[   24.413330] [OpenNOPDrv]: routed

I am not 100% sure it is related to kernel because from time to time I can't see statistics from on kernel 2.6.32. In lab I am using this routed mode with this NAT on one host

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
yaplej commented 8 years ago

Should be totally fixed now.

yaplej commented 7 years ago

@xamulap I finally made some time to work on OpenNOP and found that compiling on Ubuntu/Debian was still broken. In the feature/deduplication branch I modified the opennopdrv Makefile and module.c to try and fix this. It could be a while before that gets merged into master because the deduplication stuff is far from finished.

Hope at least that is now fixed correctly and works if you get around to trying it again.

ajith4ab commented 6 years ago

root@Ajith:~/Desktop/install_folder# bash install.sh ################################################## Realtek Wi-Fi driver Auto installation script Novembor, 21 2011 v1.1.0 ################################################## Decompress the driver source tar ball:

rtl8192EU_linux_v4.2.2_7585.20130524 Authentication requested [root] for make clean: cd hal/OUTSRC/ ; rm -fr /.mod.c /.mod /.o /..cmd /.ko cd hal/OUTSRC/ ; rm -fr .mod.c .mod .o ..cmd .ko cd hal/led ; rm -fr .mod.c .mod .o ..cmd .ko cd hal ; rm -fr //.mod.c //.mod //.o //..cmd //.ko cd hal ; rm -fr /.mod.c /.mod /.o /..cmd /.ko cd hal ; rm -fr .mod.c .mod .o ..cmd .ko cd core/efuse ; rm -fr .mod.c .mod .o ..cmd .ko cd core ; rm -fr .mod.c .mod .o ..cmd .ko cd os_dep/linux ; rm -fr .mod.c .mod .o ..cmd .ko cd os_dep ; rm -fr .mod.c .mod .o ..cmd .ko rm -fr Module.symvers ; rm -fr Module.markers ; rm -fr modules.order rm -fr .mod.c .mod .o ..cmd .ko ~ rm -fr .tmp_versions Authentication requested [root] for make driver: make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.14.0-kali1-amd64/build M=/root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524 modules make[1]: Entering directory '/usr/src/linux-headers-4.14.0-kali1-amd64' CC [M] /root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524/core/rtw_cmd.o In file included from /root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524/include/drv_types.h:32:0, from /root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524/core/rtw_cmd.c:22: /root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524/include/osdep_service.h: In function ‘thread_enter’: /root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524/include/osdep_service.h:251:2: error: implicit declaration of function ‘allow_signal’; did you mean ‘do_signal’? [-Werror=implicit-function-declaration] allow_signal(SIGTERM); ^~~~ do_signal /root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524/include/osdep_service.h: In function ‘flush_signals_thread’: /root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524/include/osdep_service.h:261:6: error: implicit declaration of function ‘signal_pending’; did you mean ‘timer_pending’? [-Werror=implicit-function-declaration] if (signal_pending (current)) ^~~~~~ timer_pending /root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524/include/osdep_service.h:263:3: error: implicit declaration of function ‘flush_signals’; did you mean ‘do_signal’? [-Werror=implicit-function-declaration] flush_signals(current); ^~~~~ do_signal cc1: some warnings being treated as errors /usr/src/linux-headers-4.14.0-kali1-common/scripts/Makefile.build:319: recipe for target '/root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524/core/rtw_cmd.o' failed make[4]: [/root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524/core/rtw_cmd.o] Error 1 /usr/src/linux-headers-4.14.0-kali1-common/Makefile:1520: recipe for target 'module/root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524' failed make[3]: [module/root/Desktop/install_folder/driver/rtl8192EU_linux_v4.2.2_7585.20130524] Error 2 Makefile:146: recipe for target 'sub-make' failed make[2]: [sub-make] Error 2 Makefile:8: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/usr/src/linux-headers-4.14.0-kali1-amd64' Makefile:1043: recipe for target 'modules' failed make: *** [modules] Error 2 ################################################## Compile make driver error: 2 Please check error Mesg ##################################################

ajith4ab commented 6 years ago

brw how it fix it