Cross compile of kernel modules for ONL

430 views
Skip to first unread message

Petro Karashchenko

unread,
Apr 13, 2017, 5:19:31 AM4/13/17
to opennetworklinux
Hi community,

I'm new to ONL. I have a question is there a way to cross compile kernel modules for ONL? I need to compile vendor specific SDK and network device driver to be used in ONL environment. I was wondering of is there a package "onl-kernel-headers-*.deb" that can be used for cross compiling?

Do you have any advices of how to adapt third party build system and compile code with ONL compatible tools?

Regards,
Petro Karashchenko

Steven Noble

unread,
Apr 13, 2017, 12:06:39 PM4/13/17
to Petro Karashchenko, opennetworklinux
Hi Petro,

If you are looking for powerpc, you can find them here:

OpenNetworkLinux/packages/base/powerpc/kernels/kernel-3.16-lts-powerpc-e500v-all/builds

linux-3.16.39 <- entire kernel including headers
linux-3.16.39-mbuild <- headers and select parts from the kernel build

For any platform that we support that you build you will find the headers under packages/base/%arch/kernels

We do not currently generate header packages, but you can easily tar up and grab the header/kernel files.

Petro Karashchenko wrote:
--
You received this message because you are subscribed to the Google Groups "opennetworklinux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opennetworklin...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeffrey Townsend

unread,
Apr 13, 2017, 12:43:15 PM4/13/17
to Petro Karashchenko, opennetworklinux
Petro, 

We don't generate a separate header package itself, but each kernel build package contains the partial build tree necessary to build out-of-tree modules. 
There is a subdirectory in each build package called mbuild which can be extracted and referenced for all out-of-tree builds. 
This build package is used internally for all vendor and platform-specific out-of-tree module builds and is the official interchange for module builds. 

For an example of how they get used you can follow the trail of the following makefiles:

This platform needs these modules built against the given kernels:

This makefile then executes the kernel out-of-tree build script for the given modules and kernels:

This script automates the out-of-tree process for ONL kernels, if you would like to use it:

The important part is here, the extraction of the build tree from the kernel package itself used to build the modules:

If you want to add "normal" modules I would do it in this way. 

If you want to add "complicated" module builds (like the Broadcom SDK's BDE modules) which need the location of the build tree then all you need is to set the $KERNEL location to 
This is the same procedure we use to build our vendor systems. 

Please let me if you have any additinonal questions. 

Regards, 
Jeff


--
You received this message because you are subscribed to the Google Groups "opennetworklinux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opennetworklinux+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages