Patchwork [bitbake-devel,25/32] Hob: Add an extra 50M space if zypper is selected

login
register
mail settings
Submitter Shane Wang
Date Feb. 29, 2012, 2:15 p.m.
Message ID <706daef003dc2293e05fd03402ff74473a862fec.1330523904.git.shane.wang@intel.com>
Download mbox | patch
Permalink /patch/22473/
State New
Headers show

Comments

Shane Wang - Feb. 29, 2012, 2:15 p.m.
From: Dongxiao Xu <dongxiao.xu@intel.com>

An workaround to judge if zypper is selected, we will add an extra
51200 KB to image size.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
---
 bitbake/lib/bb/ui/crumbs/packageselectionpage.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Joshua Lock - Feb. 29, 2012, 9:29 p.m.
On 29/02/12 06:15, Shane Wang wrote:
> From: Dongxiao Xu<dongxiao.xu@intel.com>
>
> An workaround to judge if zypper is selected, we will add an extra
> 51200 KB to image size.

This sort of change sets alarms off, especially as we already have 
variables in the core metadata to affect image size (one of which is 
employed for this very reason) - are we not honouring those variables in 
hob?

Cheers,
Joshua
>
> Signed-off-by: Dongxiao Xu<dongxiao.xu@intel.com>
> ---
>   bitbake/lib/bb/ui/crumbs/packageselectionpage.py |    2 ++
>   1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
> index 5459743..89487c1 100755
> --- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
> +++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
> @@ -180,6 +180,8 @@ class PackageSelectionPage (HobPage):
>           image_overhead_factor = self.builder.configuration.image_overhead_factor
>           image_rootfs_size = self.builder.configuration.image_rootfs_size
>           image_extra_size = self.builder.configuration.image_extra_size
> +        if "zypper" in self.builder.configuration.selected_packages:
> +            image_extra_size += 51200
>           base_size = image_overhead_factor * selected_packages_size
>           image_total_size = max(base_size, image_rootfs_size) + image_extra_size
>           image_total_size_str = self._size_to_string(image_total_size)
Dongxiao Xu - March 1, 2012, 4:19 a.m.
On Wed, 2012-02-29 at 13:29 -0800, Joshua Lock wrote:
> On 29/02/12 06:15, Shane Wang wrote:
> > From: Dongxiao Xu<dongxiao.xu@intel.com>
> >
> > An workaround to judge if zypper is selected, we will add an extra
> > 51200 KB to image size.
> 
> This sort of change sets alarms off, especially as we already have 
> variables in the core metadata to affect image size (one of which is 
> employed for this very reason) - are we not honouring those variables in 
> hob?

Thanks Josh for the suggestion.

The situation we are facing is that, Hob could only query the variable
values from bb.configuration.data, which doesn't include the
image_types.bbclass and rootfs_rpm.bbclass. Therefore it is not able to
get those variable's updated value in these classes.

Thanks,
Dongxiao

> 
> Cheers,
> Joshua
> >
> > Signed-off-by: Dongxiao Xu<dongxiao.xu@intel.com>
> > ---
> >   bitbake/lib/bb/ui/crumbs/packageselectionpage.py |    2 ++
> >   1 files changed, 2 insertions(+), 0 deletions(-)
> >
> > diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
> > index 5459743..89487c1 100755
> > --- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
> > +++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
> > @@ -180,6 +180,8 @@ class PackageSelectionPage (HobPage):
> >           image_overhead_factor = self.builder.configuration.image_overhead_factor
> >           image_rootfs_size = self.builder.configuration.image_rootfs_size
> >           image_extra_size = self.builder.configuration.image_extra_size
> > +        if "zypper" in self.builder.configuration.selected_packages:
> > +            image_extra_size += 51200
> >           base_size = image_overhead_factor * selected_packages_size
> >           image_total_size = max(base_size, image_rootfs_size) + image_extra_size
> >           image_total_size_str = self._size_to_string(image_total_size)
>
Joshua Lock - March 1, 2012, 7:22 p.m.
On 29/02/12 20:19, Xu, Dongxiao wrote:
> On Wed, 2012-02-29 at 13:29 -0800, Joshua Lock wrote:
>> On 29/02/12 06:15, Shane Wang wrote:
>>> From: Dongxiao Xu<dongxiao.xu@intel.com>
>>>
>>> An workaround to judge if zypper is selected, we will add an extra
>>> 51200 KB to image size.
>>
>> This sort of change sets alarms off, especially as we already have
>> variables in the core metadata to affect image size (one of which is
>> employed for this very reason) - are we not honouring those variables in
>> hob?
>
> Thanks Josh for the suggestion.
>
> The situation we are facing is that, Hob could only query the variable
> values from bb.configuration.data, which doesn't include the
> image_types.bbclass and rootfs_rpm.bbclass. Therefore it is not able to
> get those variable's updated value in these classes.

I understand the problem, that's why the old hob forced a pre-conf which 
included INHERIT += "image_types" - not the cleanest solution but 
arguably better than hard coding values as at least this way we respect 
user settings.

Cheers,
Joshua

Patch

diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
index 5459743..89487c1 100755
--- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
@@ -180,6 +180,8 @@  class PackageSelectionPage (HobPage):
         image_overhead_factor = self.builder.configuration.image_overhead_factor
         image_rootfs_size = self.builder.configuration.image_rootfs_size
         image_extra_size = self.builder.configuration.image_extra_size
+        if "zypper" in self.builder.configuration.selected_packages:
+            image_extra_size += 51200
         base_size = image_overhead_factor * selected_packages_size
         image_total_size = max(base_size, image_rootfs_size) + image_extra_size
         image_total_size_str = self._size_to_string(image_total_size)