Cross compiling an external kernel module for BBB

1,828 views
Skip to first unread message

Joshua Datko

unread,
Sep 21, 2013, 10:41:54 PM9/21/13
to beagl...@googlegroups.com
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:

0. I'm running Ubuntu raring 3.8.13-bone21
1. I downloaded the stock 3.8.13 kernel [1]
2. I downloaded the 3.8.13-boine21 patch and config [2] [3]
3. I applied the patch and copied the config to the kernel
4. apt-get install gcc-linux-arm-gnueabi
5. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
6. make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- modules
7. 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.
8. run make install with a prefix and captured the cryptodev.ko
9. I put cryptodev.ko in /lib/modules/extra on the BBB
10. sudo depmod -a
11. 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 <snip>
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



vinic...@gmail.com

unread,
Sep 26, 2013, 9:56:09 PM9/26/13
to beagl...@googlegroups.com
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.

siva kumar

unread,
Mar 8, 2014, 7:55:27 AM3/8/14
to beagl...@googlegroups.com
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 :
=============

Downlaoad Kernel 3.8.13


extracted the kernel

Download the  patch


copied it into the kernel folder

patch work done
 
patch -p1 < patch-3.8.13-bone21.diff

Download pm firmware and copied it to firmware folder


Download defconfig


and copied the  defconfig to .config file 

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage dtbs -j4

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage-dtb.am335x-boneblack -j4

finally uImage-dtb.am335x-boneblack created 

but while booting the uImage-BBB i'm facing the following error message 
U-Boot# setenv autoload no
U-Boot# setenv ipaddr 192.168.1.61
U-Boot# setenv serverip 192.168.1.69
U-Boot# setenv bootargs 'console=ttyO0,115200n8 noinitrd rw ip=192.168.1.61:192.168.1.69:192.168.1.100:255.255.255.0::eth0: root=/dev/nfs nfsroot=192.168.1.69:/nfsroot/rootfs'
U-Boot# tftp 0x80200000 uImage-BBB;
link up on port 0, speed 100, full duplex
Using cpsw device
TFTP from server 192.168.1.69; our IP address is 192.168.1.61
Filename 'uImage-BBB'.
Load address: 0x80200000
Loading: #################################################################
#################################################################
#################################################################
#############################
1.2 MiB/s
done
Bytes transferred = 3277861 (320425 hex)
U-Boot# bootm 0x80200000 ;
## Booting kernel from Legacy Image at 80200000 ...
   Image Name:   Linux-3.8.13
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3277797 Bytes = 3.1 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Error: unrecognized/unsupported machine ID (r1 = 0x00000e05).

Available machine support:

ID (hex) NAME
ffffffff Generic OMAP4 (Flattened Device Tree)
ffffffff Generic AM33XX (Flattened Device Tree)
ffffffff Generic OMAP3-GP (Flattened Device Tree)
ffffffff Generic OMAP3 (Flattened Device Tree)
0000060a OMAP3 Beagle Board
00000a9d IGEP OMAP3 module
00000928 IGEP v2 board
00000ae7 OMAP4 Panda board

Please check your kernel config and/or bootloader.




can you tell me how to fix the issue!!!!
Reply all
Reply to author
Forward
0 new messages