Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Andre McCurdy <armccurdy@gmail.com>,
	OE Core mailing list <openembedded-core@lists.openembedded.org>
Subject: Re: Staging machine specific kernel headers in sysroot
Date: Sat, 02 Apr 2016 09:48:48 +0100	[thread overview]
Message-ID: <1459586928.7348.75.camel@linuxfoundation.org> (raw)
In-Reply-To: <CAJ86T=VWi3JQoCs23RqrW95M=z9DszLfgAo3fOT2UaqiJty5jg@mail.gmail.com>

On Fri, 2016-04-01 at 20:38 -0700, Andre McCurdy wrote:
> Say I have a kernel driver with a user space API (simple struct and
> ioctl definitions) defined in a header file which is part of my
> machine specific kernel. The header file is not found in the upstream
> kernel, so doesn't clash with anything in linux-libc-headers.
> 
> Is it OK to use something like the following in my kernel recipe?
> 
>   sysroot_stage_all_append () {
>     install -d ${SYSROOT_DESTDIR}/${includedir}/linux
>     install -m644 ${S}/include/linux/foo.h
> ${SYSROOT_DESTDIR}/${includedir}/linux/
>   }
> 
> I've tested it and everything seems to work fine, but I'm wondering
> if
> bypassing do_install like that is going to cause problems somehow?

You can probably just do it in do_install to be honest, then on target
development would also work.

The trouble we usually have is that people expect more and more kernel
headers to be installed/usable (e.g. to build complete modules against)
until we have a complete build of the kernel there, at which point you
really want to use the kernel shared work directory instead. We did
pretty much the full circle on that.

Or people go the other route and hack linux-libc-headers to install
their header as well, and then the whole system including the compiler
becomes machine specific. I appreciate you're not doing that, I just
want this answer to mention it as that is a much worse idea and the
comments in that recipe reflect some bad experiences for good reason.

So in summary, you can probably do that reasonably safely, on the
understanding that any user of that header will also become machine
specific with a kernel build dependency. There is risk of overlap if
upstream do create such a header or API but its probably not a huge
deal.

Cheers,

Richard


  parent reply	other threads:[~2016-04-02  8:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-02  3:38 Staging machine specific kernel headers in sysroot Andre McCurdy
2016-04-02  5:19 ` Khem Raj
2016-04-02  8:48 ` Richard Purdie [this message]
2016-04-02  9:30   ` Khem Raj
2016-04-05  6:11   ` Mike Looijmans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1459586928.7348.75.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=armccurdy@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox