Patchwork [bitbake-devel,PATCH_V2,13/16] bitbake: save packages in IMAGE_INSTALL instead of PACKAGE_INSTALL

login
register
mail settings
Submitter Cristiana Voicu
Date July 25, 2013, 11:42 a.m.
Message ID <1374752549-29471-14-git-send-email-cristiana.voicu@intel.com>
Download mbox | patch
Permalink /patch/54475/
State New
Headers show

Comments

Cristiana Voicu - July 25, 2013, 11:42 a.m.
Hob retrieves the list of recipes and packages using the IMAGE_INSTALL
variable, so a custom image should be saved using this variable.
Changed how the image is saved in a bb file

[YOCTO #4193]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
---
 bitbake/lib/bb/cooker.py |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Paul Eggleton - July 26, 2013, 2:22 p.m.
Hi Cristiana,

On Thursday 25 July 2013 14:42:26 Cristiana Voicu wrote:
> Hob retrieves the list of recipes and packages using the IMAGE_INSTALL
> variable, so a custom image should be saved using this variable.
> Changed how the image is saved in a bb file
> 
> [YOCTO #4193]
> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
> ---
>  bitbake/lib/bb/cooker.py |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
> index ad92dea..48be434 100644
> --- a/bitbake/lib/bb/cooker.py
> +++ b/bitbake/lib/bb/cooker.py
> @@ -1159,11 +1159,11 @@ class BBCooker:
>                  if topdir in base_image:
>                      base_image = require_line.split()[1]
>                  imagefile.write("require " + base_image + "\n")
> -            package_install = "PACKAGE_INSTALL_forcevariable = \""
> +            image_install = "IMAGE_INSTALL_append = \""
>              for package in package_queue:
> -                package_install += str(package) + " "
> -            package_install += "\"\n"
> -            imagefile.write(package_install)
> +                image_install += str(package) + " "
> +            image_install += "\"\n"
> +            imagefile.write(image_install)
> 
>              description_var = "DESCRIPTION = \"" + description + "\"\n"
>              imagefile.write(description_var)

If this is within the image recipe it should be using IMAGE_INSTALL = rather 
than appending to an existing value. At the moment it looks like you're using 
_append with no leading space which could interact poorly with any previous 
value set, and in any case I'm not entirely sure we need to support having a 
previous value in there within this context.

Cheers,
Paul
Cristiana Voicu - July 26, 2013, 2:48 p.m.
Hi Paul,

There is for sure a previous value, because all the recipes saved this way require an image from the layers.
Regarding the "append" suffix, I've found in the documentation that :
When you use this variable, it is best to use it as follows:

     IMAGE_INSTALL_append = " package-name"

Here is the link: http://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#var-IMAGE_INSTALL

And yes, I have missed a space. 
Thanks,
Cristiana

-----Original Message-----
From: Paul Eggleton [mailto:paul.eggleton@linux.intel.com] 
Sent: Friday, July 26, 2013 5:22 PM
To: Voicu, Cristiana
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [bitbake-devel] [PATCH_V2 13/16] bitbake: save packages in IMAGE_INSTALL instead of PACKAGE_INSTALL

Hi Cristiana,

On Thursday 25 July 2013 14:42:26 Cristiana Voicu wrote:
> Hob retrieves the list of recipes and packages using the IMAGE_INSTALL 
> variable, so a custom image should be saved using this variable.
> Changed how the image is saved in a bb file
> 
> [YOCTO #4193]
> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
> ---
>  bitbake/lib/bb/cooker.py |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 
> ad92dea..48be434 100644
> --- a/bitbake/lib/bb/cooker.py
> +++ b/bitbake/lib/bb/cooker.py
> @@ -1159,11 +1159,11 @@ class BBCooker:
>                  if topdir in base_image:
>                      base_image = require_line.split()[1]
>                  imagefile.write("require " + base_image + "\n")
> -            package_install = "PACKAGE_INSTALL_forcevariable = \""
> +            image_install = "IMAGE_INSTALL_append = \""
>              for package in package_queue:
> -                package_install += str(package) + " "
> -            package_install += "\"\n"
> -            imagefile.write(package_install)
> +                image_install += str(package) + " "
> +            image_install += "\"\n"
> +            imagefile.write(image_install)
> 
>              description_var = "DESCRIPTION = \"" + description + "\"\n"
>              imagefile.write(description_var)

If this is within the image recipe it should be using IMAGE_INSTALL = rather than appending to an existing value. At the moment it looks like you're using _append with no leading space which could interact poorly with any previous value set, and in any case I'm not entirely sure we need to support having a previous value in there within this context.

Cheers,
Paul
Paul Eggleton - July 26, 2013, 3:05 p.m.
On Friday 26 July 2013 14:48:24 Voicu, Cristiana wrote:
> There is for sure a previous value, because all the recipes saved this way
> require an image from the layers. Regarding the "append" suffix, I've found
> in the documentation that : When you use this variable, it is best to use
> it as follows:
> 
>      IMAGE_INSTALL_append = " package-name"

That's more about using it in local.conf than individual image recipes.

I had forgotten that we were "require"ing an existing recipe here and missed 
it in the code. However isn't there then a problem if you use _append and the 
user wants to remove something added by the original image using Hob? Won't 
the removed package just be forced back in by virtue of appending to the 
original value of IMAGE_INSTALL?

Cheers,
Paul
Cristiana Voicu - July 26, 2013, 3:10 p.m.
Yes, you are right. I did not think about the case when you remove packages..
I will correct this and the other mistakes.
Thanks,
Cristiana

-----Original Message-----
From: Paul Eggleton [mailto:paul.eggleton@linux.intel.com] 
Sent: Friday, July 26, 2013 6:06 PM
To: Voicu, Cristiana
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [bitbake-devel] [PATCH_V2 13/16] bitbake: save packages in IMAGE_INSTALL instead of PACKAGE_INSTALL

On Friday 26 July 2013 14:48:24 Voicu, Cristiana wrote:
> There is for sure a previous value, because all the recipes saved this 
> way require an image from the layers. Regarding the "append" suffix, 
> I've found in the documentation that : When you use this variable, it 
> is best to use it as follows:
> 
>      IMAGE_INSTALL_append = " package-name"

That's more about using it in local.conf than individual image recipes.

I had forgotten that we were "require"ing an existing recipe here and missed it in the code. However isn't there then a problem if you use _append and the user wants to remove something added by the original image using Hob? Won't the removed package just be forced back in by virtue of appending to the original value of IMAGE_INSTALL?

Cheers,
Paul

Patch

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index ad92dea..48be434 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1159,11 +1159,11 @@  class BBCooker:
                 if topdir in base_image:
                     base_image = require_line.split()[1]
                 imagefile.write("require " + base_image + "\n")
-            package_install = "PACKAGE_INSTALL_forcevariable = \""
+            image_install = "IMAGE_INSTALL_append = \""
             for package in package_queue:
-                package_install += str(package) + " "
-            package_install += "\"\n"
-            imagefile.write(package_install)
+                image_install += str(package) + " "
+            image_install += "\"\n"
+            imagefile.write(image_install)
 
             description_var = "DESCRIPTION = \"" + description + "\"\n"
             imagefile.write(description_var)