fixdep wrong format

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”
^~~~~~~~~~~~

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,

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 ?

Sure...

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

Regards,

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.

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..

Regards,

Thank you!!!

I was having enormous problems trying to get through bb-kernel on an actual BBB