RobertCNelson / bb-kernel

MIT License
130 stars 102 forks source link

make_deb.sh generates packages with wrong architecture #28

Open QuickJack opened 8 years ago

QuickJack commented 8 years ago

I want to create a kernel headers package that allows me to cross compile out of tree kernel modules. After cloning the repo on an amd64 platform and calling make_deb.sh a deb package like linux-headers-4.1.18-bone-rt-r20_1cross_armhf.deb is generated. This package includes binaries in the scripts subfolder that are indeed built for the amd64 platform. However the Architecture property of the generated Debian package is armhf. As a result, the package cannot be installed/ used.

It would be nice to have the script fixed or any alternative method to generate a kernel headers package that allows the above mentioned cross compilation procedure.

RobertCNelson commented 8 years ago

@QuickJack patches welcome, cross building via the "builddeb" script which "make_deb.sh" utilizes has been broken forever.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/scripts/package/builddeb

It's never worked on x86 when building an armhf deb header package, i wouldn't expect it to work on arm64.

Regards,

mhaberler commented 8 years ago

we jumped the gun by building on amd64 in a docker container, using qemu - so no arm buildslave needed

takes about 9mins on a AMD Opteron 6320 so acceptable

see .jenkins directory here: https://github.com/mhaberler/linux-xlnx/tree/zynq_4_4_rt-work

Gemi @kinsamanka came up with the method: https://github.com/kinsamanka/rpi_linux

RobertCNelson commented 8 years ago

@QuickJack @mhaberler

Does this fix cross for you?

https://lkml.org/lkml/2016/3/31/720

Regards,

QuickJack commented 8 years ago

I have also started using Docker. My base is socialdefect/raspbian-jessie-core. I am now able to compile the kernel module as well as the dtbo in one environment. It is a bit slow but it seems to work perfectly.

This procedure allows me to use the kernel headers from the rcn-ee.com repo which simplifies compiling out of tree kernel modules dramatically.

mhaberler commented 8 years ago

@RobertCNelson I did not try - using docker containers for all builds including kernels these days, for instance https://jenkins.machinekit.io/view/machinekit/job/socfpga-kernel-4.1-ltsi-rt/

even if they fixed the scripts arch issue, the debian numbering is still horrible and needs manually patching of scripts/package or so