fixdep wrong format

793 views
Skip to first unread message

Dave

unread,
May 21, 2019, 5:45:35 AM5/21/19
to BeagleBoard
using the build_deb.sh script in the repository bb-kernel to build 
linux-image-5.1.0-rc3-bone0_1xross_armhf.deb
linux-headers-5.1.0-rc3-bone0_1xross_armhf.deb
linux-libc-dev_1xross_armhf.deb             

After I install these on the target. 

Trying to build a kernel module on the target results in 
/bin/sh: 1: scripts/basic/fixdep: Exec format error

because fixdef in
/usr/src/linux-headers-5.1.0-rc3-bone0/scripts/basic
is elf x86 64

I tried going to 
/usr/src/linux-headers-5.1.0-rc3-bone0
and executing
make scripts

This built alot but eventually failed with 

scripts/selinux/genheaders/genheaders.c:19:10: fatal error: classmap.h: No such file or directory
 #include "classmap.h"
          ^~~~~~~~~~~~




Robert Nelson

unread,
May 21, 2019, 7:23:43 AM5/21/19
to Beagle Board, Dave Lynch


On Tue, May 21, 2019, 4:45 AM Dave <m...@dlasys.net> wrote:
using the build_deb.sh script in the repository bb-kernel to build 
linux-image-5.1.0-rc3-bone0_1xross_armhf.deb
linux-headers-5.1.0-rc3-bone0_1xross_armhf.deb
linux-libc-dev_1xross_armhf.deb             

After I install these on the target. 

Trying to build a kernel module on the target results in 
/bin/sh: 1: scripts/basic/fixdep: Exec format error

because fixdef in
/usr/src/linux-headers-5.1.0-rc3-bone0/scripts/basic
is elf x86 64

Yes the build arch leaks thru.. This has been a bug for a long time. Run build_deb.sh on the target arch, if you want the headers to work..

Regards,

Dave

unread,
May 21, 2019, 6:19:47 PM5/21/19
to BeagleBoard
Thanks for the response.

My goal is just to be able to build a single driver/module for testing./debugging, without having to go through the entire kernel package build process each time. 
I do not care whether I am building the driver on the target on on an x86 host. 
 
I had hope that just installing the kernel headers on the target was sufficient 
When that did not work I tried to copy the bb-kernel/KERNEL tree into /usr/src/linux-..... on the target. 
and do a
make scripts
there. 
but when I tried to build a driver on the target I got a file format error when make tried to execute modpost. 
I can not seem to figure out how to get an arm version of modpost to build. 

I am now trying to get build_debs.sh to run on the target. 
But I may grow old and die before that finishes. 

Do you have any suggestions as to an easier way to get the environment needed to build a single driver ?






Robert Nelson

unread,
May 21, 2019, 9:06:29 PM5/21/19
to Beagle Board, Dave Lynch
Sure...

sudo apt update
sudo apt install linux-headers-5.1.0-rc3-bone0

Regards,

--
Robert Nelson
https://rcn-ee.com/

Dave

unread,
May 22, 2019, 12:49:44 AM5/22/19
to BeagleBoard
When I do that:

I am get

apt install linux-headers-5.1.0-rc3-bone0 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
linux-headers-5.1.0-rc3-bone0 is already the newest version (1xross).
0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.

When I do
apt install --reinstall linux-headers-5.1.0-rc3-bone0 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Reinstallation of linux-headers-5.1.0-rc3-bone0 is not possible, it cannot be downloaded.
0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.

And if I use the package in bb-kernel/deploy, Then I am back with my mixed arm/x86 binaries. 





Robert Nelson

unread,
May 22, 2019, 12:23:09 PM5/22/19
to Beagle Board, Dave Lynch
Oh, so you already installed the broken one, which has a bigger
version number then the repo version..

sudo apt remove linux-headers-5.1.0-rc3-bone0 --purge

to rip out the bad version..

Dave

unread,
May 23, 2019, 4:52:50 AM5/23/19
to BeagleBoard
Thank you!!!
 I was having enormous problems trying to get through bb-kernel on an actual BBB
Reply all
Reply to author
Forward
0 new messages