LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   'hdaps': Exec format error (https://www.linuxquestions.org/questions/slackware-14/hdaps-exec-format-error-4175493731/)

slacksam 02-04-2014 04:30 PM

'hdaps': Exec format error
 
1 Attachment(s)
Hi,

on my ThinkPad x200 with Slackware 14.1 (32bit), I installed the tp_smapi package from Slackbuilds and when I try to load the hdaps module, it throws me the error message:
Code:

# modprobe -v hdaps
insmod /lib/modules/3.10.17-smp/kernel/drivers/firmware/thinkpad_ec.ko force_io=1
modprobe: ERROR: could not insert 'hdaps': Exec format error

This is confusing me because in Slackware 14.0 it worked well and this error message I usually get only when I try to run a program that was built for an architecture different than ix86.

Here's the output I got during the build process: Attachment 14683

My kernel version and architecture:
Code:

# uname -r && uname -m
3.10.17-smp
i686

Please help!

j_v 02-04-2014 04:57 PM

Sounds like the module got built for a different arch. Maybe i486, instead of i686.

j_v 02-04-2014 05:04 PM

Yeah, the SlackBuild file needs fixing.

Code:

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
      *) ARCH=$( uname -m ) ;;
  esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

if [ "$ARCH" = "i486" ]; then
  SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
  SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
  SLKCFLAGS="-O2 -fPIC"
  LIBDIRSUFFIX="64"
else
  SLKCFLAGS="-O2"
  LIBDIRSUFFIX=""
fi

The line wtih "i?86" in the case statement is making your module get built for i486, but you are running i686.

EDIT: The SlackBuild itself doesn't need fixing, just edited by you for your build. Didn't mean to step on the package maintainer's toes there.

j_v 02-04-2014 05:07 PM

Change

Code:

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    i?86) ARCH=i486 ;;
    arm*) ARCH=arm ;;
      *) ARCH=$( uname -m ) ;;
  esac
fi

to

Code:

if [ -z "$ARCH" ]; then
  case "$( uname -m )" in
    arm*) ARCH=arm ;;
      *) ARCH=$( uname -m ) ;;
  esac
fi

This will get the build to work for your i686 kernel.

slacksam 02-04-2014 05:17 PM

Hi j_v,

I followed your advice and built it for the i686 architecture:
Code:

# ARCH="i686" sh tp_smapi.SlackBuild
But that makes no difference. Still doesn't work.

Edit: The package name now is "tp_smapi-0.41_3.10.17_smp-i686-1_SBo.tgz"

j_v 02-04-2014 05:22 PM

NO. You have to change the build script. That case statement is just taking your 'ARCH="i686"' and replacing it with 'i?86) ARCH=i486 ;;' if you don't change the script!

EDIT: sorry, didn't mean to yell.
EDIT2: And I see I was wrong. I was ignoring the 'if [ -z "$ARCH" ]; then' test.

slacksam 02-04-2014 05:30 PM

The line
Code:

if [ -z "$ARCH" ]; then
means: "if $ARCH is empty then"! That's why I added the parameter and it was built for the i686 architecture.

Now I changed the code as you adviced, but the result is the same.

The error still occurs.

Anyway, thanks for trying to help me!


Edit: That's why I wrote in my first post why it confuses me. It is built for the right architectute but this error occurs.

j_v 02-04-2014 05:39 PM

Yep, I saw it after my last post edit, and was to late to change it. Sorry.
Your right, it is strange.

j_v 02-04-2014 05:45 PM

I wonder if you tried to load without the 'force_io=1'? It isn't listed on the Tp smapi wiki for your model. Not sure. About as much help as I can be, I think.

j_v 02-04-2014 05:50 PM

Or perhaps you could try building via the current git for the module. There has been some changes since 0.41 was released.

EDIT: I've prepped a patch that brings 0.41 up to current git. Let me know if you want it and I can either put it on my github page or some other way to make it available.

slacksam 02-04-2014 06:02 PM

I downloeded the git package, changed the slackbuild to use "VERSION=master" and to use unzip to extract the downloaded zipfile. Bilding the package was successfull, but there's still no change in the result.

When I use the "force" parameter with modprobe:
Code:

# modprobe -vf hdaps
install /sbin/modprobe -i tp_smapi ; /sbin/modprobe -i hdaps
insmod /lib/modules/3.10.17-smp/kernel/drivers/firmware/tp_smapi.ko
modprobe: ERROR: could not insert 'tp_smapi': Exec format error
insmod /lib/modules/3.10.17-smp/extra/hdaps.ko
modprobe: ERROR: could not insert 'hdaps': Exec format error
modprobe: ERROR: Error running install command for hdaps
modprobe: ERROR: could not insert 'hdaps': Operation not permitted


Edit: Now I have to go to bed, it already is 01:05 h CET here in Germany. Thank you!

j_v 02-04-2014 06:12 PM

Damn. Well, just one question. I doublt that this is the problem, as you seem pretty savy, but is it possible that the kernel you are running and the modules at /lib/modules/3.10.17-smp are somehow mismatched? Like if you've built a custom kernel that has the same name as the ones in /lib/modules, but maybe those modules didn't actually come from the the same kernel build as the kernel you are running. Or something along these lines. It's the only other thing that comes to mind.

slacksam 02-04-2014 06:58 PM

Before going to bed, I did:
Code:

$ for P in kernel-generic kernel-modules; do wget ftp://ftp.ntua.gr/pub/linux/slackware/slackware-14.1/slackware/a/$P-smp-3.10.17_smp-i686-3.txz; done
# su -
# installpkg kernel-generic-smp-3.10.17_smp-i686-3.txz kernel-modules-smp-3.10.17_smp-i686-3.txz
# mkinitrd -F
# lilo
# reboot

...
Code:

$ su -
# removepkg tp_smapi
# ARCH=i686 sh tp_smapi.SlackBuild
# installpkg /tmp/tp_smapi-0.41_3.10.17_smp-i686-1_SBo.tgz
# modprobe -v hdaps
install /sbin/modprobe -i tp_smapi ; /sbin/modprobe -i hdaps
insmod /lib/modules/3.10.17-smp/kernel/drivers/firmware/tp_smapi.ko
modprobe: ERROR: could not insert 'tp_smapi': Exec format error
insmod /lib/modules/3.10.17-smp/extra/hdaps.ko
modprobe: ERROR: could not insert 'hdaps': Exec format error
modprobe: ERROR: Error running install command for hdaps
modprobe: ERROR: could not insert 'hdaps': Operation not permitted

Still no luck :(

j_v 02-04-2014 07:25 PM

I should have thought of this earlier, but I guess I would check for log entries in /var/log/{debug,dmesg,messages,syslog} to see if there is more information from the kernel that what insmod/modprobe is giving you.

slacksam 02-05-2014 01:14 AM

Now I built another kernel module from the slackbuilds: 'vhba-module'
It throws me the same error message when I try to load it with modprobe. On another machine with the same system I have no such issue. So it looks like the problem is only on the system I installed on the ThinkPad.

In the logfiles debug, dbus and modules there is no message about it at all, but the syslog shows:
Code:

Feb  5 07:41:12 slacktop kernel: [ 3233.876471] tp_smapi: version magic '3.10.17-sam SMP preempt mod_unload PENTIUMIII ' should be '3.10.17-smp SMP mod_unload PENTIUMIII '
Feb  5 07:41:12 slacktop kernel: [ 3233.878273] hdaps: version magic '3.10.17-sam SMP preempt mod_unload PENTIUMIII ' should be '3.10.17-smp SMP mod_unload PENTIUMIII '

So you were right, j_v: the modules are built for a custom kernel!

Now my question is how to get rid of that custom kernel and manage to boot the native one?
Reinstalling the generic kernel seems not to be enough. Is it because I can't reinstall the kernel the system is booting with?

I'll try the huge one....


All times are GMT -5. The time now is 07:09 AM.