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>
This commit is contained in:
parent
f414dbbaa0
commit
7b560745f2
|
@ -457,12 +457,15 @@ class Builder(gtk.Window):
|
|||
def generate_image(self):
|
||||
# Build image
|
||||
self.set_user_config()
|
||||
all_packages = self.package_model.get_selected_packages()
|
||||
packages = self.package_model.get_selected_packages()
|
||||
toolchain_packages = []
|
||||
if self.configuration.toolchain_build:
|
||||
toolchain_packages = self.package_model.get_selected_packages_toolchain()
|
||||
self.handler.reset_build()
|
||||
self.handler.generate_image(all_packages,
|
||||
self.handler.generate_image(packages,
|
||||
self.hob_image,
|
||||
self.hob_toolchain,
|
||||
self.configuration.toolchain_build)
|
||||
toolchain_packages)
|
||||
|
||||
# Callback Functions
|
||||
def handler_config_updated_cb(self, handler, which, values):
|
||||
|
|
|
@ -131,9 +131,8 @@ class HobHandler(gobject.GObject):
|
|||
targets = [self.hob_image]
|
||||
self.server.runCommand(["setVariable", "LINGUAS_INSTALL", ""])
|
||||
self.server.runCommand(["setVariable", "PACKAGE_INSTALL", " ".join(self.package_queue)])
|
||||
if self.toolchain_build:
|
||||
pkgs = self.package_queue + [i+'-dev' for i in self.package_queue] + [i+'-dbg' for i in self.package_queue]
|
||||
self.server.runCommand(["setVariable", "TOOLCHAIN_TARGET_TASK", " ".join(pkgs)])
|
||||
if self.toolchain_packages:
|
||||
self.server.runCommand(["setVariable", "TOOLCHAIN_TARGET_TASK", " ".join(self.toolchain_packages)])
|
||||
targets.append(self.hob_toolchain)
|
||||
self.server.runCommand(["buildTargets", targets, "build"])
|
||||
|
||||
|
@ -350,11 +349,11 @@ class HobHandler(gobject.GObject):
|
|||
self.commands_async.append(self.SUB_BUILD_RECIPES)
|
||||
self.run_next_command(self.GENERATE_PACKAGES)
|
||||
|
||||
def generate_image(self, tgts, hob_image, hob_toolchain, toolchain_build=False):
|
||||
def generate_image(self, tgts, hob_image, hob_toolchain, toolchain_packages=[]):
|
||||
self.package_queue = tgts
|
||||
self.hob_image = hob_image
|
||||
self.hob_toolchain = hob_toolchain
|
||||
self.toolchain_build = toolchain_build
|
||||
self.toolchain_packages = toolchain_packages
|
||||
self.commands_async.append(self.SUB_PARSE_CONFIG)
|
||||
self.commands_async.append(self.SUB_BUILD_IMAGE)
|
||||
self.run_next_command(self.GENERATE_IMAGE)
|
||||
|
|
|
@ -357,6 +357,22 @@ class PackageListModel(gtk.TreeStore):
|
|||
|
||||
return packagelist
|
||||
|
||||
def get_selected_packages_toolchain(self):
|
||||
packagelist = []
|
||||
|
||||
it = self.get_iter_first()
|
||||
while it:
|
||||
if self.get_value(it, self.COL_INC):
|
||||
child_it = self.iter_children(it)
|
||||
while child_it:
|
||||
name = self.get_value(child_it, self.COL_NAME)
|
||||
inc = self.get_value(child_it, self.COL_INC)
|
||||
if inc or name.endswith("-dev") or name.endswith("-dbg"):
|
||||
packagelist.append(name)
|
||||
child_it = self.iter_next(child_it)
|
||||
it = self.iter_next(it)
|
||||
|
||||
return packagelist
|
||||
"""
|
||||
Return the selected package size, unit is KB.
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue