sábado, 18 de abril de 2015

ERROR: could not insert 'gamecon_gpio_rpi': Exec format error - solved

I found an old SNES gamepad and trying to use it with my Raspberry Pi and RetroPi. I ended up in trouble but after some pleasant hours googling, everything worked out.

If when you run:  modprobe gamecon_gpio_rpi map=1 a bad message appears in stderr: ERROR: could not insert 'gamecon_gpio_rpi': Exec format error and in dmesg:  gamecon_gpio_rpi: disagrees about version of symbol module_layout.
Try to check if your running kernel and your linux-headers have the same version. If they are equal, your Module.symvers file could be wrong.

PS: If you don't know that I'm talking about please visit: https://github.com/petrockblog/RetroPie-Setup/wiki/gamecon_gpio_rpi

Linux-headers and gamecon-gpio-rpi module could be found here:
http://www.niksula.hut.fi/~mhiienka/Rpi/

Well, to fix it install the latest linux-headers for your kernel:

# dpkg -i linux-headers-3.18.7+_3.18.7+-2_armhf.deb 

run these commands:
# REV=`zcat /usr/share/doc/raspberrypi-bootloader/changelog.Debian.gz | grep '* firmware as of' | head -n 1 | sed  -e 's/\  \*\ firmware as of \(.*\)$/\1/'`

# wget https://raw.github.com/raspberrypi/firmware/$REV/extra/Module.symvers -O Module.symvers

# OSVERSION=`uname -r`

# cp Module.symvers /usr/src/linux-source-$OSVERSION/

and install module package:

# dpkg -i gamecon-gpio-rpi-dkms_1.0_all.deb

# modprobe gamecon_gpio_rpi map=1

That's it.



Notícias Selecionadas