All of lore.kernel.org
 help / color / mirror / Atom feed
* How to export kernel specific headers to userspace
@ 2018-06-19  5:16 Ankit Rastogi
  2018-06-19  5:19 ` Ankit Rastogi
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ankit Rastogi @ 2018-06-19  5:16 UTC (permalink / raw)
  To: poky

[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]

Hi,

Can someone provide any pointers on how to export kernel specific headers to userspace?

I am getting below error while building our one of the component which requires kernel uapi headers.

Error Received:
 /hdmi-capture/main.c:16:10: fatal error: linux/hdmi_info.h: No such file or directory
> |  #include <linux/hdmi_info.h>
> |           ^~~~~~~~~~~~~~~~~~~
> | compilation terminated.

In yocto 2.5, userspace is boot strapped with linux-libc-headers package which uses a set of uapi headers from Linux kernel 4.15. Can someone suggest for custom kernels, how to expose uapi headers to userspace? Thus create a separate linux-apl-headers package with those files.

Thanks,
Ankit

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

[-- Attachment #2: Type: text/html, Size: 3368 bytes --]

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

* How to export kernel specific headers to userspace
  2018-06-19  5:16 How to export kernel specific headers to userspace Ankit Rastogi
@ 2018-06-19  5:19 ` Ankit Rastogi
  2018-06-19  6:50   ` Khem Raj
  2018-06-19 13:22 ` Richard Purdie
  2018-06-19 13:44 ` Bas Mevissen
  2 siblings, 1 reply; 8+ messages in thread
From: Ankit Rastogi @ 2018-06-19  5:19 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]

Hi,

Can someone provide any pointers on how to export kernel specific headers to userspace?

I am getting below error while building our one of the component which requires kernel uapi headers.

Error Received:
 /hdmi-capture/main.c:16:10: fatal error: linux/hdmi_info.h: No such file or directory
> |  #include <linux/hdmi_info.h>
> |           ^~~~~~~~~~~~~~~~~~~
> | compilation terminated.

In yocto 2.5, userspace is boot strapped with linux-libc-headers package which uses a set of uapi headers from Linux kernel 4.15. Can someone suggest for custom kernels, how to expose uapi headers to userspace? Thus create a separate linux-apl-headers package with those files.

Thanks,
Ankit

This message contains information that may be privileged or confidential and is the property of the KPIT Technologies Ltd. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Technologies Ltd. does not accept any liability for virus infected mails.

[-- Attachment #2: Type: text/html, Size: 3707 bytes --]

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

* Re: How to export kernel specific headers to userspace
  2018-06-19  5:19 ` Ankit Rastogi
@ 2018-06-19  6:50   ` Khem Raj
  0 siblings, 0 replies; 8+ messages in thread
From: Khem Raj @ 2018-06-19  6:50 UTC (permalink / raw)
  To: Ankit Rastogi, yocto



On 6/18/18 10:19 PM, Ankit Rastogi wrote:
> Hi,
> 
> 
> Can someone provide any pointers on how to export kernel specific 
> headers to userspace?
> 
> I am getting below error while building our one of the component which 
> requires kernel uapi headers.
> 
> Error Received:
>   /hdmi-capture/main.c:16:10: fatal error: linux/hdmi_info.h: No such 
> file or directory
>> |  #include <linux/hdmi_info.h>
>> |           ^~~~~~~~~~~~~~~~~~~
>> | compilation terminated.
> 
> In yocto 2.5, userspace is boot strapped with linux-libc-headers package 
> which uses a set of uapi headers from Linux kernel 4.15. Can someone 
> suggest for custom kernels, how to expose uapi headers to userspace? 
> Thus create a separate linux-apl-headers package with those files.
> 

you can write your own kernel headers recipe and make that preferred 
provider.

or you can add patch to existing recipe.

I would suggest that be careful to expose the APIs here, if its already 
an UAPI in later versions of kernel and you are backporting to an older 
version it might be fine but ramdom header export would land you in 
problems later.

> Thanks,
> Ankit
> 
> This message contains information that may be privileged or confidential 
> and is the property of the KPIT Technologies Ltd. It is intended only 
> for the person to whom it is addressed. If you are not the intended 
> recipient, you are not authorized to read, print, retain copy, 
> disseminate, distribute, or use this message or any part thereof. If you 
> receive this message in error, please notify the sender immediately and 
> delete all copies of this message. KPIT Technologies Ltd. does not 
> accept any liability for virus infected mails.
> 


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

* Re: How to export kernel specific headers to userspace
  2018-06-19  5:16 How to export kernel specific headers to userspace Ankit Rastogi
  2018-06-19  5:19 ` Ankit Rastogi
@ 2018-06-19 13:22 ` Richard Purdie
  2018-06-19 13:56   ` Bruce Ashfield
  2018-06-19 13:44 ` Bas Mevissen
  2 siblings, 1 reply; 8+ messages in thread
From: Richard Purdie @ 2018-06-19 13:22 UTC (permalink / raw)
  To: Ankit Rastogi, poky

On Tue, 2018-06-19 at 05:16 +0000, Ankit Rastogi wrote:
> Can someone provide any pointers on how to export kernel specific
> headers to userspace?
> 
> I am getting below error while building our one of the component
> which requires kernel uapi headers.
> 
> Error Received:
>  /hdmi-capture/main.c:16:10: fatal error: linux/hdmi_info.h: No such
> file or directory
> > |  #include <linux/hdmi_info.h>
> > |           ^~~~~~~~~~~~~~~~~~~
> > | compilation terminated.
> 
> In yocto 2.5, userspace is boot strapped with linux-libc-headers
> package which uses a set of uapi headers from Linux kernel 4.15. Can
> someone suggest for custom kernels, how to expose uapi headers to
> userspace? Thus create a separate linux-apl-headers package with
> those files.

linux-libc-headers is really there to bootstrap the libc and toolchain,
not provide non-standard kernel headers to userspace. You likely need
to create your own recipe which installs the correct extra headers and
then have your code DEPEND on that recipe.

Cheers,

Richard


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

* Re: How to export kernel specific headers to userspace
  2018-06-19  5:16 How to export kernel specific headers to userspace Ankit Rastogi
  2018-06-19  5:19 ` Ankit Rastogi
  2018-06-19 13:22 ` Richard Purdie
@ 2018-06-19 13:44 ` Bas Mevissen
  2018-06-19 13:55   ` Bruce Ashfield
  2 siblings, 1 reply; 8+ messages in thread
From: Bas Mevissen @ 2018-06-19 13:44 UTC (permalink / raw)
  To: Ankit Rastogi; +Cc: poky

On 2018-06-19 07:16, Ankit Rastogi wrote:
> Hi,
> 
> Can someone provide any pointers on how to export kernel specific
> headers to userspace?
> 
> I am getting below error while building our one of the component which
> requires kernel uapi headers.
> 
> Error Received:
>  /hdmi-capture/main.c:16:10: fatal error: linux/hdmi_info.h: No such
> file or directory
>> |  #include <linux/hdmi_info.h>
>> |           ^~~~~~~~~~~~~~~~~~~
>> | compilation terminated.
> 
> In yocto 2.5, userspace is boot strapped with linux-libc-headers
> package which uses a set of uapi headers from Linux kernel 4.15. Can
> someone suggest for custom kernels, how to expose uapi headers to
> userspace? Thus create a separate linux-apl-headers package with those
> files.
> 

You might want to (re)move the linux-libc-headers package (header files) 
and install kernel-devsrc package. Then link the include directories 
from /usr/src/kernel/include/{asm*,linux} to /usr/include or modify your 
Makefile to get the linux include files from 
/usr/src/kernel/include/linux instead of /usr/include/linux.

Please note that the kernel-devsrc package is not without problems. 
Building it and manually installing it with --nodeps (for rpm) will do 
the trick. The package is due for replacement, see a thread on this 
started by me a few weeks ago.

Please also note that linux-libc-headers are cleaned-up versions of the 
4.15 kernel headers, so expect some rough edges.



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

* Re: How to export kernel specific headers to userspace
  2018-06-19 13:44 ` Bas Mevissen
@ 2018-06-19 13:55   ` Bruce Ashfield
  2018-06-19 14:06     ` Bas Mevissen
  0 siblings, 1 reply; 8+ messages in thread
From: Bruce Ashfield @ 2018-06-19 13:55 UTC (permalink / raw)
  To: Bas Mevissen, Ankit Rastogi; +Cc: poky

On 06/19/2018 09:44 AM, Bas Mevissen wrote:
> On 2018-06-19 07:16, Ankit Rastogi wrote:
>> Hi,
>>
>> Can someone provide any pointers on how to export kernel specific
>> headers to userspace?
>>
>> I am getting below error while building our one of the component which
>> requires kernel uapi headers.
>>
>> Error Received:
>>  /hdmi-capture/main.c:16:10: fatal error: linux/hdmi_info.h: No such
>> file or directory
>>> |  #include <linux/hdmi_info.h>
>>> |           ^~~~~~~~~~~~~~~~~~~
>>> | compilation terminated.
>>
>> In yocto 2.5, userspace is boot strapped with linux-libc-headers
>> package which uses a set of uapi headers from Linux kernel 4.15. Can
>> someone suggest for custom kernels, how to expose uapi headers to
>> userspace? Thus create a separate linux-apl-headers package with those
>> files.
>>
> 
> You might want to (re)move the linux-libc-headers package (header files) 
> and install kernel-devsrc package. Then link the include directories 
> from /usr/src/kernel/include/{asm*,linux} to /usr/include or modify your 
> Makefile to get the linux include files from 
> /usr/src/kernel/include/linux instead of /usr/include/linux.
> 
> Please note that the kernel-devsrc package is not without problems. 
> Building it and manually installing it with --nodeps (for rpm) will do 
> the trick. The package is due for replacement, see a thread on this 
> started by me a few weeks ago.
> 
> Please also note that linux-libc-headers are cleaned-up versions of the 
> 4.15 kernel headers, so expect some rough edges.

They aren't actually cleaned up at all. They are the standard uapi
installed headers from the latest kernel in a given yocto release.

They will be updated to 4.18 shortly, since I'm preparing the next
round of kernel updates (and devsrc resubmission).

Bruce



> 



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

* Re: How to export kernel specific headers to userspace
  2018-06-19 13:22 ` Richard Purdie
@ 2018-06-19 13:56   ` Bruce Ashfield
  0 siblings, 0 replies; 8+ messages in thread
From: Bruce Ashfield @ 2018-06-19 13:56 UTC (permalink / raw)
  To: Richard Purdie, Ankit Rastogi, poky

On 06/19/2018 09:22 AM, Richard Purdie wrote:
> On Tue, 2018-06-19 at 05:16 +0000, Ankit Rastogi wrote:
>> Can someone provide any pointers on how to export kernel specific
>> headers to userspace?
>>
>> I am getting below error while building our one of the component
>> which requires kernel uapi headers.
>>
>> Error Received:
>>   /hdmi-capture/main.c:16:10: fatal error: linux/hdmi_info.h: No such
>> file or directory
>>> |  #include <linux/hdmi_info.h>
>>> |           ^~~~~~~~~~~~~~~~~~~
>>> | compilation terminated.
>>
>> In yocto 2.5, userspace is boot strapped with linux-libc-headers
>> package which uses a set of uapi headers from Linux kernel 4.15. Can
>> someone suggest for custom kernels, how to expose uapi headers to
>> userspace? Thus create a separate linux-apl-headers package with
>> those files.
> 
> linux-libc-headers is really there to bootstrap the libc and toolchain,
> not provide non-standard kernel headers to userspace. You likely need
> to create your own recipe which installs the correct extra headers and
> then have your code DEPEND on that recipe.

Just adding a confirmation that this is what I've always done, and
what I recommend to anyone trying to do this.

The only additional caution/advice that I'd add, is that if you do
this, do not modify existing headers (since you are changing the
interface for a given version of the kernel), but additional/new
header files are fine.

Cheers,

Bruce

> 
> Cheers,
> 
> Richard
> 



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

* Re: How to export kernel specific headers to userspace
  2018-06-19 13:55   ` Bruce Ashfield
@ 2018-06-19 14:06     ` Bas Mevissen
  0 siblings, 0 replies; 8+ messages in thread
From: Bas Mevissen @ 2018-06-19 14:06 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Ankit Rastogi, poky

On 2018-06-19 15:55, Bruce Ashfield wrote:
> On 06/19/2018 09:44 AM, Bas Mevissen wrote:
>> On 2018-06-19 07:16, Ankit Rastogi wrote:
>>> Hi,
>>> 
>>> Can someone provide any pointers on how to export kernel specific
>>> headers to userspace?
>>> 
>>> I am getting below error while building our one of the component 
>>> which
>>> requires kernel uapi headers.
>>> 
>>> Error Received:
>>>  /hdmi-capture/main.c:16:10: fatal error: linux/hdmi_info.h: No such
>>> file or directory
>>>> |  #include <linux/hdmi_info.h>
>>>> |           ^~~~~~~~~~~~~~~~~~~
>>>> | compilation terminated.
>>> 
>>> In yocto 2.5, userspace is boot strapped with linux-libc-headers
>>> package which uses a set of uapi headers from Linux kernel 4.15. Can
>>> someone suggest for custom kernels, how to expose uapi headers to
>>> userspace? Thus create a separate linux-apl-headers package with 
>>> those
>>> files.
>>> 
>> 
>> You might want to (re)move the linux-libc-headers package (header 
>> files) and install kernel-devsrc package. Then link the include 
>> directories from /usr/src/kernel/include/{asm*,linux} to /usr/include 
>> or modify your Makefile to get the linux include files from 
>> /usr/src/kernel/include/linux instead of /usr/include/linux.
>> 
>> Please note that the kernel-devsrc package is not without problems. 
>> Building it and manually installing it with --nodeps (for rpm) will do 
>> the trick. The package is due for replacement, see a thread on this 
>> started by me a few weeks ago.
>> 
>> Please also note that linux-libc-headers are cleaned-up versions of 
>> the 4.15 kernel headers, so expect some rough edges.
> 
> They aren't actually cleaned up at all. They are the standard uapi
> installed headers from the latest kernel in a given yocto release.
> 

Oh, maybe I'm confused with the ones installed by Centos and Fedora. 
There the #ifdef __KERNEL__ (..) #endif stuff is removed from the uapi 
headers package.

> They will be updated to 4.18 shortly, since I'm preparing the next
> round of kernel updates


> (and devsrc resubmission).
> 

That would be really nice as it is not really usable at the moment.

> Bruce
> 
> 
> 
>> 


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

end of thread, other threads:[~2018-06-19 14:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-19  5:16 How to export kernel specific headers to userspace Ankit Rastogi
2018-06-19  5:19 ` Ankit Rastogi
2018-06-19  6:50   ` Khem Raj
2018-06-19 13:22 ` Richard Purdie
2018-06-19 13:56   ` Bruce Ashfield
2018-06-19 13:44 ` Bas Mevissen
2018-06-19 13:55   ` Bruce Ashfield
2018-06-19 14:06     ` Bas Mevissen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.