Openembedded Core Discussions
 help / color / mirror / Atom feed
* Sanitized kernel headers
@ 2013-10-02 13:45 Peter Kjellerstedt
  2013-10-02 13:56 ` Bruce Ashfield
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Kjellerstedt @ 2013-10-02 13:45 UTC (permalink / raw)
  To: OE Core (openembedded-core@lists.openembedded.org)
  Cc: Darren Hart (dvhart@linux.intel.com)

In a recent commit 
(http://cgit.openembedded.org/openembedded-core/commit/?id=c27ac156bcaf3193d52f456480947b0cfaef3c72), 
Richard added a big warning about not forking the 
linux-libc-headers recipe to get at specific kernel 
headers for user space. As a consequence I thought I 
should remove our fork of linux-libc-headers and instead 
use the suggested method of including the needed files 
from ${STAGING_KERNEL_DIR} in the recipes that need them.

However, I soon realized that what I need are the sanitized 
headers that are generated by running "make headers_install" 
in the kernel sources. So what I then did was to create a 
simple bbclass that generates them for me and makes them 
available for my recipe:

---- %< ------------- kernel-headers.bbclass --------------
DEPENDS += "virtual/kernel"

PACKAGE_ARCH = "${MACHINE_ARCH}"

inherit kernel-arch

KINCLUDES ?= "${WORKDIR}/kernel-includes"

do_compile_prepend() {
	mkdir -p ${KINCLUDES}
	oe_runmake -C ${STAGING_KERNEL_DIR} headers_install INSTALL_HDR_PATH=${KINCLUDES}
}
--------------------------------------------------- >% ----

After that I could simply do 'inherit kernel-headers' and 
'CFLAGS += "-I${KINCLUDES}/includes"' in my recipe to get 
at the sanitized kernel headers.

But, it seems somewhat wasteful for each recipe that need 
those headers to do that. Wouldn't it be an idea to provide 
the sanitized headers in ${STAGING_KERNEL_DIR}/usr/include 
(which would be the default path for make headers_install) 
by default?

//Peter



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-02 13:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-02 13:45 Sanitized kernel headers Peter Kjellerstedt
2013-10-02 13:56 ` Bruce Ashfield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox