From: Cristiana Voicu Date: Tue, 7 May 2013 08:07:56 +0000 (+0300) Subject: bitbake: hob: assure consistency for image size label X-Git-Tag: rev_ivi_2015_02_04~12619 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=87b018b519e9d98157a3a44d63b570d35b8135d9;p=scm%2Fbb%2Ftizen-distro.git bitbake: hob: assure consistency for image size label After the image was build, update the image size in the packagelistpage. [YOCTO #4388] (Bitbake rev: 4d6d02e61b32d1d710c708774f08cc5e7764415d) Signed-off-by: Cristiana Voicu Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py index b347f6d..07118aa 100755 --- a/bitbake/lib/bb/ui/crumbs/builder.py +++ b/bitbake/lib/bb/ui/crumbs/builder.py @@ -108,6 +108,8 @@ class Configuration: self.extra_setting = {} self.toolchain_build = False self.image_fstypes = "" + self.image_size = None + self.image_packages = [] # bblayers.conf self.layers = [] # image/recipes/packages diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py index d586413..268ac68 100755 --- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py +++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py @@ -369,6 +369,8 @@ class ImageDetailsPage (HobPage): vallist = [] vallist.append(pkg_num) vallist.append(default_image_size) + self.builder.configuration.image_size = default_image_size + self.builder.configuration.image_packages = self.builder.configuration.selected_packages if self.build_succeeded: edit_packages_button = HobAltButton("Edit packages") edit_packages_button.set_tooltip_text("Edit the packages included in your image") diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py index a4d86bd..0cac92f 100755 --- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py +++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py @@ -270,14 +270,17 @@ class PackageSelectionPage (HobPage): selected_packages_size = self.package_model.get_packages_size() selected_packages_size_str = HobPage._size_to_string(selected_packages_size) - image_overhead_factor = self.builder.configuration.image_overhead_factor - image_rootfs_size = self.builder.configuration.image_rootfs_size / 1024 # image_rootfs_size is KB - image_extra_size = self.builder.configuration.image_extra_size / 1024 # image_extra_size is KB - base_size = image_overhead_factor * selected_packages_size - image_total_size = max(base_size, image_rootfs_size) + image_extra_size - if "zypper" in self.builder.configuration.selected_packages: - image_total_size += (51200 * 1024) - image_total_size_str = HobPage._size_to_string(image_total_size) + if self.builder.configuration.image_packages == self.builder.configuration.selected_packages: + image_total_size_str = self.builder.configuration.image_size + else: + image_overhead_factor = self.builder.configuration.image_overhead_factor + image_rootfs_size = self.builder.configuration.image_rootfs_size / 1024 # image_rootfs_size is KB + image_extra_size = self.builder.configuration.image_extra_size / 1024 # image_extra_size is KB + base_size = image_overhead_factor * selected_packages_size + image_total_size = max(base_size, image_rootfs_size) + image_extra_size + if "zypper" in self.builder.configuration.selected_packages: + image_total_size += (51200 * 1024) + image_total_size_str = HobPage._size_to_string(image_total_size) self.label.set_label("Packages included: %s\nSelected packages size: %s\nTotal image size: %s" % (selected_packages_num, selected_packages_size_str, image_total_size_str)) @@ -297,6 +300,7 @@ class PackageSelectionPage (HobPage): self.refresh_selection() if not self.builder.customized: self.builder.customized = True + self.builder.configuration.initial_selected_image = self.builder.configuration.selected_image self.builder.configuration.selected_image = self.recipe_model.__custom_image__ self.builder.rcppkglist_populated()