All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass
@ 2021-01-14  8:06 Diego Sueiro
  2021-01-14  8:06 ` [PATCH 2/2] u-boot: Use intermediate-deploy.bbclass to share artifacts Diego Sueiro
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Diego Sueiro @ 2021-01-14  8:06 UTC (permalink / raw)
  To: openembedded-core; +Cc: richard.purdie, Diego Sueiro

The intermediate-deploy class is to be inherited by recipes that
install intermediate artifacts which are not present in the filesystem
to be further processed by other recipes.

The INTERMEDIATE_DEPLOY_DIRS variable is a space separated list of dirnames
from ${D} which include the intermediate artifacts.

Change-Id: I314987587c1cf0e4cdb28fbf11463f1feb37504b
---
 meta/classes/intermediate-deploy.bbclass | 25 ++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 meta/classes/intermediate-deploy.bbclass

diff --git a/meta/classes/intermediate-deploy.bbclass b/meta/classes/intermediate-deploy.bbclass
new file mode 100644
index 0000000000..4b53ffbf0f
--- /dev/null
+++ b/meta/classes/intermediate-deploy.bbclass
@@ -0,0 +1,25 @@
+# This class is to be inherited by recipes that install intermediate artifacts
+# which are not present in the filesystem to be further processed by other
+# recipes
+
+# Space separated list of dirnames from ${D}
+INTERMEDIATE_DEPLOY_DIRS ?= ""
+do_populate_sysroot[vardeps] += "${INTERMEDIATE_DEPLOY_DIRS}"
+
+SYSROOT_PREPROCESS_FUNCS += "copy_to_intermediate_deploy_sysroot"
+
+copy_to_intermediate_deploy_sysroot() {
+    if [ -n "${INTERMEDIATE_DEPLOY_DIRS}" ]; then
+        dest="${SYSROOT_DESTDIR}/intermediate-deploy"
+        mkdir -p "$dest"
+
+        for dir in ${INTERMEDIATE_DEPLOY_DIRS}; do
+            dir="${dir%/}"
+            dir="${dir#/}"
+            src="${D}/${dir}"
+            if [ -d "$src" ]; then
+                cp -a "$src" "$dest"
+            fi
+        done
+    fi
+}
--
2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* [PATCH 2/2] u-boot: Use intermediate-deploy.bbclass to share artifacts
  2021-01-14  8:06 [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass Diego Sueiro
@ 2021-01-14  8:06 ` Diego Sueiro
  2021-01-14  8:07 ` [PATCH] ref-manual: Add intermediate-deploy.bbclass documentation Diego Sueiro
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Diego Sueiro @ 2021-01-14  8:06 UTC (permalink / raw)
  To: openembedded-core; +Cc: richard.purdie, Diego Sueiro

By inheriting the intermediate-deploy.bbclass the installed binaries in /boot
can be used by dependant recipes for post-processing via
DEPENDS and ${RECIPE_SYSROOT}/intermediate-deploy/boot/u-boot.bin instead of
task[depends]= "u-boot:do_deploy" and ${DEPLOY_DIR_IMAGE}/u-boot.bin.

Change-Id: I0cf02eb0ff54b636f57c7ce752366d67164fa1e0
---
 meta/recipes-bsp/u-boot/u-boot.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
index 251178db33..15554387ce 100644
--- a/meta/recipes-bsp/u-boot/u-boot.inc
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -7,6 +7,9 @@ DEPENDS += "kern-tools-native"

 inherit uboot-config uboot-extlinux-config uboot-sign deploy cml1 python3native

+inherit intermediate-deploy
+INTERMEDIATE_DEPLOY_DIRS = "/boot"
+
 DEPENDS += "swig-native"

 EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1'
--
2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* [PATCH] ref-manual: Add intermediate-deploy.bbclass documentation
  2021-01-14  8:06 [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass Diego Sueiro
  2021-01-14  8:06 ` [PATCH 2/2] u-boot: Use intermediate-deploy.bbclass to share artifacts Diego Sueiro
@ 2021-01-14  8:07 ` Diego Sueiro
  2021-01-14 11:56 ` [OE-core] [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass Otavio Salvador
  2021-01-14 12:04 ` Richard Purdie
  3 siblings, 0 replies; 9+ messages in thread
From: Diego Sueiro @ 2021-01-14  8:07 UTC (permalink / raw)
  To: docs; +Cc: richard.purdie, Diego Sueiro

Signed-off-by: Diego Sueiro <diego.sueiro@arm.com>
---
 documentation/ref-manual/classes.rst | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index a152dcac77..e0834a275c 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -1325,6 +1325,17 @@ of symbolic links in ``/etc/rc?.d/`` within an image based on
 dependencies specified by LSB headers in the ``init.d`` scripts
 themselves.

+.. _ref-classes-intermediate-deploy:
+
+``intermediate-deploy.bbclass``
+==============================
+
+The ``intermediate-deploy`` class is to be inherited by recipes that
+install intermediate artifacts which are not present in the filesystem
+to be further processed by other recipes. The INTERMEDIATE_DEPLOY_DIRS
+variable is a space separated list of dirnames from ${D} which include
+the intermediate artifacts.
+
 .. _ref-classes-kernel:

 ``kernel.bbclass``
--
2.17.1

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [OE-core] [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass
  2021-01-14  8:06 [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass Diego Sueiro
  2021-01-14  8:06 ` [PATCH 2/2] u-boot: Use intermediate-deploy.bbclass to share artifacts Diego Sueiro
  2021-01-14  8:07 ` [PATCH] ref-manual: Add intermediate-deploy.bbclass documentation Diego Sueiro
@ 2021-01-14 11:56 ` Otavio Salvador
  2021-01-14 12:45   ` Diego Sueiro
  2021-01-14 12:04 ` Richard Purdie
  3 siblings, 1 reply; 9+ messages in thread
From: Otavio Salvador @ 2021-01-14 11:56 UTC (permalink / raw)
  To: Diego Sueiro
  Cc: Patches and discussions about the oe-core layer, Purdie, Richard

Em qui., 14 de jan. de 2021 às 05:06, Diego Sueiro
<diego.sueiro@arm.com> escreveu:
>
> The intermediate-deploy class is to be inherited by recipes that
> install intermediate artifacts which are not present in the filesystem
> to be further processed by other recipes.
>
> The INTERMEDIATE_DEPLOY_DIRS variable is a space separated list of dirnames
> from ${D} which include the intermediate artifacts.
>
> Change-Id: I314987587c1cf0e4cdb28fbf11463f1feb37504b
...
> +        for dir in ${INTERMEDIATE_DEPLOY_DIRS}; do
> +            dir="${dir%/}"
> +            dir="${dir#/}"

Does this work with dash? I believe this is bashism.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750

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

* Re: [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass
  2021-01-14  8:06 [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass Diego Sueiro
                   ` (2 preceding siblings ...)
  2021-01-14 11:56 ` [OE-core] [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass Otavio Salvador
@ 2021-01-14 12:04 ` Richard Purdie
  2021-01-14 13:06   ` [OE-core] " Diego Sueiro
  3 siblings, 1 reply; 9+ messages in thread
From: Richard Purdie @ 2021-01-14 12:04 UTC (permalink / raw)
  To: Diego Sueiro, openembedded-core

On Thu, 2021-01-14 at 08:06 +0000, Diego Sueiro wrote:
> The intermediate-deploy class is to be inherited by recipes that
> install intermediate artifacts which are not present in the filesystem
> to be further processed by other recipes.
> 
> The INTERMEDIATE_DEPLOY_DIRS variable is a space separated list of dirnames
> from ${D} which include the intermediate artifacts.
> 
> Change-Id: I314987587c1cf0e4cdb28fbf11463f1feb37504b
> ---
>  meta/classes/intermediate-deploy.bbclass | 25 ++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>  create mode 100644 meta/classes/intermediate-deploy.bbclass

I think I should have been clearer about what I was thinking, sorry.

I was wondering about an "intermediate-deploy" directory within the
existing SYSROOT_DIRS, so the sysroot could contain an "intermediate-
deploy/boot/" and "intermediate-deploy/firmware".

I'm not particularly liking the name. Maybe "unpackaged/boot" or "non-
target/boot"? I'm open to ideas.

The idea is to make it really clear these are files which are not part
of the target rootfs though...

Cheers,

Richard


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

* Re: [OE-core] [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass
  2021-01-14 11:56 ` [OE-core] [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass Otavio Salvador
@ 2021-01-14 12:45   ` Diego Sueiro
  2021-01-14 15:32     ` Christopher Larson
  0 siblings, 1 reply; 9+ messages in thread
From: Diego Sueiro @ 2021-01-14 12:45 UTC (permalink / raw)
  To: Otavio Salvador
  Cc: Patches and discussions about the oe-core layer, Purdie, Richard

>-----Original Message-----
>From: Otavio Salvador <otavio.salvador@ossystems.com.br>
>Sent: 14 January 2021 11:57
>To: Diego Sueiro <Diego.Sueiro@arm.com>
>Cc: Patches and discussions about the oe-core layer <openembedded-
>core@lists.openembedded.org>; Purdie, Richard
><richard.purdie@linuxfoundation.org>
>Subject: Re: [OE-core] [PATCH 1/2] classes: Introduce intermediate-
>deploy.bbclass
>
>Em qui., 14 de jan. de 2021 às 05:06, Diego Sueiro <diego.sueiro@arm.com>
>escreveu:
>>
>> The intermediate-deploy class is to be inherited by recipes that
>> install intermediate artifacts which are not present in the filesystem
>> to be further processed by other recipes.
>>
>> The INTERMEDIATE_DEPLOY_DIRS variable is a space separated list of
>> dirnames from ${D} which include the intermediate artifacts.
>>
>> Change-Id: I314987587c1cf0e4cdb28fbf11463f1feb37504b
>...
>> +        for dir in ${INTERMEDIATE_DEPLOY_DIRS}; do
>> +            dir="${dir%/}"
>> +            dir="${dir#/}"
>
>Does this work with dash? I believe this is bashism.
>

I think so since on my host I have "/bin/sh -> dash".
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [OE-core] [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass
  2021-01-14 12:04 ` Richard Purdie
@ 2021-01-14 13:06   ` Diego Sueiro
  2021-01-14 13:27     ` Richard Purdie
  0 siblings, 1 reply; 9+ messages in thread
From: Diego Sueiro @ 2021-01-14 13:06 UTC (permalink / raw)
  To: richard.purdie, openembedded-core

>-----Original Message-----
>From: openembedded-core@lists.openembedded.org <openembedded-
>core@lists.openembedded.org> On Behalf Of Richard Purdie via
>lists.openembedded.org
>Sent: 14 January 2021 12:04
>To: Diego Sueiro <Diego.Sueiro@arm.com>; openembedded-
>core@lists.openembedded.org
>Subject: Re: [OE-core] [PATCH 1/2] classes: Introduce intermediate-
>deploy.bbclass
>
>On Thu, 2021-01-14 at 08:06 +0000, Diego Sueiro wrote:
>> The intermediate-deploy class is to be inherited by recipes that
>> install intermediate artifacts which are not present in the filesystem
>> to be further processed by other recipes.
>>
>> The INTERMEDIATE_DEPLOY_DIRS variable is a space separated list of
>> dirnames from ${D} which include the intermediate artifacts.
>>
>> Change-Id: I314987587c1cf0e4cdb28fbf11463f1feb37504b
>> ---
>>  meta/classes/intermediate-deploy.bbclass | 25
>> ++++++++++++++++++++++++
>>  1 file changed, 25 insertions(+)
>>  create mode 100644 meta/classes/intermediate-deploy.bbclass
>
>I think I should have been clearer about what I was thinking, sorry.
>
>I was wondering about an "intermediate-deploy" directory within the existing
>SYSROOT_DIRS, so the sysroot could contain an "intermediate- deploy/boot/"
>and "intermediate-deploy/firmware".
>

Just trying to see if I got it right this time.
Are you proposing to move `${D}/boot` to `${D}/intermediate-deploy/boot` and
have SYSROOT_DIRS += "/intermediate-deploy "?

But, If it is just a copy having within ${D} , I'll have to have
`PACKAGES_${PN} += "${PN}-intermediate-deploy"` and
FILES_${PN}-intermediate-deploy = "/intermediate-deploy" to no fail with
"installed-vs-shipped" in the package qa.

The way this class is implemented is just copying the dirs from $D listed in
$INTERMEDIATE_DEPLOY_DIRS to the $SYSROOT_DESTDIR and can't use SYSROOT_DIRS
variable directly because the sysroot_stage_all function copies from $D.


>I'm not particularly liking the name. Maybe "unpackaged/boot" or "non-
>target/boot"? I'm open to ideas.
>
>The idea is to make it really clear these are files which are not part of the
>target rootfs though...
>

I also don’t like this name either. Maybe "non-filesystem/boot"?

Cheers,
Diego Sueiro

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

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

* Re: [OE-core] [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass
  2021-01-14 13:06   ` [OE-core] " Diego Sueiro
@ 2021-01-14 13:27     ` Richard Purdie
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Purdie @ 2021-01-14 13:27 UTC (permalink / raw)
  To: Diego Sueiro, openembedded-core

On Thu, 2021-01-14 at 13:06 +0000, Diego Sueiro wrote:
> 
> Just trying to see if I got it right this time.
> Are you proposing to move `${D}/boot` to `${D}/intermediate-
> deploy/boot` and
> have SYSROOT_DIRS += "/intermediate-deploy "?

Yes.

> But, If it is just a copy having within ${D} , I'll have to have
> `PACKAGES_${PN} += "${PN}-intermediate-deploy"` and
> FILES_${PN}-intermediate-deploy = "/intermediate-deploy" to no fail
> with "installed-vs-shipped" in the package qa.

Or, we have perform_packagecopy() just delete/skip it. That would mean
it won't make it into the packages.

(we could also implement as a PACKAGE_PREPROCESS_FUNC but I'd probably
just add to the above function instead?)


> The way this class is implemented is just copying the dirs from $D
> listed in
> $INTERMEDIATE_DEPLOY_DIRS to the $SYSROOT_DESTDIR and can't use
> SYSROOT_DIRS
> variable directly because the sysroot_stage_all function copies from
> $D.
> 
> 
> > I'm not particularly liking the name. Maybe "unpackaged/boot" or
> > "non-
> > target/boot"? I'm open to ideas.
> > 
> > The idea is to make it really clear these are files which are not
> > part of the
> > target rootfs though...
> 
> I also don’t like this name either. Maybe "non-filesystem/boot"?

Maybe sysroot-only/boot/ ?

Cheers,

Richard


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

* Re: [OE-core] [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass
  2021-01-14 12:45   ` Diego Sueiro
@ 2021-01-14 15:32     ` Christopher Larson
  0 siblings, 0 replies; 9+ messages in thread
From: Christopher Larson @ 2021-01-14 15:32 UTC (permalink / raw)
  To: Diego Sueiro
  Cc: Otavio Salvador, Patches and discussions about the oe-core layer,
	Purdie, Richard

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

On Thu, Jan 14, 2021 at 5:45 AM Diego Sueiro <diego.sueiro@arm.com> wrote:

> >-----Original Message-----
> >From: Otavio Salvador <otavio.salvador@ossystems.com.br>
> >Sent: 14 January 2021 11:57
> >To: Diego Sueiro <Diego.Sueiro@arm.com>
> >Cc: Patches and discussions about the oe-core layer <openembedded-
> >core@lists.openembedded.org>; Purdie, Richard
> ><richard.purdie@linuxfoundation.org>
> >Subject: Re: [OE-core] [PATCH 1/2] classes: Introduce intermediate-
> >deploy.bbclass
> >
> >Em qui., 14 de jan. de 2021 às 05:06, Diego Sueiro <diego.sueiro@arm.com>
> >escreveu:
> >>
> >> The intermediate-deploy class is to be inherited by recipes that
> >> install intermediate artifacts which are not present in the filesystem
> >> to be further processed by other recipes.
> >>
> >> The INTERMEDIATE_DEPLOY_DIRS variable is a space separated list of
> >> dirnames from ${D} which include the intermediate artifacts.
> >>
> >> Change-Id: I314987587c1cf0e4cdb28fbf11463f1feb37504b
> >...
> >> +        for dir in ${INTERMEDIATE_DEPLOY_DIRS}; do
> >> +            dir="${dir%/}"
> >> +            dir="${dir#/}"
> >
> >Does this work with dash? I believe this is bashism.
> >
>
> I think so since on my host I have "/bin/sh -> dash".
>

This is not a bashism, but is POSIX. See
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
at the end of the parameter expansion section.
-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics

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

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

end of thread, other threads:[~2021-01-14 15:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14  8:06 [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass Diego Sueiro
2021-01-14  8:06 ` [PATCH 2/2] u-boot: Use intermediate-deploy.bbclass to share artifacts Diego Sueiro
2021-01-14  8:07 ` [PATCH] ref-manual: Add intermediate-deploy.bbclass documentation Diego Sueiro
2021-01-14 11:56 ` [OE-core] [PATCH 1/2] classes: Introduce intermediate-deploy.bbclass Otavio Salvador
2021-01-14 12:45   ` Diego Sueiro
2021-01-14 15:32     ` Christopher Larson
2021-01-14 12:04 ` Richard Purdie
2021-01-14 13:06   ` [OE-core] " Diego Sueiro
2021-01-14 13:27     ` Richard Purdie

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.