All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Geoffrey Levillain <geoffrey.levillain@smile.fr>,
	openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v2 2/3] image_overlay.bbclass: Add possibility to install overlays to image
Date: Wed, 15 Feb 2017 20:44:34 -0800	[thread overview]
Message-ID: <1487220274.4999.5.camel@linuxfoundation.org> (raw)
In-Reply-To: <20170215173323.10466-3-geoffrey.levillain@smile.fr>

On Wed, 2017-02-15 at 18:33 +0100, Geoffrey Levillain wrote:
> There is often a need to add configuration files specific to an
> image,
> to simplify this process we can use a task.
> 
> Fetching is set as noexec for images, but there is a need to fetch
> files
> here. This class permit to use do_fetch, do_unpack and do_patch in
> order
> to get your image-specific overlays to install.
> 
> Signed-off-by: Geoffrey Levillain <geoffrey.levillain@smile.fr>
> ---
>  meta/classes/image_overlay.bbclass | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
>  create mode 100644 meta/classes/image_overlay.bbclass
> 
> diff --git a/meta/classes/image_overlay.bbclass
> b/meta/classes/image_overlay.bbclass
> new file mode 100644
> index 0000000000..93c1ea6f9f
> --- /dev/null
> +++ b/meta/classes/image_overlay.bbclass
> @@ -0,0 +1,24 @@
> +# Enable SRC_URI for images and use it to install overlays
> +
> +# Let these task be executed to fetch overlay
> +unset do_fetch[noexec]
> +unset do_unpack[noexec]
> +unset do_patch[noexec]

At the same time as you're submitting this, I'm seriously considering a
change where instead of noexec, we'd deltask these tasks. The reason
being I'm not very keen on subverting the package manager and I'm not
convinced this is a particularly desirable way to be altering the
rootfs.

> +# Add a task to install the overlay
> +# (content of folders listed in OVERLAY_ROOT_DIRS is copied in
> rootfs)
> +addtask install_overlay after do_unpack do_patch do_rootfs before
> do_image
> +fakeroot do_install_overlay() {
> +    for dir in ${OVERLAY_ROOT_DIRS}; do
> +        if [ ! -d "${WORKDIR}/${dir}" ] ; then
> +            bbfatal "${dir} not found, please check your
> OVERLAY_ROOT_DIRS and SRC_URI variables."
> +        fi
> +        cp -dr --no-preserve=ownership "${WORKDIR}/${dir}"/*
> "${IMAGE_ROOTFS}"
> +    done
> +}
> +do_install_overlay[depends] += "virtual/fakeroot-
> native:do_populate_sysroot"
> +do_install_overlay[dirs] = "${IMAGE_ROOTFS}"
> +do_install_overlay[umask] = "022"
> +do_install_overlay[vardeps] += "OVERLAY_ROOT_DIRS"
> +
> +SSTATETASKS += "do_install_overlay"

Except this isn't an sstate task? There is no setscene task variant of
the main task. There are no sstate variables set either...

Cheers,

Richard





  reply	other threads:[~2017-02-16  4:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-15 17:33 [PATCH v2 0/3] Permit to install files from an overlay in images recipes Geoffrey Levillain
2017-02-15 17:33 ` [PATCH v2 1/3] image.bbclass: No need to force image licence on MIT Geoffrey Levillain
2017-02-15 17:33 ` [PATCH v2 2/3] image_overlay.bbclass: Add possibility to install overlays to image Geoffrey Levillain
2017-02-16  4:44   ` Richard Purdie [this message]
2017-02-17 10:42     ` Jérémy Rosen
2017-02-15 17:33 ` [PATCH v2 3/3] rm_work.bbclass: Do not remove fetching and install_overlay stamps Geoffrey Levillain
2017-02-16  4:46   ` Richard Purdie
2017-02-16  2:18 ` [PATCH v2 0/3] Permit to install files from an overlay in images recipes Gary Thomas
2017-02-17 10:45   ` Jérémy Rosen

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=1487220274.4999.5.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=geoffrey.levillain@smile.fr \
    --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 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.