summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristiana Voicu <cristiana.voicu@intel.com>2013-05-07 11:07:56 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-05-10 13:33:33 +0100
commitd98419ae706c33f2d031598cb0914616bc7dfaa0 (patch)
treec7f447450c493610a471c9fe49cad2d00f84757b
parent9c60292b6fc1effdb6a7d41453e3ff7db850e178 (diff)
downloadpoky-d98419ae706c33f2d031598cb0914616bc7dfaa0.tar.gz
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 <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py2
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/imagedetailspage.py2
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/packageselectionpage.py20
3 files changed, 16 insertions, 8 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index b347f6ddf4..07118aabd0 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -108,6 +108,8 @@ class Configuration:
108 self.extra_setting = {} 108 self.extra_setting = {}
109 self.toolchain_build = False 109 self.toolchain_build = False
110 self.image_fstypes = "" 110 self.image_fstypes = ""
111 self.image_size = None
112 self.image_packages = []
111 # bblayers.conf 113 # bblayers.conf
112 self.layers = [] 114 self.layers = []
113 # image/recipes/packages 115 # image/recipes/packages
diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
index d5864136aa..268ac68b40 100755
--- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
@@ -369,6 +369,8 @@ class ImageDetailsPage (HobPage):
369 vallist = [] 369 vallist = []
370 vallist.append(pkg_num) 370 vallist.append(pkg_num)
371 vallist.append(default_image_size) 371 vallist.append(default_image_size)
372 self.builder.configuration.image_size = default_image_size
373 self.builder.configuration.image_packages = self.builder.configuration.selected_packages
372 if self.build_succeeded: 374 if self.build_succeeded:
373 edit_packages_button = HobAltButton("Edit packages") 375 edit_packages_button = HobAltButton("Edit packages")
374 edit_packages_button.set_tooltip_text("Edit the packages included in your image") 376 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 a4d86bd610..0cac92f026 100755
--- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
@@ -270,14 +270,17 @@ class PackageSelectionPage (HobPage):
270 selected_packages_size = self.package_model.get_packages_size() 270 selected_packages_size = self.package_model.get_packages_size()
271 selected_packages_size_str = HobPage._size_to_string(selected_packages_size) 271 selected_packages_size_str = HobPage._size_to_string(selected_packages_size)
272 272
273 image_overhead_factor = self.builder.configuration.image_overhead_factor 273 if self.builder.configuration.image_packages == self.builder.configuration.selected_packages:
274 image_rootfs_size = self.builder.configuration.image_rootfs_size / 1024 # image_rootfs_size is KB 274 image_total_size_str = self.builder.configuration.image_size
275 image_extra_size = self.builder.configuration.image_extra_size / 1024 # image_extra_size is KB 275 else:
276 base_size = image_overhead_factor * selected_packages_size 276 image_overhead_factor = self.builder.configuration.image_overhead_factor
277 image_total_size = max(base_size, image_rootfs_size) + image_extra_size 277 image_rootfs_size = self.builder.configuration.image_rootfs_size / 1024 # image_rootfs_size is KB
278 if "zypper" in self.builder.configuration.selected_packages: 278 image_extra_size = self.builder.configuration.image_extra_size / 1024 # image_extra_size is KB
279 image_total_size += (51200 * 1024) 279 base_size = image_overhead_factor * selected_packages_size
280 image_total_size_str = HobPage._size_to_string(image_total_size) 280 image_total_size = max(base_size, image_rootfs_size) + image_extra_size
281 if "zypper" in self.builder.configuration.selected_packages:
282 image_total_size += (51200 * 1024)
283 image_total_size_str = HobPage._size_to_string(image_total_size)
281 284
282 self.label.set_label("Packages included: %s\nSelected packages size: %s\nTotal image size: %s" % 285 self.label.set_label("Packages included: %s\nSelected packages size: %s\nTotal image size: %s" %
283 (selected_packages_num, selected_packages_size_str, image_total_size_str)) 286 (selected_packages_num, selected_packages_size_str, image_total_size_str))
@@ -297,6 +300,7 @@ class PackageSelectionPage (HobPage):
297 self.refresh_selection() 300 self.refresh_selection()
298 if not self.builder.customized: 301 if not self.builder.customized:
299 self.builder.customized = True 302 self.builder.customized = True
303 self.builder.configuration.initial_selected_image = self.builder.configuration.selected_image
300 self.builder.configuration.selected_image = self.recipe_model.__custom_image__ 304 self.builder.configuration.selected_image = self.recipe_model.__custom_image__
301 self.builder.rcppkglist_populated() 305 self.builder.rcppkglist_populated()
302 306