Cross compiling an external kernel module for BBB

I’m trying to cross compile the cryptodev external kernel module for
use on a BBB (I want to used crypto accelerated AES in openssl). When
I try to modprobe the module, I get:

ERROR: could not insert ‘cryptodev’: Exec format error

and I’m stuck and requesting help from those who have cross compiled modules.

My steps:

  1. I’m running Ubuntu raring 3.8.13-bone21
  2. I downloaded the stock 3.8.13 kernel [1]
  3. I downloaded the 3.8.13-boine21 patch and config [2] [3]
  4. I applied the patch and copied the config to the kernel
  5. apt-get install gcc-linux-arm-gnueabi
  6. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
  7. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules
  8. Cross compiled the module. Cryptodev [4] has no dependencies other
    than the kernel itself. I passed ARCH=arm and
    CROSS_COMPILE=arm-linux-gnueabi- and it built.
  9. run make install with a prefix and captured the cryptodev.ko
  10. I put cryptodev.ko in /lib/modules/extra on the BBB
  11. sudo depmod -a
  12. sudo modprobe cryptodev and I get the error above.

Other info:

file cryptodev.ko yields:

cryptodev.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), BuildID[sha1]=0xcd15e83f02079b8c522a896f9c93a7166b6bac7e, not stripped

modinfo cryptodev yields:

filename: /lib/modules/3.8.13-bone21/extra/cryptodev.ko
license: GPL
description: CryptoDev driver
author: Nikos Mavrogiannopoulos
srcversion: 65CAA0FA92528091299328F
depends:
vermagic: 3.8.13 SMP mod_unload modversions ARMv7 p2v8
parm: cryptodev_verbosity:0: normal, 1: verbose, 2: debug (int)

I’m not sure why the vermagic line doesn’t have 3.8.13-bone21?

Trying to insmod yields:

Error: could not insert module cryptodev.ko: Invalid module format
[101075.881894] cryptodev: no symbol version for module_layout

Thanks for the help,

Josh

[1] https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.8.13.tar.gz
[2] http://rcn-ee.net/deb/raring-armhf/v3.8.13-bone21/patch-3.8.13-bone21.diff.gz
[3] http://rcn-ee.net/deb/raring-armhf/v3.8.13-bone21/defconfig
[4] http://cryptodev-linux.org/

You need to compile kernel image and module in order to load the module. Linux does not allow loading external modules. When you compile your own kernel, you are able to load any module, since they come from the same source.

hai,
can you help me how to fix the below issue
i followed the same procedure which you compiled the kernel for beaglebone black.

procedures i used :