Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian 11.10 find_module undefined #234

Open
s90 opened this issue Jul 30, 2024 · 7 comments
Open

Debian 11.10 find_module undefined #234

s90 opened this issue Jul 30, 2024 · 7 comments

Comments

@s90
Copy link

s90 commented Jul 30, 2024

Can't build module for 5.10.0-31-amd64 kernel

DKMS make.log for ipt-netflow-2.6-17-g0eb2092 for kernel 5.10.0-31-amd64 (x86_64)
Tue 30 Jul 2024 02:07:03 PM UTC
./gen_compat_def > compat_def.h-
Test function xt_family linux/netfilter_ipv4/ip_tables.h declared
Test struct timeval linux/ktime.h undeclared
Test struct proc_ops linux/proc_fs.h declared
Test function synchronize_sched linux/rcupdate.h undeclared
Test function nf_bridge_info_get linux/netfilter_bridge.h declared
Test struct vlan_dev_priv linux/if_vlan.h declared
Test function put_unaligned_be24 asm/unaligned.h declared
Test function totalram_pages linux/mm.h declared
Test symbol totalram_pages linux/mm.h declared
Test member nf_ct_event_notifier.ct_event net/netfilter/nf_conntrack_ecache.h undeclared
Test function register_sysctl_paths linux/sysctl.h declared
mv compat_def.h- compat_def.h
Compiling 2.6-17-g0eb2092-dirty for kernel 5.10.221
make -C /lib/modules/5.10.0-31-amd64/build M=/var/lib/dkms/ipt-netflow/2.6-17-g0eb2092/build modules
make[1]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
make[1]: Entering directory '/usr/src/linux-headers-5.10.0-31-amd64'
CC [M] /var/lib/dkms/ipt-netflow/2.6-17-g0eb2092/build/ipt_NETFLOW.o
MODPOST /var/lib/dkms/ipt-netflow/2.6-17-g0eb2092/build/Module.symvers
ERROR: modpost: "find_module" [/var/lib/dkms/ipt-netflow/2.6-17-g0eb2092/build/ipt_NETFLOW.ko] undefined!
make[3]: *** [/usr/src/linux-headers-5.10.0-31-common/scripts/Makefile.modpost:123: /var/lib/dkms/ipt-netflow/2.6-17-g0eb2092/build/Module.symvers] Error 1
make[3]: *** Deleting file '/var/lib/dkms/ipt-netflow/2.6-17-g0eb2092/build/Module.symvers'
make[2]: *** [/usr/src/linux-headers-5.10.0-31-common/Makefile:1783: modules] Error 2
make[1]: *** [/usr/src/linux-headers-5.10.0-31-common/Makefile:192: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.0-31-amd64'
make: *** [Makefile:27: ipt_NETFLOW.ko] Error 2

Worked well for previous releases
#dkms status
ipt-netflow, 2.6-17-g0eb2092, 5.10.0-27-amd64, x86_64: installed
ipt-netflow, 2.6-17-g0eb2092, 5.10.0-28-amd64, x86_64: installed
ipt-netflow, 2.6-17-g0eb2092, 5.10.0-30-amd64, x86_64: installed

@s90
Copy link
Author

s90 commented Jul 31, 2024

Solution is here

compat.h
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,12,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,12,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,220)

@kalamlacki
Copy link

Hi,

I have just installed on my VirtualBox Debian 11.10 and git cloned ipt-netflow and compiled/installed without an issue. You have something wrong with your system.

Best regards,
Łukasz

@s90
Copy link
Author

s90 commented Aug 3, 2024

Hi,
Even on virtualbox, on fresh OS it doesn't work
image
Make sure you try on 5.10.0-31 kernel
Anyway I have my solution (see the url above)

@kalamlacki
Copy link

Hi,

yes I did try on 5.10.0-31 Linux kernel

Here are commands after install I did

apt install net-tools gcc g++ make git libxtables-dev dkms

git clone https://github.com/aabc/ipt-netflow.git

./configure

make

make install

shared libs for iptables are in wrong dir:
install -D libipt_NETFLOW.so /usr/lib/debug/.dwz/x86_64-linux-gnu/iptables.debug/libipt_NETFLOW.so
install -D libip6t_NETFLOW.so /usr/lib/debug/.dwz/x86_64-linux-gnu/iptables.debug/libip6t_NETFLOW.so

and need to be moved to correct directory but it works

Best,
Łukasz

@kalamlacki
Copy link

Test function synchronize_sched linux/rcupdate.h undeclared
Test function nf_bridge_info_get linux/netfilter_bridge.h declared
Test struct vlan_dev_priv linux/if_vlan.h declared
Test function put_unaligned_be24 asm/unaligned.h declared
Test function totalram_pages linux/mm.h declared
Test symbol totalram_pages linux/mm.h declared
Test member nf_ct_event_notifier.ct_event net/netfilter/nf_conntrack_ecache.h undeclared
Test function register_sysctl_paths linux/sysctl.h declared
mv compat_def.h- compat_def.h
Compiling 2.6-17-g0eb2092 for kernel 5.10.221
make -C /lib/modules/5.10.0-31-amd64/build M=/root/ipt-netflow modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.0-31-amd64'
CC [M] /root/ipt-netflow/ipt_NETFLOW.o
MODPOST /root/ipt-netflow/Module.symvers
CC [M] /root/ipt-netflow/ipt_NETFLOW.mod.o
LD [M] /root/ipt-netflow/ipt_NETFLOW.ko
make[1]: Leaving directory '/usr/src/linux-headers-5.10.0-31-amd64'
gcc -O2 -Wall -Wunused -DXTABLES -fPIC -o libipt_NETFLOW_sh.o -c libipt_NETFLOW.c
gcc -shared -o libipt_NETFLOW.so libipt_NETFLOW_sh.o
gcc -O2 -Wall -Wunused -DXTABLES -fPIC -o libip6t_NETFLOW_sh.o -c libipt_NETFLOW.c
gcc -shared -o libip6t_NETFLOW.so libip6t_NETFLOW_sh.o
rm libipt_NETFLOW_sh.o libip6t_NETFLOW_sh.o
root@debian:~/ipt-netflow# make install
*
make -C /lib/modules/5.10.0-31-amd64/build M=/root/ipt-netflow modules_install INSTALL_MOD_PATH=
make[1]: Entering directory '/usr/src/linux-headers-5.10.0-31-amd64'
INSTALL /root/ipt-netflow/ipt_NETFLOW.ko
DEPMOD 5.10.0-31-amd64
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[1]: Leaving directory '/usr/src/linux-headers-5.10.0-31-amd64'
/sbin/depmod -a
*
install -D libipt_NETFLOW.so /usr/lib/debug/.dwz/x86_64-linux-gnu/iptables.debug/libipt_NETFLOW.so
install -D libip6t_NETFLOW.so /usr/lib/debug/.dwz/x86_64-linux-gnu/iptables.debug/libip6t_NETFLOW.so
*
Installing into DKMS...
! Installing 2.6-17-g0eb2092 into DKMS...

Creating symlink /var/lib/dkms/ipt-netflow/2.6-17-g0eb2092/source ->
/usr/src/ipt-netflow-2.6-17-g0eb2092

DKMS: add completed.
root@debian:~/ipt-netflow# cd ipt-netflow/

@s90
Copy link
Author

s90 commented Aug 4, 2024

Oh, I got the difference - if ./configure then all's good, if ./configure --enable-natevents then "find_module undefined"
Try with natevents

@kalamlacki
Copy link

Hi,

Yes you are right --enable-natevents makes the difference.

Best regards,
Łukasz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants