[SOLVED] netatop kernel module won't compile with 3.12.19...

This forum is for topics specific to the Raspberry Pi and Arch Linux ARM

[SOLVED] netatop kernel module won't compile with 3.12.19...

Postby honza » Sun May 11, 2014 3:02 pm

Hi all,

I use atop on my Pi and I use it with the netatop kernel module for monitoring network data. In the past, I only needed to edit the following two PKGBUILD lines (possibly also followed by a 'depmod -a'):

$this->bbcode_second_pass_code('', '
-arch=('x86_64' 'i386')
+arch=('x86_64' 'i386' 'armv6h')

-install -Dm 0744 module/netatop.ko $pkgdir/lib/modules/extramodules-${v%.*}-ARCH/netatop.ko
+install -Dm 0744 module/netatop.ko $pkgdir/lib/modules/$(uname -r)/extramodules/netatop.ko
')
After upgrading to the 3.12.19 kernel, I can no longer compile this module. When I try I get the following error:

$this->bbcode_second_pass_code('', '
==> Starting build()...
./mkversion
cd module; make
make[1]: Entering directory '/tmp/yaourt-tmp-******/aur-netatop/src/netatop-0.3/module'
echo start the make
start the make
make -C /lib/modules/3.12.19-1-ARCH/build M=/tmp/yaourt-tmp-******/aur-netatop/src/netatop-0.3/module modules
make[2]: Entering directory '/usr/lib/modules/3.12.19-1-ARCH/build'
CC [M] /tmp/yaourt-tmp-******/aur-netatop/src/netatop-0.3/module/netatop.o
In file included from include/linux/kernel.h:6:0,
from /tmp/yaourt-tmp-******/aur-netatop/src/netatop-0.3/module/netatop.c:84:
include/linux/linkage.h:7:25: fatal error: asm/linkage.h: No such file or directory
#include <asm/linkage.h>
^
compilation terminated.
scripts/Makefile.build:314: recipe for target '/tmp/yaourt-tmp-******/aur-netatop/src/netatop-0.3/module/netatop.o' failed
make[3]: *** [/tmp/yaourt-tmp-******/aur-netatop/src/netatop-0.3/module/netatop.o] Error 1
Makefile:1228: recipe for target '_module_/tmp/yaourt-tmp-******/aur-netatop/src/netatop-0.3/module' failed
make[2]: *** [_module_/tmp/yaourt-tmp-******/aur-netatop/src/netatop-0.3/module] Error 2
make[2]: Leaving directory '/usr/lib/modules/3.12.19-1-ARCH/build'
Makefile:9: recipe for target 'netatop.ko' failed
make[1]: *** [netatop.ko] Error 2
make[1]: Leaving directory '/tmp/yaourt-tmp-******/aur-netatop/src/netatop-0.3/module'
Makefile:2: recipe for target 'all' failed
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
==> ERROR: Makepkg was unable to build netatop.
')

I came across this thread https://stackoverflow.com/questions/9492559/module-compiling-asm-linkage-h-file-not-found, but editing the Makefiles in the package does not appear to have any effect.

I'm going to downgrade to an earlier kernel and see if the 'asm/linkage.h' file shows up again.

If anyone has any pointers, they would be much appreciated.


EDIT 0: I have tried downgrading the kernel to 3.10.38, compiling the module, then trying to add the compiled kernel, but I get the following error:
$this->bbcode_second_pass_code('', '
$ sudo depmod -a
$ sudo modprobe netatop
modprobe: ERROR: could not insert 'netatop': Exec format error
')

EDIT 1: A quick search shows there is indeed an 'asm/linkage.h' path.
$this->bbcode_second_pass_code('', '
$ find /usr/ -type f -name "linkage.h"
/usr/lib/modules/3.14.2-2-ARCH/build/include/linux/linkage.h
/usr/lib/modules/3.14.2-2-ARCH/build/include/asm-generic/linkage.h
/usr/src/linux-3.14.2-2-ARCH/arch/arm/include/asm/linkage.h
')
Now I'm trying to figure out this file isn't being properly referenced in the code.

EDIT 2: It looks like most, if not all, of the files needed to build the model are located somewhere on the system. However, they appear to have been moved to different locations in the newer kernels. I have not yet had time to map out the file location changes between the different kernel releases. That is my next plan of action.

EDIT 3: Upgrading to 3.14.4-1 seems to have fixed the problem.
$this->bbcode_second_pass_code('', '
$ sudo pacman -S linux-raspberrypi-latest{,-headers}
')Unfortunately, I did not get around to delving into what was making this module build fail with those other kernels.
honza
 
Posts: 1
Joined: Wed Mar 05, 2014 5:43 am

Return to Raspberry Pi

Who is online

Users browsing this forum: No registered users and 8 guests