Skip to contentSkip to conversation

dev-manual: reverse "=" and "+=" for IMAGE_FEATURES

PATCH In review [email protected] 2 participants 3 messages Apr 6, 2020 – Apr 7, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dev-manual: reverse "=" and "+=" for IMAGE_FEATURES

Pretty sure these assignments are in the reverse order.

---

documentation/dev-manual/dev-manual-common-tasks.xml +2 -2
index 2b8868b62..b9d527486 100644
@@ -11202,11 +11202,11 @@
                 <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>
                 causes the build system to create a read-only root filesystem:
                 <literallayout class='monospaced'>
-     IMAGE_FEATURES = "read-only-rootfs"
+     IMAGE_FEATURES += "read-only-rootfs"
                 </literallayout>
                 or
                 <literallayout class='monospaced'>
-     EXTRA_IMAGE_FEATURES += "read-only-rootfs"
+     EXTRA_IMAGE_FEATURES = "read-only-rootfs"
                 </literallayout>
             </para>
 
Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                         http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#1 lore raw

You probably want += in both cases. Also, adding to IMAGE_FEATURES is more appropriately done in an image recipe, while adding to EXTRA_IMAGE_FEATURES is typically done in the local.conf, so:

<para>
To create the read-only root filesystem, simply add the "read-only-rootfs" feature to your image.
Either add the following statement to your image recipe:
<literallayout class='monospaced'>
IMAGE_FEATURES += "read-only-rootfs"
</literallayout>
or add the following statement to the <filename>local.conf</filename> file found in the
<ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
<literallayout class='monospaced'>
EXTRA_IMAGE_FEATURES += "read-only-rootfs"
</literallayout>
</para>

//Peter

Quoted 45 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of [email protected]
Sent: den 6 april 2020 22:33
To: YP docs mailing list <[email protected]>
Subject: [docs] [PATCH] dev-manual: reverse "=" and "+=" for IMAGE_FEATURES

Pretty sure these assignments are in the reverse order.

---

documentation/dev-manual/dev-manual-common-tasks.xml +0 -0
index 2b8868b62..b9d527486 100644
@@ -11202,11 +11202,11 @@
                 <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build

Directory</ulink>
causes the build system to create a read-only root
filesystem:
<literallayout class='monospaced'>

documentation/dev-manual/dev-manual-common-tasks.xml +2 -3
-     IMAGE_FEATURES = "read-only-rootfs"
+     IMAGE_FEATURES += "read-only-rootfs"
                 </literallayout>
                 or
                 <literallayout class='monospaced'>
-     EXTRA_IMAGE_FEATURES += "read-only-rootfs"
+     EXTRA_IMAGE_FEATURES = "read-only-rootfs"
                 </literallayout>
             </para>
 
 
--

========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday

========================================================================

#2 lore raw
Quoted 19 lines · Peter Kjellerstedt

You probably want += in both cases. Also, adding to IMAGE_FEATURES is more appropriately done in an image recipe, while adding to EXTRA_IMAGE_FEATURES is typically done in the local.conf, so:

<para>
To create the read-only root filesystem, simply add the "read-only-rootfs" feature to your image.
Either add the following statement to your image recipe:
<literallayout class='monospaced'>
IMAGE_FEATURES += "read-only-rootfs"
</literallayout>
or add the following statement to the <filename>local.conf</filename> file found in the
<ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build Directory</ulink>:
<literallayout class='monospaced'>
EXTRA_IMAGE_FEATURES += "read-only-rootfs"
</literallayout>
</para>

Quoted 1 line

//Peter

i would disagree with your second position just from a stylistic
point of view, as there are variables in OE where the base form (VAR) is normally set in a recipe file, while there is the additional form EXTRA_VAR that is specifically meant to be just *set* in your local.conf, knowing that the underlying logic will do the right thing with it and you don't need to worry about "+=" versus "_append", which is exactly what EXTRA_IMAGE_FEATURES is for.

yes, using += with EXTRA_IMAGE_FEATURES will work just fine, but it
sort of defeats the purpose of having invented it in the first place. i would, however, incorporate your additional explanation to make all of this more obvious. v2 coming shortly ...

Quoted 46 lines
Quoted 45 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of [email protected]
Sent: den 6 april 2020 22:33
To: YP docs mailing list <[email protected]>
Subject: [docs] [PATCH] dev-manual: reverse "=" and "+=" for IMAGE_FEATURES

Pretty sure these assignments are in the reverse order.

---

documentation/dev-manual/dev-manual-common-tasks.xml +0 -0
index 2b8868b62..b9d527486 100644
@@ -11202,11 +11202,11 @@
                 <ulink url='&YOCTO_DOCS_REF_URL;#build-directory'>Build

Directory</ulink>
causes the build system to create a read-only root
filesystem:
<literallayout class='monospaced'>

documentation/dev-manual/dev-manual-common-tasks.xml +2 -3
-     IMAGE_FEATURES = "read-only-rootfs"
+     IMAGE_FEATURES += "read-only-rootfs"
                 </literallayout>
                 or
                 <literallayout class='monospaced'>
-     EXTRA_IMAGE_FEATURES += "read-only-rootfs"
+     EXTRA_IMAGE_FEATURES = "read-only-rootfs"
                 </literallayout>
             </para>
 
 
--

========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday

========================================================================

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                         http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================