All of lore.kernel.org
 help / color / mirror / Atom feed
* How to share files between recipes?
@ 2019-09-19 13:39 Patrick Doyle
  2019-09-19 13:45 ` Maciej Pijanowski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Patrick Doyle @ 2019-09-19 13:39 UTC (permalink / raw)
  To: Yocto discussion list

I have a set of data files (cryptographic keys) that I would like to
share among several recipes in my build.  They won't go into the
rootfs, but they will be used by multiple recipes that construct the
rootfs.  So, to the best of my understanding, it seems like I should
put them in sysroot and somehow access them from there.

I constructed the following recipe:
SUMMARY = "Development keys used by my image"
DESCRIPTION = "Install the development keys in the sysroot so that they \
can be referenced by other recipes."

LICENSE = "Proprietary"
LIC_FILES_CHKSUM =
"file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28"

SRC_URI = "file://keys"

do_install() {
    install -d ${D}/${datadir}
    install -m 755 -d ${WORKDIR}/keys ${D}/${datadir}
}

FILES_${PN} += "${datadir}/keys/"

But when I attempt to bitbake this recipe, I get the following error:
ERROR: development-keys-1.0-r0 do_package: QA Issue: development-keys:
Files/directories were installed but not shipped in any package:
  /usr
  /usr/share

Ummm.... I don't put anything in /usr or /usr/share.
I don't inherit from anything (other than base.bbclass) that puts
anything in /usr or /usr/share.

Does base.bbclass put anything in /usr or /usr/share?
Why?
I suppose I could follow the advice given in the error message and

rm -rf ${D}/usr

in my do_install() task, but I'd like to understand why and how those
directories are being created in the first place?

--wpd


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

* Re: How to share files between recipes?
  2019-09-19 13:39 How to share files between recipes? Patrick Doyle
@ 2019-09-19 13:45 ` Maciej Pijanowski
  2019-09-19 13:48 ` Mikko.Rapeli
  2019-09-19 14:00 ` Patrick Doyle
  2 siblings, 0 replies; 5+ messages in thread
From: Maciej Pijanowski @ 2019-09-19 13:45 UTC (permalink / raw)
  To: Patrick Doyle, Yocto discussion list


[-- Attachment #1.1: Type: text/plain, Size: 1747 bytes --]


On 19.09.2019 15:39, Patrick Doyle wrote:
> I have a set of data files (cryptographic keys) that I would like to
> share among several recipes in my build.  They won't go into the
> rootfs, but they will be used by multiple recipes that construct the
> rootfs.  So, to the best of my understanding, it seems like I should
> put them in sysroot and somehow access them from there.
>
> I constructed the following recipe:
> SUMMARY = "Development keys used by my image"
> DESCRIPTION = "Install the development keys in the sysroot so that they \
> can be referenced by other recipes."
>
> LICENSE = "Proprietary"
> LIC_FILES_CHKSUM =
> "file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28"
>
> SRC_URI = "file://keys"
>
> do_install() {
>     install -d ${D}/${datadir}
>     install -m 755 -d ${WORKDIR}/keys ${D}/${datadir}
> }
>
> FILES_${PN} += "${datadir}/keys/"
>
> But when I attempt to bitbake this recipe, I get the following error:
> ERROR: development-keys-1.0-r0 do_package: QA Issue: development-keys:
> Files/directories were installed but not shipped in any package:
>   /usr
>   /usr/share
>
> Ummm.... I don't put anything in /usr or /usr/share.
> I don't inherit from anything (other than base.bbclass) that puts
> anything in /usr or /usr/share.
You do. datadir is /usr/share.
>
> Does base.bbclass put anything in /usr or /usr/share?
> Why?
> I suppose I could follow the advice given in the error message and
>
> rm -rf ${D}/usr
>
> in my do_install() task, but I'd like to understand why and how those
> directories are being created in the first place?
>
> --wpd

-- 
Maciej Pijanowski
Embedded Systems Engineer
https://3mdeb.com | @3mdeb_com



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 817 bytes --]

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

* Re: How to share files between recipes?
  2019-09-19 13:39 How to share files between recipes? Patrick Doyle
  2019-09-19 13:45 ` Maciej Pijanowski
@ 2019-09-19 13:48 ` Mikko.Rapeli
  2019-09-19 14:03   ` Patrick Doyle
  2019-09-19 14:00 ` Patrick Doyle
  2 siblings, 1 reply; 5+ messages in thread
From: Mikko.Rapeli @ 2019-09-19 13:48 UTC (permalink / raw)
  To: wpdster; +Cc: yocto

On Thu, Sep 19, 2019 at 09:39:32AM -0400, Patrick Doyle wrote:
> I have a set of data files (cryptographic keys) that I would like to
> share among several recipes in my build.  They won't go into the
> rootfs, but they will be used by multiple recipes that construct the
> rootfs.  So, to the best of my understanding, it seems like I should
> put them in sysroot and somehow access them from there.

One possibility is to provide these keys as host native tools and data to
build of target recipes. This makes the files available in the build environment
but does not expose them to target.

Create a -native recipe which has and installs the files and use via DEPENDS to
the -native recipe.

Hope this helps,

-Mikko

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

* Re: How to share files between recipes?
  2019-09-19 13:39 How to share files between recipes? Patrick Doyle
  2019-09-19 13:45 ` Maciej Pijanowski
  2019-09-19 13:48 ` Mikko.Rapeli
@ 2019-09-19 14:00 ` Patrick Doyle
  2 siblings, 0 replies; 5+ messages in thread
From: Patrick Doyle @ 2019-09-19 14:00 UTC (permalink / raw)
  To: Yocto discussion list

On Thu, Sep 19, 2019 at 9:39 AM Patrick Doyle <wpdster@gmail.com> wrote:

> do_install() {
>     install -d ${D}/${datadir}
>     install -m 755 -d ${WORKDIR}/keys ${D}/${datadir}
> }
>
Oops... I just noticed the typo(s) in my recipe... I wasn't installing
the contents of my ${WORKDIR} in ${D}${datadir}/keys the way I thought
I was... all I was doing was creating empty directories.

That's why I ask questions like this... so that right after I ask
them, I can find the blatantly stupid mistake I made in my code.

Thanks for playing!

--wpd


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

* Re: How to share files between recipes?
  2019-09-19 13:48 ` Mikko.Rapeli
@ 2019-09-19 14:03   ` Patrick Doyle
  0 siblings, 0 replies; 5+ messages in thread
From: Patrick Doyle @ 2019-09-19 14:03 UTC (permalink / raw)
  To: Mikko.Rapeli; +Cc: Yocto discussion list

On Thu, Sep 19, 2019 at 9:48 AM <Mikko.Rapeli@bmw.de> wrote:
> One possibility is to provide these keys as host native tools and data to
> build of target recipes. This makes the files available in the build environment
> but does not expose them to target.
>
> Create a -native recipe which has and installs the files and use via DEPENDS to
> the -native recipe.
>
> Hope this helps,
>
> -Mikko
Thank you.  That feels like the better answer all around.  Ultimately,
that's where I was going, but hadn't thought of the fact that I only
really need this data on my native build environment.

--wpd


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

end of thread, other threads:[~2019-09-19 15:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-19 13:39 How to share files between recipes? Patrick Doyle
2019-09-19 13:45 ` Maciej Pijanowski
2019-09-19 13:48 ` Mikko.Rapeli
2019-09-19 14:03   ` Patrick Doyle
2019-09-19 14:00 ` Patrick Doyle

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.