Wind River Support Network

HomeDefectsLIN8-2777
Fixed

LIN8-2777 : Modified kernel headers don't work.

Created: Feb 17, 2016    Updated: Jul 17, 2017
Resolved Date: Mar 9, 2016
Found In Version: 8.0.0.1
Fix Version: 8.0.0.1
Severity: Standard
Applicable for: Wind River Linux 8
Component/s: Kernel

Description

If we disregard from the obvious that one should not normally change in the kernel headers, we do have some customers that do it anyway.

I'm trying to follow the guide in wr_linux_kernel_command_line_tutorials_80.pdf, chapter 5 "Exporting Custom Kernel Headers".

There is several issues here I believe:

1. The tutorial don't work

2. The tutorial don't bring us the whole way, showing howto export the custom/modified kernel header to sysroot and an app that uses the kernel header.

3. I'm not sure the raw copy of files out of the kernel include tree is the best approach. Normally one would do similar to:

do_install_append() {
    make headers_install INSTALL_HDR_PATH=${D}/usr
    find ${D}/usr/include -name .install -exec rm {} \;
    find ${D}/usr/include -name ..install.cmd -exec rm {} \;
}

# this exports kernel headers from staging dir into the kernel dev rpm
FILES_${PN}-dev_append = " /usr/include"

Which makes use of kernel make target "headers_install" that sanities the header files (but not completely as there is ugly leftovers in the exported dir, which is the .install and ..install.cmd files all over the place).

My workaround for WRL5 don't seem to work in WRL8 either so right now I have not found a way to do it, correctly nor workaround wise.

Could someone please show howto make use of the attached kernel patch (0001-kernel-headers-some-changes.patch, that modifies a kernel header exported to userland) and a simple app (if-bonding-test.c, that tries to make use of the change)?

Workaround

For WRL5, please see the attached tarballs 
meta-kernelheaders.tar.bz2 (which adds generic export functionality) and 
meta-kernelheaders-tests.tar.bz2 (which shows a kernel header change and a app that uses it).

For WRL8 I have not found any solution yet.

Steps to Reproduce

Product way would be to:

1. Make a platform (I used intel-x86-64)

2. Patch kernel as attached 0001-kernel-headers-some-changes.patch

3. Add to local.conf
KERNEL_INSTALL_HEADER_append += "uapi/linux/if_bonding.h"

4. Rebuild

I don't see that the change in if_bonding.h is exported anywere.
Live chat
Online