<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<br>
<div class="moz-cite-prefix">On 16/02/2017 05:44, Richard Purdie
wrote:<br>
</div>
<blockquote cite="mid:1487220274.4999.5.camel@linuxfoundation.org"
type="cite">
<pre wrap="">On Wed, 2017-02-15 at 18:33 +0100, Geoffrey Levillain wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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 <a class="moz-txt-link-rfc2396E" href="mailto:geoffrey.levillain@smile.fr"><geoffrey.levillain@smile.fr></a>
---
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]
</pre>
</blockquote>
<pre wrap="">
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.
</pre>
</blockquote>
There are various files in images that are provided by the package
manager and that are ok to modify. most files in /etc are in that
category.<br>
<br>
The idea here is to be able to have generic (image independant)
packages, but to override the package configuration with custom ones
at image-generation time.<br>
<br>
on a normal (desktop) distribution, the user writes his
configuration files, but in a deep-embedded useage, there is no
user. <br>
<br>
A bbappend (overriding the config file at package-build time) would
seem a better solution at first, but this doesn't work because it
forces to have a different package for each image type. Again we are
trying to particularize each image, while keeping the distribution
itself generic.<br>
<br>
I hope this helps clarify why we do this at the image level and not
the package. packages are shared between images, but configuration
is altered per-image.<br>
<br>
Jérémy<br>
<br>
<blockquote cite="mid:1487220274.4999.5.camel@linuxfoundation.org"
type="cite">
<pre wrap="">
</pre>
<blockquote type="cite">
<pre wrap="">+# 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"
</pre>
</blockquote>
<pre wrap="">
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
</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<div style="border-bottom: 1px solid #ccd4d7; margin:0 10px 10px
0; width:600px"> </div>
<div>
<table style="; padding: 15px 0 0 0" border="0">
<tbody>
<tr>
<td style="font-size:11px; color:#56707d; text-align:
center; "> <a href="http://www.smile.fr/"><img
src="cid:part1.AB2C141B.1188C913@smile.fr"
alt="Logo" height="47" width="129"></a><br>
<br>
<font face="century gothic, arial, sans-serif">20 rue
des Jardins<br>
92600 Asnières-sur-Seine<br>
<a href="http://www.smile.fr/" style="font-size:14px;
color:#ec6608 ; text-decoration:none;">www.smile.fr</a></font>
</td>
<td style="padding-left:35px; font-size:12px;
color:#56707d">
<div style="color:#153358; font-size:12px;"><font
face="century gothic, arial, sans-serif"><b>Jérémy
ROSEN</b></font></div>
<div style="color:#117eb4; font-size:12px;"><font
face="century gothic, arial, sans-serif">Architecte
technique<br>
</font></div>
<div style="color:#56707d; font-size:12px;"><font
face="century gothic, arial, sans-serif">Email : <a
href="mailto:jeremy.rosen@smile.fr"
style="color:#56707d; font-size:12px;
text-decoration:none;">jeremy.rosen@smile.fr</a> <br>
Tel : +33141402967 </font></div>
<br>
<div> <span><a
href="https://www.facebook.com/smileopensource"><img
src="cid:part5.E6E631D7.42B89CCF@smile.fr"
alt="Facebook" height="24" width="25"></a></span>
<span><a
href="http://fr.slideshare.net/SmileOpenSource/presentations"><img
src="cid:part7.B463D909.2497DDDE@smile.fr"
alt="Google%2B" height="24" width="25"></a></span>
<span><a href="https://www.linkedin.com/company/smile"><img
src="cid:part9.13D607A9.0F069979@smile.fr"
alt="LinkedIn" height="24" width="25"></a></span>
<span><a href="https://twitter.com/GroupeSmile"><img
src="cid:part11.5CE50051.581048FD@smile.fr"
alt="Twitter" height="24" width="25"></a></span>
</div>
</td>
</tr>
</tbody>
</table>
<div style="border-bottom: 1px solid #ccd4d7; margin:0 10px 0 0;
width:600px"> </div>
<br>
<div> <a
href="http://www.smile.fr/Offres-services/Offres/Ingenierie?utm_source=signature&utm_medium=email&utm_campaign=signature"><img
src="cid:part13.5DDA977B.D642906C@smile.fr"
alt="bandeaux_mail" border="0"></a></div>
<br>
<div style="color:#a3acb5; font-size:10px;"> <img
src="cid:part15.8108EA8B.21ECF512@smile.fr" alt="eco"
height="11" width="13"> <font face="century gothic, arial,
sans-serif"> Pour la planète, n'imprimez ce mail que si
c'est nécessaire </font> </div>
</div>
</div>
</body>
</html>