LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 02-04-2014, 04:30 PM   #1
slacksam
Member
 
Registered: Oct 2012
Location: Germany
Distribution: Slackware 14.1
Posts: 56

Rep: Reputation: 1
Question 'hdaps': Exec format error


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: build_log.txt

My kernel version and architecture:
Code:
# uname -r && uname -m
3.10.17-smp
i686
Please help!

Last edited by slacksam; 02-05-2014 at 02:02 AM.
 
Old 02-04-2014, 04:57 PM   #2
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64, LFS, Crux
Posts: 191

Rep: Reputation: 25
Sounds like the module got built for a different arch. Maybe i486, instead of i686.
 
Old 02-04-2014, 05:04 PM   #3
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64, LFS, Crux
Posts: 191

Rep: Reputation: 25
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.

Last edited by j_v; 02-04-2014 at 05:09 PM.
 
Old 02-04-2014, 05:07 PM   #4
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64, LFS, Crux
Posts: 191

Rep: Reputation: 25
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.
 
Old 02-04-2014, 05:17 PM   #5
slacksam
Member
 
Registered: Oct 2012
Location: Germany
Distribution: Slackware 14.1
Posts: 56

Original Poster
Rep: Reputation: 1
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"

Last edited by slacksam; 02-04-2014 at 05:21 PM.
 
Old 02-04-2014, 05:22 PM   #6
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64, LFS, Crux
Posts: 191

Rep: Reputation: 25
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.

Last edited by j_v; 02-04-2014 at 05:37 PM.
 
Old 02-04-2014, 05:30 PM   #7
slacksam
Member
 
Registered: Oct 2012
Location: Germany
Distribution: Slackware 14.1
Posts: 56

Original Poster
Rep: Reputation: 1
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.

Last edited by slacksam; 02-04-2014 at 05:34 PM.
 
Old 02-04-2014, 05:39 PM   #8
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64, LFS, Crux
Posts: 191

Rep: Reputation: 25
Yep, I saw it after my last post edit, and was to late to change it. Sorry.
Your right, it is strange.
 
Old 02-04-2014, 05:45 PM   #9
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64, LFS, Crux
Posts: 191

Rep: Reputation: 25
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.
 
Old 02-04-2014, 05:50 PM   #10
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64, LFS, Crux
Posts: 191

Rep: Reputation: 25
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.

Last edited by j_v; 02-04-2014 at 06:00 PM.
 
Old 02-04-2014, 06:02 PM   #11
slacksam
Member
 
Registered: Oct 2012
Location: Germany
Distribution: Slackware 14.1
Posts: 56

Original Poster
Rep: Reputation: 1
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!

Last edited by slacksam; 02-04-2014 at 06:10 PM.
 
Old 02-04-2014, 06:12 PM   #12
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64, LFS, Crux
Posts: 191

Rep: Reputation: 25
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.
 
Old 02-04-2014, 06:58 PM   #13
slacksam
Member
 
Registered: Oct 2012
Location: Germany
Distribution: Slackware 14.1
Posts: 56

Original Poster
Rep: Reputation: 1
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
 
Old 02-04-2014, 07:25 PM   #14
j_v
Member
 
Registered: Oct 2011
Distribution: Slackware64, LFS, Crux
Posts: 191

Rep: Reputation: 25
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.
 
1 members found this post helpful.
Old 02-05-2014, 01:14 AM   #15
slacksam
Member
 
Registered: Oct 2012
Location: Germany
Distribution: Slackware 14.1
Posts: 56

Original Poster
Rep: Reputation: 1
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....
 
  


Reply

Tags
error, i686, kernel module, slackware 14.1, thinkpad


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
qemu: run gust images face error > Exec format error Sefid par Linux - Virtualization and Cloud 3 07-30-2013 02:40 PM
Exec Format error on chroot business_kid Fedora 3 10-07-2012 08:51 AM
chroot: cannot execute /bin/sh: Exec format error jnojr Linux - General 8 06-24-2012 12:52 AM
cgi: exec format error Jane2008 Linux - Newbie 2 08-14-2009 09:10 AM
MDK 9.1 Fatal Error in Stage 1: Exec Format Error Beano Mandriva 5 09-12-2004 03:04 PM


All times are GMT -5. The time now is 01:59 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration