All of lore.kernel.org
 help / color / mirror / Atom feed
* Header files in /usr/include of rootfs
@ 2015-11-24 10:33 Andy Hung(洪翊桓_Pegatron)
  2015-11-24 13:25 ` Anders Darander
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Hung(洪翊桓_Pegatron) @ 2015-11-24 10:33 UTC (permalink / raw)
  To: yocto

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

Hi there,

I was trying to add some pre-built binaries and files by using a recipe.
The recipe has something like this:

SRC_URI = file://files<file:///\\files>
…
do_install() {
    install –d ${D}
}

FILES_${PN} = “/*”
ALLOW_EMPTY_${PN} = “1”
INSANE_SKIP_${PN} = “debug-files dev-so”

The result was all the binaries and files installed and packages are created,
But I also found kernel header files are also built in under /usr/include in rootfs image.
For my understanding those header files should be used if I want to develop/debug applications on the target device but it is not the case.

Also I noticed the use of INSANE_SKIP_${PN} so I check the usage of debug-files and dev-so,
And it turned out there are .debug folders in the WORKDIR/package folder so I thought that is why debug-files was used.

The questions are,
Why are those kernel header files installed in rootfs? How do I prevent this?
Why are there .debug in the package folder, it should only be in package –dbg folder, right?

I searched and figured maybe it has something to do with the do_install task but I can’t find a solution.
Any suggestions?

Thanks,
Andy

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

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

* Re: Header files in /usr/include of rootfs
  2015-11-24 10:33 Header files in /usr/include of rootfs Andy Hung(洪翊桓_Pegatron)
@ 2015-11-24 13:25 ` Anders Darander
  0 siblings, 0 replies; 6+ messages in thread
From: Anders Darander @ 2015-11-24 13:25 UTC (permalink / raw)
  To: yocto

* Andy Hung(洪翊桓_Pegatron) <Andy_Hung@pegatroncorp.com> [151124 11:35]:
> I was trying to add some pre-built binaries and files by using a recipe.
> The recipe has something like this:

> SRC_URI = file://files<file:///\\files>
> …
> do_install() {
>     install –d ${D}
> }

What files are you installing? How does those look like?

> FILES_${PN} = “/*”

Here you add say that anything that has been installed, but not put into
any other package, should be added to ${PN}. Is that what you want?

> ALLOW_EMPTY_${PN} = “1”

Remove this one unless ${PN} is going to be empty.

> INSANE_SKIP_${PN} = “debug-files dev-so”

These might be needed if you get certain QA-warnings/error without them.

> The result was all the binaries and files installed and packages are created,
> But I also found kernel header files are also built in under /usr/include in rootfs image.
> For my understanding those header files should be used if I want to develop/debug applications on the target device but it is not the case.

> Also I noticed the use of INSANE_SKIP_${PN} so I check the usage of debug-files and dev-so,
> And it turned out there are .debug folders in the WORKDIR/package folder so I thought that is why debug-files was used.

See answer below.

> The questions are,
> Why are those kernel header files installed in rootfs? How do I prevent thisa?

I assume that they aren't in the package you just created? Do you have
anything in your package that might have a dependency on the kernel
headers? Do you have anything in your IMAGE_FEATURES?

> Why are there .debug in the package folder, it should only be in package –dbg folder, right?

Where are the .debug directories located? You should add them to:
FILES_${PN}-dbg += "<location>/.debug"

Cheers,
Anders

-- 
Anders Darander, Senior System Architect
ChargeStorm AB / eStorm AB


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

* Re: Header files in /usr/include of rootfs
  2015-12-02  9:47 Andy Hung(洪翊桓_Pegatron)
@ 2015-12-02 13:13 ` Anders Darander
  0 siblings, 0 replies; 6+ messages in thread
From: Anders Darander @ 2015-12-02 13:13 UTC (permalink / raw)
  To: yocto

* Andy Hung(洪翊桓_Pegatron) <Andy_Hung@pegatroncorp.com> [151202 10:49]:

> Hi Anders,
> Thanks for your help, pls see updates below,

> > Message: 2
> > Date: Tue, 24 Nov 2015 14:25:14 +0100
> > From: Anders Darander <anders@chargestorm.se>
> > To: yocto@yoctoproject.org
> > Subject: Re: [yocto] Header files in /usr/include of rootfs
> > Message-ID: <20151124132514.GB2165@ad.chargestorm.se>
> > Content-Type: text/plain; charset=utf-8

> > * Andy Hung(???_Pegatron) <Andy_Hung@pegatroncorp.com> [151124 11:35]:
> >	Those sub-folders contains files such as executable binaries, config files, kernel modules, .so files ...
> >	All these files are actually built from the source code of a specific WiFi driver,
> >	what I want to do is installing all pre-built binaries/files into corresponding locations in rootfs.

> >There's no way to build this using OE?...

> >Though, sure, it's should work as long as the binaries and kernel modules actually loads and runs.

> > > FILES_${PN} = ?/*?

> The kernel headers wouldn't get installed if I removed my package.

Ok, then they get pulled in if your -dev package is installed. (And if
you have kernel modules in your package, that doesn't sound too
suprising).

> I looked at the packages-split folder again and I found besides the
> -dbg folder, .so libraries are in <package-name>-dev folder, I
> searched on the Yocto site and learned that packages are split by the
> variable PACKAGES defined in bitbake.conf and it turns out ${PN}-dbg ,
> ${PN}-dev are processed before ${PN}, so I modified my bb file by
> adding FILE_${PN}-dev = "" I rebuild the rootfs and I found the kernel
> headers are not installed then.

Ok. So something needs those .so-files, and if they're pacakged in your
-dev package, it'll be pulled in.

Normally, libraries are assumed to be versioned, i.e. library.so.X.Y,
with the library.so file being a symbolic link pointing to the versioned
ones. The link is packaged in -dev and the real libraries in the main
package.

If you have non-versioned libraries, then you need to ensure that those
are installed in you main package; just as you did.

> Here are the extra packages get installed before I add FILE_${PN}-dev
> = "" to the recipe,

> eglibc-extra-nss
> libc6-dev
> libthread-db1
> linux-libc-headers-dev
> merge-files-dev

> (merge-files is the name of my package)

> I think maybe I don't understand Yocto quite well,
> What is the rule for OE to install those dev packages?
> How do I decide which packages ( dbg, dev, doc, locale...) to get installed?

What get's installed is the packages that you specify, and all of their
runtime dependencies.

Cheers,
Anders

-- 
Anders Darander, Senior System Architect
ChargeStorm AB / eStorm AB


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

* Re: Header files in /usr/include of rootfs
@ 2015-12-02  9:47 Andy Hung(洪翊桓_Pegatron)
  2015-12-02 13:13 ` Anders Darander
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Hung(洪翊桓_Pegatron) @ 2015-12-02  9:47 UTC (permalink / raw)
  To: yocto

Hi Anders,
Thanks for your help, pls see updates below,

> Message: 2
> Date: Tue, 24 Nov 2015 14:25:14 +0100
> From: Anders Darander <anders@chargestorm.se>
> To: yocto@yoctoproject.org
> Subject: Re: [yocto] Header files in /usr/include of rootfs
> Message-ID: <20151124132514.GB2165@ad.chargestorm.se>
> Content-Type: text/plain; charset=utf-8

> * Andy Hung(???_Pegatron) <Andy_Hung@pegatroncorp.com> [151124 11:35]:
> > I was trying to add some pre-built binaries and files by using a recipe.
> > The recipe has something like this:

> > SRC_URI = file://files<file:///\\files> ?
> > do_install() {
> >     install ?d ${D}
> > }

>	> What files are you installing? How does those look like?
>	The content of the folder has those sub-folders, sbin, root, lib, etc.
>	Those sub-folders contains files such as executable binaries, config files, kernel modules, .so files ...
>	All these files are actually built from the source code of a specific WiFi driver,
>	what I want to do is installing all pre-built binaries/files into corresponding locations in rootfs.

>There's no way to build this using OE?...

>Though, sure, it's should work as long as the binaries and kernel modules actually loads and runs.

> > FILES_${PN} = ?/*?

>	> Here you add say that anything that has been installed, but not put into any other package, should be added to ${PN}. Is that what you want?
>	Yes, all files are installed in a package.

> > ALLOW_EMPTY_${PN} = ?1?

>	> Remove this one unless ${PN} is going to be empty.
>	This line is removed.

> > INSANE_SKIP_${PN} = ?debug-files dev-so?

>	> These might be needed if you get certain QA-warnings/error without them.
>	Yes, got some QA-warnings when building so I keep this.

> > The result was all the binaries and files installed and packages are 
> > created, But I also found kernel header files are also built in under /usr/include in rootfs image.
> > For my understanding those header files should be used if I want to develop/debug applications on the target device but it is not the case.

>Could you check if any -dev packages gets installed into the image? If so which one? Do anything like kernel-src or something similar gets installed?

> > Also I noticed the use of INSANE_SKIP_${PN} so I check the usage of 
> > debug-files and dev-so, And it turned out there are .debug folders in the WORKDIR/package folder so I thought that is why debug-files was used.

>	> See answer below.

> > The questions are,
> > Why are those kernel header files installed in rootfs? How do I prevent thisa?

>	> I assume that they aren't in the package you just created? Do you have anything in your package that might have a dependency on the kernel headers? Do you have anything in your IMAGE_FEATURES?
>	No, header files aren't in the package.
>	I checked the driver source code and many files include kernel headers like this  "#include <linux/xxx.h>" , is this what you meant by dependency on kernel headers?

Are the source code packaged installed and packaged?

Can you inspect the generated package ${PN}, and see what it's depencies are?

>	IMAGE_FEATURES was not used in the recipe file.

That would rather be in either local.conf, distro, or in your image.

> > Why are there .debug in the package folder, it should only be in package ?dbg folder, right?

>	> Where are the .debug directories located? You should add them to:
>	> FILES_${PN}-dbg += "<location>/.debug"
>	I add this line and rebuild but the result seems unchanged.
>	the .debug folders are located in 
>	${WORKDIR}/package
>	${WORKDIR}/package-split/<package name> - dbg

>I don't understand. Were the .debug directories located in packages-split/<package-name>-dbg? If so, that's where we want them.

>Which package do you add to your image? 
>If you remove that package, do you still get the kernel headers installed?

>Cheers,
>Anders

The kernel headers wouldn't get installed if I removed my package.
I looked at the packages-split folder again and I found besides the -dbg folder, .so libraries are in <package-name>-dev folder,
I searched on the Yocto site and learned that packages are split by the variable PACKAGES defined in bitbake.conf
and it turns out ${PN}-dbg , ${PN}-dev are processed before ${PN}, so I modified my bb file by adding FILE_${PN}-dev = ""
I rebuild the rootfs and I found the kernel headers are not installed then.

Here are the extra packages get installed before I add FILE_${PN}-dev = "" to the recipe,
eglibc-extra-nss
libc6-dev
libthread-db1
linux-libc-headers-dev
merge-files-dev

(merge-files is the name of my package)

I think maybe I don't understand Yocto quite well,
What is the rule for OE to install those dev packages?
How do I decide which packages ( dbg, dev, doc, locale...) to get installed?

Many thanks,
Andy

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

* Re: Header files in /usr/include of rootfs
  2015-11-25 10:51 Andy Hung(洪翊桓_Pegatron)
@ 2015-11-25 12:52 ` Anders Darander
  0 siblings, 0 replies; 6+ messages in thread
From: Anders Darander @ 2015-11-25 12:52 UTC (permalink / raw)
  To: yocto

* Andy Hung(洪翊桓_Pegatron) <Andy_Hung@pegatroncorp.com> [151125 11:53]:

> Message: 2
> Date: Tue, 24 Nov 2015 14:25:14 +0100
> From: Anders Darander <anders@chargestorm.se>
> To: yocto@yoctoproject.org
> Subject: Re: [yocto] Header files in /usr/include of rootfs
> Message-ID: <20151124132514.GB2165@ad.chargestorm.se>
> Content-Type: text/plain; charset=utf-8

> * Andy Hung(???_Pegatron) <Andy_Hung@pegatroncorp.com> [151124 11:35]:
> > I was trying to add some pre-built binaries and files by using a recipe.
> > The recipe has something like this:

> > SRC_URI = file://files<file:///\\files> ?
> > do_install() {
> >     install ?d ${D}
> > }

>	> What files are you installing? How does those look like?
>	The content of the folder has those sub-folders, sbin, root, lib, etc.
>	Those sub-folders contains files such as executable binaries, config files, kernel modules, .so files ...
>	All these files are actually built from the source code of a specific WiFi driver,
>	what I want to do is installing all pre-built binaries/files into corresponding locations in rootfs.

There's no way to build this using OE?...

Though, sure, it's should work as long as the binaries and kernel
modules actually loads and runs.

> > FILES_${PN} = ?/*?

>	> Here you add say that anything that has been installed, but not put into any other package, should be added to ${PN}. Is that what you want?
>	Yes, all files are installed in a package.

> > ALLOW_EMPTY_${PN} = ?1?

>	> Remove this one unless ${PN} is going to be empty.
>	This line is removed.

> > INSANE_SKIP_${PN} = ?debug-files dev-so?

>	> These might be needed if you get certain QA-warnings/error without them.
>	Yes, got some QA-warnings when building so I keep this.

> > The result was all the binaries and files installed and packages are 
> > created, But I also found kernel header files are also built in under /usr/include in rootfs image.
> > For my understanding those header files should be used if I want to develop/debug applications on the target device but it is not the case.

Could you check if any -dev packages gets installed into the image? If
so which one? Do anything like kernel-src or something similar gets
installed?

> > Also I noticed the use of INSANE_SKIP_${PN} so I check the usage of 
> > debug-files and dev-so, And it turned out there are .debug folders in the WORKDIR/package folder so I thought that is why debug-files was used.

>	> See answer below.

> > The questions are,
> > Why are those kernel header files installed in rootfs? How do I prevent thisa?

>	> I assume that they aren't in the package you just created? Do you have anything in your package that might have a dependency on the kernel headers? Do you have anything in your IMAGE_FEATURES?
>	No, header files aren't in the package.
>	I checked the driver source code and many files include kernel headers like this  "#include <linux/xxx.h>" , is this what you meant by dependency on kernel headers?

Are the source code packaged installed and packaged?

Can you inspect the generated package ${PN}, and see what it's depencies
are?

>	IMAGE_FEATURES was not used in the recipe file.

That would rather be in either local.conf, distro, or in your image.

> > Why are there .debug in the package folder, it should only be in package ?dbg folder, right?

>	> Where are the .debug directories located? You should add them to:
>	> FILES_${PN}-dbg += "<location>/.debug"
>	I add this line and rebuild but the result seems unchanged.
>	the .debug folders are located in 
>	${WORKDIR}/package
>	${WORKDIR}/package-split/<package name> - dbg

I don't understand. Were the .debug directories located in
packages-split/<package-name>-dbg? If so, that's where we want them.

Which package do you add to your image? 
If you remove that package, do you still get the kernel headers
installed?

Cheers,
Anders

-- 
Anders Darander, Senior System Architect
ChargeStorm AB / eStorm AB


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

* Re: Header files in /usr/include of rootfs
@ 2015-11-25 10:51 Andy Hung(洪翊桓_Pegatron)
  2015-11-25 12:52 ` Anders Darander
  0 siblings, 1 reply; 6+ messages in thread
From: Andy Hung(洪翊桓_Pegatron) @ 2015-11-25 10:51 UTC (permalink / raw)
  To: yocto

Message: 2
Date: Tue, 24 Nov 2015 14:25:14 +0100
From: Anders Darander <anders@chargestorm.se>
To: yocto@yoctoproject.org
Subject: Re: [yocto] Header files in /usr/include of rootfs
Message-ID: <20151124132514.GB2165@ad.chargestorm.se>
Content-Type: text/plain; charset=utf-8

* Andy Hung(???_Pegatron) <Andy_Hung@pegatroncorp.com> [151124 11:35]:
> I was trying to add some pre-built binaries and files by using a recipe.
> The recipe has something like this:

> SRC_URI = file://files<file:///\\files> ?
> do_install() {
>     install ?d ${D}
> }

	> What files are you installing? How does those look like?
	The content of the folder has those sub-folders, sbin, root, lib, etc.
	Those sub-folders contains files such as executable binaries, config files, kernel modules, .so files ...
	All these files are actually built from the source code of a specific WiFi driver,
	what I want to do is installing all pre-built binaries/files into corresponding locations in rootfs.
	 
> FILES_${PN} = ?/*?

	> Here you add say that anything that has been installed, but not put into any other package, should be added to ${PN}. Is that what you want?
	Yes, all files are installed in a package.

> ALLOW_EMPTY_${PN} = ?1?

	> Remove this one unless ${PN} is going to be empty.
	This line is removed.

> INSANE_SKIP_${PN} = ?debug-files dev-so?

	> These might be needed if you get certain QA-warnings/error without them.
	Yes, got some QA-warnings when building so I keep this.
 
> The result was all the binaries and files installed and packages are 
> created, But I also found kernel header files are also built in under /usr/include in rootfs image.
> For my understanding those header files should be used if I want to develop/debug applications on the target device but it is not the case.

> Also I noticed the use of INSANE_SKIP_${PN} so I check the usage of 
> debug-files and dev-so, And it turned out there are .debug folders in the WORKDIR/package folder so I thought that is why debug-files was used.

	> See answer below.

> The questions are,
> Why are those kernel header files installed in rootfs? How do I prevent thisa?

	> I assume that they aren't in the package you just created? Do you have anything in your package that might have a dependency on the kernel headers? Do you have anything in your IMAGE_FEATURES?
	No, header files aren't in the package.
	I checked the driver source code and many files include kernel headers like this  "#include <linux/xxx.h>" , is this what you meant by dependency on kernel headers?
	IMAGE_FEATURES was not used in the recipe file.

> Why are there .debug in the package folder, it should only be in package ?dbg folder, right?

	> Where are the .debug directories located? You should add them to:
	> FILES_${PN}-dbg += "<location>/.debug"
	I add this line and rebuild but the result seems unchanged.
 	the .debug folders are located in 
	${WORKDIR}/package
	${WORKDIR}/package-split/<package name> - dbg

	Thanks,
	Andy

	> Cheers,
	> Anders

	> --
	> Anders Darander, Senior System Architect ChargeStorm AB / eStorm AB



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

end of thread, other threads:[~2015-12-02 13:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-24 10:33 Header files in /usr/include of rootfs Andy Hung(洪翊桓_Pegatron)
2015-11-24 13:25 ` Anders Darander
2015-11-25 10:51 Andy Hung(洪翊桓_Pegatron)
2015-11-25 12:52 ` Anders Darander
2015-12-02  9:47 Andy Hung(洪翊桓_Pegatron)
2015-12-02 13:13 ` Anders Darander

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.