summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2012-04-01 20:14:15 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-04-05 14:00:26 +0100
commit7b560745f23d862cc3e48748b56bc8ce4ce84f72 (patch)
tree6aa70efa8f99e1a98dee11ebecb93eeea5e9a8c7 /bitbake/lib/bb
parentf414dbbaa02de33efacf80802aa0370aad41cfa9 (diff)
downloadpoky-7b560745f23d862cc3e48748b56bc8ce4ce84f72.tar.gz
Hob: Fix toolchain build
Originally we added -dev and -dbg postfixes to our selected packages as toolchain packages. However, some package names are modified in recipes, so we could not rely on its base name. The new approach is to detect if a package is selected, then include those packages under the same recipe endswith "-dev" and "-dbg". This fixes [YOCTO #2185] (Bitbake rev: f99c66071bce63780301e1639d74316503ca934c) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py9
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py9
-rw-r--r--bitbake/lib/bb/ui/crumbs/hoblistmodel.py16
3 files changed, 26 insertions, 8 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index 44b208a177..8427623b37 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -457,12 +457,15 @@ class Builder(gtk.Window):
457 def generate_image(self): 457 def generate_image(self):
458 # Build image 458 # Build image
459 self.set_user_config() 459 self.set_user_config()
460 all_packages = self.package_model.get_selected_packages() 460 packages = self.package_model.get_selected_packages()
461 toolchain_packages = []
462 if self.configuration.toolchain_build:
463 toolchain_packages = self.package_model.get_selected_packages_toolchain()
461 self.handler.reset_build() 464 self.handler.reset_build()
462 self.handler.generate_image(all_packages, 465 self.handler.generate_image(packages,
463 self.hob_image, 466 self.hob_image,
464 self.hob_toolchain, 467 self.hob_toolchain,
465 self.configuration.toolchain_build) 468 toolchain_packages)
466 469
467 # Callback Functions 470 # Callback Functions
468 def handler_config_updated_cb(self, handler, which, values): 471 def handler_config_updated_cb(self, handler, which, values):
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index 74081dcc84..8909e010f9 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -131,9 +131,8 @@ class HobHandler(gobject.GObject):
131 targets = [self.hob_image] 131 targets = [self.hob_image]
132 self.server.runCommand(["setVariable", "LINGUAS_INSTALL", ""]) 132 self.server.runCommand(["setVariable", "LINGUAS_INSTALL", ""])
133 self.server.runCommand(["setVariable", "PACKAGE_INSTALL", " ".join(self.package_queue)]) 133 self.server.runCommand(["setVariable", "PACKAGE_INSTALL", " ".join(self.package_queue)])
134 if self.toolchain_build: 134 if self.toolchain_packages:
135 pkgs = self.package_queue + [i+'-dev' for i in self.package_queue] + [i+'-dbg' for i in self.package_queue] 135 self.server.runCommand(["setVariable", "TOOLCHAIN_TARGET_TASK", " ".join(self.toolchain_packages)])
136 self.server.runCommand(["setVariable", "TOOLCHAIN_TARGET_TASK", " ".join(pkgs)])
137 targets.append(self.hob_toolchain) 136 targets.append(self.hob_toolchain)
138 self.server.runCommand(["buildTargets", targets, "build"]) 137 self.server.runCommand(["buildTargets", targets, "build"])
139 138
@@ -350,11 +349,11 @@ class HobHandler(gobject.GObject):
350 self.commands_async.append(self.SUB_BUILD_RECIPES) 349 self.commands_async.append(self.SUB_BUILD_RECIPES)
351 self.run_next_command(self.GENERATE_PACKAGES) 350 self.run_next_command(self.GENERATE_PACKAGES)
352 351
353 def generate_image(self, tgts, hob_image, hob_toolchain, toolchain_build=False): 352 def generate_image(self, tgts, hob_image, hob_toolchain, toolchain_packages=[]):
354 self.package_queue = tgts 353 self.package_queue = tgts
355 self.hob_image = hob_image 354 self.hob_image = hob_image
356 self.hob_toolchain = hob_toolchain 355 self.hob_toolchain = hob_toolchain
357 self.toolchain_build = toolchain_build 356 self.toolchain_packages = toolchain_packages
358 self.commands_async.append(self.SUB_PARSE_CONFIG) 357 self.commands_async.append(self.SUB_PARSE_CONFIG)
359 self.commands_async.append(self.SUB_BUILD_IMAGE) 358 self.commands_async.append(self.SUB_BUILD_IMAGE)
360 self.run_next_command(self.GENERATE_IMAGE) 359 self.run_next_command(self.GENERATE_IMAGE)
diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
index a09c7c726e..d4cae43892 100644
--- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
+++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py
@@ -357,6 +357,22 @@ class PackageListModel(gtk.TreeStore):
357 357
358 return packagelist 358 return packagelist
359 359
360 def get_selected_packages_toolchain(self):
361 packagelist = []
362
363 it = self.get_iter_first()
364 while it:
365 if self.get_value(it, self.COL_INC):
366 child_it = self.iter_children(it)
367 while child_it:
368 name = self.get_value(child_it, self.COL_NAME)
369 inc = self.get_value(child_it, self.COL_INC)
370 if inc or name.endswith("-dev") or name.endswith("-dbg"):
371 packagelist.append(name)
372 child_it = self.iter_next(child_it)
373 it = self.iter_next(it)
374
375 return packagelist
360 """ 376 """
361 Return the selected package size, unit is KB. 377 Return the selected package size, unit is KB.
362 """ 378 """