Um 16:02 Uhr am 19.10.20 schrieb Axel Beckert: >> Next step would be to strace the dkms build process and compare the >> output to find out what files are referenced to find the offending >> header files. > > Good idea, thanks!
The more I look at this, the more ?!?! appear above my head. I am currently comparing one working system and one failing system. On both I did the following: # cd /var/lib/dkms/ipt-netflow/2.5.1/source # ./configure --kver=5.9.0-1-amd64 --kdir=/lib/modules/5.9.0-1-amd64/build This resulted in the following *identical* output: --------------8<------------- Module version: 2.5.1 Kernel version: 5.9.0-1-amd64 (requested) Kernel sources: /lib/modules/5.9.0-1-amd64/build (requested) ! Warning: requested kernel version (5.9.0-1-amd64) and requested version of kernel source (5.9.1) doesn't match! ! You may try to specify only kernel source tree with --kdir=/lib/modules/5.9.0-1-amd64/build ! and configure will pick up version properly. ! Assuming you want to build for 5.9.1 Checking for presence of include/linux/netfilter.h... No Checking for presence of include/linux/llist.h... No Checking for presence of include/linux/grsecurity.h... No Iptables binary version: 1.8.5 (legacy) (detected from /usr/sbin/iptables) pkg-config for version 1.8.5 (legacy) exists: No (reported: 1.8.5) Check for working gcc: Yes (gcc) Checking for presence of xtables.h... Yes Searching for iptables-1.8.5 (legacy) sources.. ! Can not find iptables source directory, you may try setting it with --ipt-src= ! This is not fatal error, yet. Will be just using default include dir. Iptables include flags: none (default) Iptables module path: /usr/lib/debug/.dwz/x86_64-linux-gnu/iptables.debug (from binary) Searching for net-snmp-config... No. Searching for net-snmp agent... No. Assuming you don't want net-snmp agent support. Otherwise do: apt-get install snmpd libsnmp-dev Checking for DKMS... Yes. ! You are already have module installed via DKMS ! it will be uninstalled on 'make install' and ! current version of module installed afterwards. ! Use --disable-dkms option if don't want this. Creating Makefile.. done. If you need some options enabled run ./configure --help Now run: make all install --------------8<------------- Then I ran ./gen_compat_def which is used to generate compat_def.h where the problem stem from. And here the output differs: Broken System: ----------8<------------ // Autogenerated for /lib/modules/5.9.0-1-amd64/build Test symbol xt_family linux/netfilter_ipv4/ip_tables.h // xt_family is declared in <linux/netfilter_ipv4/ip_tables.h> #define HAVE_XT_FAMILY Test struct timeval linux/ktime.h // struct timeval is declared in <linux/ktime.h> #define HAVE_TIMEVAL Test struct proc_ops linux/proc_fs.h // struct proc_ops is declared in <linux/proc_fs.h> #define HAVE_PROC_OPS Test symbol synchronize_sched linux/rcupdate.h // synchronize_sched is declared in <linux/rcupdate.h> #define HAVE_SYNCHRONIZE_SCHED // End of compat_def.h ----------8<------------ Working System with undef'ed HAVE_TIMEVAL and HAVE_SYNCHRONIZE_SCHED: ----------8<------------ // Autogenerated for /lib/modules/5.9.0-1-amd64/build Test symbol xt_family linux/netfilter_ipv4/ip_tables.h // xt_family is declared in <linux/netfilter_ipv4/ip_tables.h> #define HAVE_XT_FAMILY Test struct timeval linux/ktime.h #undef HAVE_TIMEVAL // struct timeval is undeclared in <linux/ktime.h>. Compile: // #include <linux/module.h> // #include <linux/ktime.h> // MODULE_LICENSE("GPL"); // struct timeval test; // Output: // make -s -C /lib/modules/5.9.0-1-amd64/build M=/var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build modules // /var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build/test.c:4:16: error: storage size of 'test' isn't known // 4 | struct timeval test; // | ^~~~ // make[2]: *** [/usr/src/linux-headers-5.9.0-1-common/scripts/Makefile.build:288: /var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build/test.o] Error 1 // make[1]: *** [/usr/src/linux-headers-5.9.0-1-common/Makefile:1796: /var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build] Error 2 // make: *** [/usr/src/linux-headers-5.9.0-1-common/Makefile:185: __sub-make] Error 2 Test struct proc_ops linux/proc_fs.h // struct proc_ops is declared in <linux/proc_fs.h> #define HAVE_PROC_OPS Test symbol synchronize_sched linux/rcupdate.h #undef HAVE_SYNCHRONIZE_SCHED // synchronize_sched is undeclared in <linux/rcupdate.h>. Compile: // #include <linux/module.h> // #include <linux/rcupdate.h> // MODULE_LICENSE("GPL"); // void *test = synchronize_sched; // Output: // make -s -C /lib/modules/5.9.0-1-amd64/build M=/var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build modules // /var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build/test.c:4:14: error: 'synchronize_sched' undeclared here (not in a function); did you mean 'synchronize_srcu'? // 4 | void *test = synchronize_sched; // | ^~~~~~~~~~~~~~~~~ // | synchronize_srcu // make[2]: *** [/usr/src/linux-headers-5.9.0-1-common/scripts/Makefile.build:288: /var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build/test.o] Error 1 // make[1]: *** [/usr/src/linux-headers-5.9.0-1-common/Makefile:1796: /var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build] Error 2 // make: *** [/usr/src/linux-headers-5.9.0-1-common/Makefile:185: __sub-make] Error 2 // End of compat_def.h ----------8<------------ What?! I tested with debsums -c and even reinstalled linux-headers-5.9.0-1-common, comparing the before and after, nothing broken, nothing missing. I then removed the "rm $WD" from gen_compat_def to keep the test directory to do some building on my own and strace'ing the difference, in this case for the last test for synchronize_sched: Broken: ----------8<------------ # strace -f -o /tmp/skuld.make.trace make -s -C /lib/modules/5.9.0-1-amd64/build M=/var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build modules [no output] ----------8<------------ Working: ----------8<------------ # strace -f -o /tmp/hild.make.trace make -s -C /lib/modules/5.9.0-1-amd64/build M=/var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build modules /var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build/test.c:4:14: error: 'synchronize_sched' undeclared here (not in a function); did you mean 'synchronize_srcu'? 4 | void *test = synchronize_sched; | ^~~~~~~~~~~~~~~~~ | synchronize_srcu make[2]: *** [/usr/src/linux-headers-5.9.0-1-common/scripts/Makefile.build:288: /var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build/test.o] Error 1 make[1]: *** [/usr/src/linux-headers-5.9.0-1-common/Makefile:1796: /var/lib/dkms/ipt-netflow/2.5.1/source/cc-test-build] Error 2 make: *** [/usr/src/linux-headers-5.9.0-1-common/Makefile:185: __sub-make] Error 2 ----------8<------------ There has to be something strange going on, because the strace from the working system is 4654442 bytes whereas the failing one has 6066615 bytes. I am comparing them right now but have not made heads or tails out of them. If you want in on the "fun", I can send both of them to you privately. Grüße, Sven.