LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 05-04-2015, 02:51 PM   #1
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Weird kernel Versioning error with Virtualbox-kernel. Sed magic needed?


From the Slackbuilds I have virtualbox and virtualbox-kernel installed. The modules will not load "Exec Format Error"

The kernel is the Linux stable git 3.19.0-rc6. The error dmesg shows is
Code:
[86788.162754] vboxdrv: version magic '3.19.0 SMP mod_unload ' should be '3.19.0-rc6 SMP mod_unload '
The modules are installed in /lib/modules/3.19.0-rc6 but a hex editor reveals they have the version "3.19.0 SMP mod_unload" internally. There's a string of 0x00 after the kernel version.

sed 's/3.19.0 SMP mod_unload/3.19.0-rc6 SMP mod_unload/' -i <file> produces a length error, so I need to take out 4 0x00 characters as well. Ideas anyone? My hex reader, dhex doesn't seem to do edits.
 
Old 05-04-2015, 02:57 PM   #2
mancha
Member
 
Registered: Aug 2012
Posts: 484

Rep: Reputation: Disabled
OK, misread the question initially (coffee time).

You can use:

Code:
$ sed -i -e 's/3.19.0 SMP mod_unload\x00\x00\x00\x00/3.19.0-rc6 SMP mod_unload/g' <file>
--mancha

Last edited by mancha; 05-04-2015 at 03:12 PM.
 
Old 05-04-2015, 04:14 PM   #3
ppr:kut
Slackware Contributor
 
Registered: Aug 2006
Location: Netherlands
Distribution: Slackware
Posts: 631

Rep: Reputation: 463Reputation: 463Reputation: 463Reputation: 463Reputation: 463
My take on this is that the kernel module is compiled against a different kernel than the running one. Did you try recompiling?
 
Old 05-05-2015, 06:55 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Original Poster
Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
@ppr:kut: No, same kernel, but a Linus stable git source, not a normal version

@mancha: Nice try, but it resolutely refused to alter the thing. The syntax is probably ok, but sed didn't like the mix of ascii & hex, or something. I tried it every way I could think of, .bak files > .ko files, also escapes on the full stops (3\.19\.0) but to no avail. Searching for text in a binary file didn't really work. I had to get up the ascii table and search for 33 2e 31 39 2e 30 in the hex search of dhex to find it.

Then I discovered dhex does do edits and it was just that I never really examined it. It needs a console to be happy, not an xterm. but I laboriously altered the things (no copy & paste for hex codes, only the search bar).Installing Fedora Electronic spin while I write.

Last edited by business_kid; 05-05-2015 at 06:59 AM.
 
Old 05-05-2015, 12:22 PM   #5
mancha
Member
 
Registered: Aug 2012
Posts: 484

Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
@mancha: Nice try, but it resolutely refused to alter the thing. The syntax is probably ok, but sed didn't like the mix of ascii & hex, or something.
Strange. Works for me:

Code:
$ wc -c b_kid.txt
33 b_kid.txt

$ hexdump -C b_kid.txt
00000000  42 45 47 49 4e 33 2e 31  39 2e 30 20 53 4d 50 20  |BEGIN3.19.0 SMP |
00000010  6d 6f 64 5f 75 6e 6c 6f  61 64 00 00 00 00 45 4e  |mod_unload....EN|
00000020  44                                                |D|

$ sed -i -e 's/3.19.0 SMP mod_unload\x00\x00\x00\x00/3.19.0-rc6 SMP mod_unload/' b_kid.txt

$ wc -c b_kid.txt
33 b_kid.txt

$ hexdump -C b_kid.txt
00000000  42 45 47 49 4e 33 2e 31  39 2e 30 2d 72 63 36 20  |BEGIN3.19.0-rc6 |
00000010  53 4d 50 20 6d 6f 64 5f  75 6e 6c 6f 61 64 45 4e  |SMP mod_unloadEN|
00000020  44                                                |D|
Though, as you said, to be entirely proper we should escape the periods in our sed (i.e. sed -i -e 's/3\.19\.0 SMP mod_unload\x00\x00\x00\x00/3.19.0-rc6 SMP mod_unload/').

--mancha
Attached Files
File Type: txt b_kid.txt (33 Bytes, 19 views)
 
Old 05-05-2015, 01:16 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Original Poster
Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I have uploaded one of the unmodified modules here
https://onedrive.live.com/?cid=99361...4096ff2c07!208

It doesn't work for me, and I had root and farted with perms and everything. No go. I am pretty sure the problem was in the 'find' not the write.
 
Old 05-05-2015, 01:40 PM   #7
mancha
Member
 
Registered: Aug 2012
Posts: 484

Rep: Reputation: Disabled
Looking at the actual file helped a great deal. Basically, there's a space between "mod_unload" and the 0x00's that needs to be
accounted for. With that change, sed works as expected:

Code:
sed -i.orig -e 's/3\.19\.0 SMP mod_unload \x00\x00\x00\x00/3.19.0-rc6 SMP mod_unload /g' vboxdrv.ko
--mancha
 
Old 05-05-2015, 03:34 PM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Original Poster
Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
You're talking about the space at the end? the 0x20? Yes, that is sinnificant, because this string
Code:
3.19.0 SMP mod_unload\x00\x00\x00\x00
is actually 3.19.0 SMP mod_unload\x20\x00\x00\x00\x00
So it figures. . . And I thought I just had bad breadth or something.
 
  


Reply



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
VirtualBox 3.1.6 kernel @ SlackBuild error - kernel include dir dc_eros Slackware 4 05-31-2010 11:24 PM
Weird system behavior since 2.6.25 kernel. Help needed. dennisfen Linux - Kernel 15 06-13-2008 04:47 PM
kernel versioning question St.Jimmy Linux - Kernel 2 10-01-2006 05:07 PM
How do I get module versioning into the kernel? paudle Linux - Software 1 09-03-2004 12:48 PM
Building Kernel (mdkcustom) -- Magic Version error! NachoKB Mandriva 1 08-05-2004 03:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:03 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration