2011-02-02 13:02:43 +00:00
|
|
|
#
|
|
|
|
# BitBake Graphical GTK User Interface
|
|
|
|
#
|
|
|
|
# Copyright (C) 2011 Intel Corporation
|
|
|
|
#
|
|
|
|
# Authored by Joshua Lock <josh@linux.intel.com>
|
2011-11-28 06:32:40 +00:00
|
|
|
# Authored by Dongxiao Xu <dongxiao.xu@intel.com>
|
2011-02-02 13:02:43 +00:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License version 2 as
|
|
|
|
# published by the Free Software Foundation.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
|
|
|
import gobject
|
2011-07-28 22:21:14 +00:00
|
|
|
import logging
|
2011-11-28 06:32:40 +00:00
|
|
|
from bb.ui.crumbs.runningbuild import RunningBuild
|
2011-02-02 13:02:43 +00:00
|
|
|
|
|
|
|
class HobHandler(gobject.GObject):
|
|
|
|
|
|
|
|
"""
|
|
|
|
This object does BitBake event handling for the hob gui.
|
|
|
|
"""
|
|
|
|
__gsignals__ = {
|
2011-11-28 06:32:40 +00:00
|
|
|
"package-formats-updated" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
(gobject.TYPE_PYOBJECT,)),
|
|
|
|
"config-updated" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
(gobject.TYPE_STRING, gobject.TYPE_PYOBJECT,)),
|
|
|
|
"command-succeeded" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
(gobject.TYPE_INT,)),
|
|
|
|
"command-failed" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
(gobject.TYPE_STRING,)),
|
2013-01-21 14:40:07 +00:00
|
|
|
"parsing-warning" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
(gobject.TYPE_STRING,)),
|
2012-05-28 17:10:39 +00:00
|
|
|
"sanity-failed" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
2012-09-26 13:59:57 +00:00
|
|
|
(gobject.TYPE_STRING, gobject.TYPE_INT)),
|
2011-11-28 06:32:40 +00:00
|
|
|
"generating-data" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
()),
|
|
|
|
"data-generated" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
()),
|
|
|
|
"parsing-started" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
(gobject.TYPE_PYOBJECT,)),
|
|
|
|
"parsing" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
(gobject.TYPE_PYOBJECT,)),
|
|
|
|
"parsing-completed" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
(gobject.TYPE_PYOBJECT,)),
|
2012-05-23 15:19:44 +00:00
|
|
|
"recipe-populated" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
()),
|
|
|
|
"package-populated" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
()),
|
2012-10-11 11:45:07 +00:00
|
|
|
"network-passed" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
()),
|
|
|
|
"network-failed" : (gobject.SIGNAL_RUN_LAST,
|
|
|
|
gobject.TYPE_NONE,
|
|
|
|
()),
|
2011-02-02 13:02:43 +00:00
|
|
|
}
|
|
|
|
|
2012-10-11 11:45:07 +00:00
|
|
|
(GENERATE_CONFIGURATION, GENERATE_RECIPES, GENERATE_PACKAGES, GENERATE_IMAGE, POPULATE_PACKAGEINFO, SANITY_CHECK, NETWORK_TEST) = range(7)
|
|
|
|
(SUB_PATH_LAYERS, SUB_FILES_DISTRO, SUB_FILES_MACH, SUB_FILES_SDKMACH, SUB_MATCH_CLASS, SUB_PARSE_CONFIG, SUB_SANITY_CHECK,
|
|
|
|
SUB_GNERATE_TGTS, SUB_GENERATE_PKGINFO, SUB_BUILD_RECIPES, SUB_BUILD_IMAGE, SUB_NETWORK_TEST) = range(12)
|
2011-07-13 23:01:43 +00:00
|
|
|
|
2012-03-19 03:08:45 +00:00
|
|
|
def __init__(self, server, recipe_model, package_model):
|
2011-11-28 06:32:40 +00:00
|
|
|
super(HobHandler, self).__init__()
|
2011-07-13 23:01:43 +00:00
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
self.build = RunningBuild(sequential=True)
|
|
|
|
|
|
|
|
self.recipe_model = recipe_model
|
|
|
|
self.package_model = package_model
|
|
|
|
|
|
|
|
self.commands_async = []
|
2011-07-01 22:58:50 +00:00
|
|
|
self.generating = False
|
2011-07-28 22:21:14 +00:00
|
|
|
self.current_phase = None
|
2011-11-28 06:32:40 +00:00
|
|
|
self.building = False
|
|
|
|
self.recipe_queue = []
|
|
|
|
self.package_queue = []
|
2011-02-02 13:02:43 +00:00
|
|
|
|
|
|
|
self.server = server
|
2011-11-28 06:32:40 +00:00
|
|
|
self.error_msg = ""
|
|
|
|
self.initcmd = None
|
2013-01-21 14:40:07 +00:00
|
|
|
self.parsing = False
|
2011-11-28 06:32:40 +00:00
|
|
|
|
|
|
|
def set_busy(self):
|
|
|
|
if not self.generating:
|
2011-07-13 23:01:43 +00:00
|
|
|
self.emit("generating-data")
|
|
|
|
self.generating = True
|
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def clear_busy(self):
|
|
|
|
if self.generating:
|
|
|
|
self.emit("data-generated")
|
|
|
|
self.generating = False
|
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
def runCommand(self, commandline):
|
|
|
|
try:
|
bitbake: command: add error to return of runCommand
Currently, command.py can return an error message from runCommand, due to
being unable to run the command, yet few of our UIs (just hob) can handle it
today. This can result in seeing a TypeError with traceback in certain rare
circumstances.
To resolve this, we need a clean way to get errors back from runCommand,
without having to isinstance() the return value. This implements such a thing
by making runCommand also return an error (or None if no error occurred).
As runCommand now has a method of returning errors, we can also alter the
getCmdLineAction bits such that the returned value is just the action, not an
additional message. If a sync command wants to return an error, it raises
CommandError(message), and the message will be passed to the caller
appropriately.
Example Usage:
result, error = server.runCommand(...)
if error:
log.error('Unable to run command: %s' % error)
return 1
(Bitbake rev: 717831b8315cb3904d9b590e633000bc897e8fb6)
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-29 20:01:23 +00:00
|
|
|
result, error = self.server.runCommand(commandline)
|
|
|
|
if error:
|
|
|
|
raise Exception("Error running command '%s': %s" % (commandline, error))
|
2012-10-04 05:15:52 +00:00
|
|
|
return result
|
2012-04-15 16:09:25 +00:00
|
|
|
except Exception as e:
|
|
|
|
self.commands_async = []
|
|
|
|
self.clear_busy()
|
|
|
|
self.emit("command-failed", "Hob Exception - %s" % (str(e)))
|
|
|
|
return None
|
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def run_next_command(self, initcmd=None):
|
2012-03-21 02:58:14 +00:00
|
|
|
if initcmd != None:
|
2011-11-28 06:32:40 +00:00
|
|
|
self.initcmd = initcmd
|
|
|
|
|
|
|
|
if self.commands_async:
|
|
|
|
self.set_busy()
|
|
|
|
next_command = self.commands_async.pop(0)
|
|
|
|
else:
|
|
|
|
self.clear_busy()
|
2012-03-21 02:58:14 +00:00
|
|
|
if self.initcmd != None:
|
2011-11-28 06:32:40 +00:00
|
|
|
self.emit("command-succeeded", self.initcmd)
|
|
|
|
return
|
|
|
|
|
2012-03-23 06:30:43 +00:00
|
|
|
if next_command == self.SUB_PATH_LAYERS:
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["findConfigFilePath", "bblayers.conf"])
|
2012-03-23 06:30:43 +00:00
|
|
|
elif next_command == self.SUB_FILES_DISTRO:
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["findConfigFiles", "DISTRO"])
|
2012-03-23 06:30:43 +00:00
|
|
|
elif next_command == self.SUB_FILES_MACH:
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["findConfigFiles", "MACHINE"])
|
2012-03-23 06:30:43 +00:00
|
|
|
elif next_command == self.SUB_FILES_SDKMACH:
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["findConfigFiles", "MACHINE-SDK"])
|
2012-03-23 06:30:43 +00:00
|
|
|
elif next_command == self.SUB_MATCH_CLASS:
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["findFilesMatchingInDir", "rootfs_", "classes"])
|
2012-03-23 06:30:43 +00:00
|
|
|
elif next_command == self.SUB_PARSE_CONFIG:
|
2013-07-01 08:09:52 +00:00
|
|
|
self.runCommand(["enableDataTracking"])
|
2013-06-20 14:21:17 +00:00
|
|
|
self.runCommand(["parseConfigurationFiles", "conf/.hob.conf", ""])
|
2013-07-01 08:09:52 +00:00
|
|
|
self.runCommand(["disableDataTracking"])
|
2012-03-23 06:30:43 +00:00
|
|
|
elif next_command == self.SUB_GNERATE_TGTS:
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["generateTargetsTree", "classes/image.bbclass", []])
|
2012-03-23 06:30:43 +00:00
|
|
|
elif next_command == self.SUB_GENERATE_PKGINFO:
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["triggerEvent", "bb.event.RequestPackageInfo()"])
|
2012-04-24 08:16:12 +00:00
|
|
|
elif next_command == self.SUB_SANITY_CHECK:
|
|
|
|
self.runCommand(["triggerEvent", "bb.event.SanityCheck()"])
|
2012-10-11 11:45:07 +00:00
|
|
|
elif next_command == self.SUB_NETWORK_TEST:
|
|
|
|
self.runCommand(["triggerEvent", "bb.event.NetworkTest()"])
|
2012-03-23 06:30:43 +00:00
|
|
|
elif next_command == self.SUB_BUILD_RECIPES:
|
2011-11-28 06:32:40 +00:00
|
|
|
self.clear_busy()
|
2011-09-19 22:25:45 +00:00
|
|
|
self.building = True
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["buildTargets", self.recipe_queue, self.default_task])
|
2011-11-28 06:32:40 +00:00
|
|
|
self.recipe_queue = []
|
2012-03-23 06:30:43 +00:00
|
|
|
elif next_command == self.SUB_BUILD_IMAGE:
|
2011-11-28 06:32:40 +00:00
|
|
|
self.clear_busy()
|
|
|
|
self.building = True
|
2012-04-12 17:04:50 +00:00
|
|
|
targets = [self.image]
|
2012-04-01 12:14:15 +00:00
|
|
|
if self.toolchain_packages:
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("TOOLCHAIN_TARGET_TASK", " ".join(self.toolchain_packages), "local.conf")
|
2012-04-12 17:04:50 +00:00
|
|
|
targets.append(self.toolchain)
|
2012-12-12 11:51:51 +00:00
|
|
|
if targets[0] == "hob-image":
|
2013-09-03 07:28:01 +00:00
|
|
|
self.set_var_in_file("LINGUAS_INSTALL", "", "local.conf")
|
2012-12-12 11:51:51 +00:00
|
|
|
hobImage = self.runCommand(["matchFile", "hob-image.bb"])
|
2013-07-25 07:21:06 +00:00
|
|
|
if self.base_image != "Start with an empty image recipe":
|
2012-12-14 15:35:47 +00:00
|
|
|
baseImage = self.runCommand(["matchFile", self.base_image + ".bb"])
|
2013-07-29 10:02:24 +00:00
|
|
|
version = self.runCommand(["generateNewImage", hobImage, baseImage, self.package_queue, True, ""])
|
2012-12-14 15:35:47 +00:00
|
|
|
targets[0] += version
|
|
|
|
self.recipe_model.set_custom_image_version(version)
|
2012-12-12 11:51:51 +00:00
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["buildTargets", targets, self.default_task])
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-09-19 10:25:42 +00:00
|
|
|
def display_error(self):
|
|
|
|
self.clear_busy()
|
|
|
|
self.emit("command-failed", self.error_msg)
|
|
|
|
self.error_msg = ""
|
|
|
|
if self.building:
|
|
|
|
self.building = False
|
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def handle_event(self, event):
|
2011-02-02 13:02:43 +00:00
|
|
|
if not event:
|
2011-11-28 06:32:40 +00:00
|
|
|
return
|
2011-02-02 13:02:43 +00:00
|
|
|
if self.building:
|
2011-07-28 22:21:14 +00:00
|
|
|
self.current_phase = "building"
|
2011-11-28 06:32:40 +00:00
|
|
|
self.build.handle_event(event)
|
|
|
|
|
|
|
|
if isinstance(event, bb.event.PackageInfo):
|
|
|
|
self.package_model.populate(event._pkginfolist)
|
2012-05-23 15:19:44 +00:00
|
|
|
self.emit("package-populated")
|
2011-11-28 06:32:40 +00:00
|
|
|
self.run_next_command()
|
|
|
|
|
2012-04-24 08:16:12 +00:00
|
|
|
elif isinstance(event, bb.event.SanityCheckPassed):
|
2013-02-12 13:27:22 +00:00
|
|
|
reparse = self.runCommand(["getVariable", "BB_INVALIDCONF"]) or None
|
|
|
|
if reparse is True:
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("BB_INVALIDCONF", False, "local.conf")
|
|
|
|
self.runCommand(["parseConfigurationFiles", "conf/.hob.conf", ""])
|
2012-04-24 08:16:12 +00:00
|
|
|
self.run_next_command()
|
|
|
|
|
2012-05-28 17:10:39 +00:00
|
|
|
elif isinstance(event, bb.event.SanityCheckFailed):
|
2012-09-26 13:59:57 +00:00
|
|
|
self.emit("sanity-failed", event._msg, event._network_error)
|
2012-05-28 17:10:39 +00:00
|
|
|
|
2012-03-29 12:01:07 +00:00
|
|
|
elif isinstance(event, logging.LogRecord):
|
2012-09-21 14:47:23 +00:00
|
|
|
if not self.building:
|
|
|
|
if event.levelno >= logging.ERROR:
|
|
|
|
formatter = bb.msg.BBLogFormatter()
|
|
|
|
msg = formatter.format(event)
|
|
|
|
self.error_msg += msg + '\n'
|
2013-01-21 14:40:07 +00:00
|
|
|
elif event.levelno >= logging.WARNING and self.parsing == True:
|
|
|
|
formatter = bb.msg.BBLogFormatter()
|
|
|
|
msg = formatter.format(event)
|
|
|
|
warn_msg = msg + '\n'
|
|
|
|
self.emit("parsing-warning", warn_msg)
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2011-02-02 13:02:43 +00:00
|
|
|
elif isinstance(event, bb.event.TargetsTreeGenerated):
|
2011-07-28 22:21:14 +00:00
|
|
|
self.current_phase = "data generation"
|
2011-02-02 13:02:43 +00:00
|
|
|
if event._model:
|
2011-11-28 06:32:40 +00:00
|
|
|
self.recipe_model.populate(event._model)
|
2012-05-23 15:19:44 +00:00
|
|
|
self.emit("recipe-populated")
|
2011-02-02 13:02:43 +00:00
|
|
|
elif isinstance(event, bb.event.ConfigFilesFound):
|
2011-07-28 22:21:14 +00:00
|
|
|
self.current_phase = "configuration lookup"
|
2011-02-02 13:02:43 +00:00
|
|
|
var = event._variable
|
2011-11-28 06:32:40 +00:00
|
|
|
values = event._values
|
|
|
|
values.sort()
|
|
|
|
self.emit("config-updated", var, values)
|
2011-07-01 22:58:50 +00:00
|
|
|
elif isinstance(event, bb.event.ConfigFilePathFound):
|
2011-07-28 22:21:14 +00:00
|
|
|
self.current_phase = "configuration lookup"
|
2011-07-01 22:58:50 +00:00
|
|
|
elif isinstance(event, bb.event.FilesMatchingFound):
|
2011-07-28 22:21:14 +00:00
|
|
|
self.current_phase = "configuration lookup"
|
2011-07-01 22:58:50 +00:00
|
|
|
# FIXME: hard coding, should at least be a variable shared between
|
|
|
|
# here and the caller
|
|
|
|
if event._pattern == "rootfs_":
|
|
|
|
formats = []
|
|
|
|
for match in event._matches:
|
|
|
|
classname, sep, cls = match.rpartition(".")
|
|
|
|
fs, sep, format = classname.rpartition("_")
|
|
|
|
formats.append(format)
|
|
|
|
formats.sort()
|
2011-11-28 06:32:40 +00:00
|
|
|
self.emit("package-formats-updated", formats)
|
2011-02-02 13:02:43 +00:00
|
|
|
elif isinstance(event, bb.command.CommandCompleted):
|
2011-07-28 22:21:14 +00:00
|
|
|
self.current_phase = None
|
2011-02-02 13:02:43 +00:00
|
|
|
self.run_next_command()
|
2011-07-01 22:58:50 +00:00
|
|
|
elif isinstance(event, bb.command.CommandFailed):
|
2011-11-28 06:32:40 +00:00
|
|
|
self.commands_async = []
|
2012-09-19 10:25:42 +00:00
|
|
|
self.display_error()
|
2011-11-28 06:32:40 +00:00
|
|
|
elif isinstance(event, (bb.event.ParseStarted,
|
|
|
|
bb.event.CacheLoadStarted,
|
|
|
|
bb.event.TreeDataPreparationStarted,
|
|
|
|
)):
|
|
|
|
message = {}
|
|
|
|
message["eventname"] = bb.event.getName(event)
|
|
|
|
message["current"] = 0
|
|
|
|
message["total"] = None
|
2012-10-31 13:31:07 +00:00
|
|
|
message["title"] = "Parsing recipes"
|
2011-11-28 06:32:40 +00:00
|
|
|
self.emit("parsing-started", message)
|
2013-01-21 14:40:07 +00:00
|
|
|
if isinstance(event, bb.event.ParseStarted):
|
|
|
|
self.parsing = True
|
2011-11-28 06:32:40 +00:00
|
|
|
elif isinstance(event, (bb.event.ParseProgress,
|
|
|
|
bb.event.CacheLoadProgress,
|
|
|
|
bb.event.TreeDataPreparationProgress)):
|
|
|
|
message = {}
|
|
|
|
message["eventname"] = bb.event.getName(event)
|
|
|
|
message["current"] = event.current
|
|
|
|
message["total"] = event.total
|
2012-10-31 13:31:07 +00:00
|
|
|
message["title"] = "Parsing recipes"
|
2011-11-28 06:32:40 +00:00
|
|
|
self.emit("parsing", message)
|
|
|
|
elif isinstance(event, (bb.event.ParseCompleted,
|
|
|
|
bb.event.CacheLoadCompleted,
|
|
|
|
bb.event.TreeDataPreparationCompleted)):
|
|
|
|
message = {}
|
|
|
|
message["eventname"] = bb.event.getName(event)
|
|
|
|
message["current"] = event.total
|
|
|
|
message["total"] = event.total
|
2012-10-31 13:31:07 +00:00
|
|
|
message["title"] = "Parsing recipes"
|
2011-11-28 06:32:40 +00:00
|
|
|
self.emit("parsing-completed", message)
|
2013-01-21 14:40:07 +00:00
|
|
|
if isinstance(event, bb.event.ParseCompleted):
|
|
|
|
self.parsing = False
|
2012-10-11 11:45:07 +00:00
|
|
|
elif isinstance(event, bb.event.NetworkTestFailed):
|
|
|
|
self.emit("network-failed")
|
|
|
|
self.run_next_command()
|
|
|
|
elif isinstance(event, bb.event.NetworkTestPassed):
|
|
|
|
self.emit("network-passed")
|
|
|
|
self.run_next_command()
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-09-19 10:25:42 +00:00
|
|
|
if self.error_msg and not self.commands_async:
|
|
|
|
self.display_error()
|
|
|
|
|
2011-02-02 13:02:43 +00:00
|
|
|
return
|
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def init_cooker(self):
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["initCooker"])
|
2013-06-20 14:21:17 +00:00
|
|
|
self.runCommand(["createConfigFile", ".hob.conf"])
|
|
|
|
|
|
|
|
def reset_cooker(self):
|
|
|
|
self.runCommand(["enableDataTracking"])
|
|
|
|
self.runCommand(["resetCooker"])
|
|
|
|
self.runCommand(["disableDataTracking"])
|
2011-11-28 06:32:40 +00:00
|
|
|
|
|
|
|
def set_extra_inherit(self, bbclass):
|
2012-04-15 16:09:25 +00:00
|
|
|
inherits = self.runCommand(["getVariable", "INHERIT"]) or ""
|
2011-11-28 06:32:40 +00:00
|
|
|
inherits = inherits + " " + bbclass
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("INHERIT", inherits, ".hob.conf")
|
2011-11-28 06:32:40 +00:00
|
|
|
|
|
|
|
def set_bblayers(self, bblayers):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("BBLAYERS", " ".join(bblayers), "bblayers.conf")
|
2011-02-02 13:02:43 +00:00
|
|
|
|
|
|
|
def set_machine(self, machine):
|
2012-04-01 12:14:09 +00:00
|
|
|
if machine:
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("MACHINE", machine, "local.conf")
|
2011-07-01 22:58:50 +00:00
|
|
|
|
|
|
|
def set_sdk_machine(self, sdk_machine):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("SDKMACHINE", sdk_machine, "local.conf")
|
2011-02-02 13:02:43 +00:00
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def set_image_fstypes(self, image_fstypes):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("IMAGE_FSTYPES", image_fstypes, "local.conf")
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2011-02-02 13:02:43 +00:00
|
|
|
def set_distro(self, distro):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("DISTRO", distro, "local.conf")
|
2011-02-02 13:02:43 +00:00
|
|
|
|
2011-07-01 22:58:50 +00:00
|
|
|
def set_package_format(self, format):
|
2011-11-28 06:32:40 +00:00
|
|
|
package_classes = ""
|
|
|
|
for pkgfmt in format.split():
|
|
|
|
package_classes += ("package_%s" % pkgfmt + " ")
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("PACKAGE_CLASSES", package_classes, "local.conf")
|
2011-07-01 22:58:50 +00:00
|
|
|
|
|
|
|
def set_bbthreads(self, threads):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("BB_NUMBER_THREADS", threads, "local.conf")
|
2011-07-01 22:58:50 +00:00
|
|
|
|
|
|
|
def set_pmake(self, threads):
|
|
|
|
pmake = "-j %s" % threads
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("PARALLEL_MAKE", pmake, "local.conf")
|
2011-07-01 22:58:50 +00:00
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def set_dl_dir(self, directory):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("DL_DIR", directory, "local.conf")
|
2011-11-28 06:32:40 +00:00
|
|
|
|
|
|
|
def set_sstate_dir(self, directory):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("SSTATE_DIR", directory, "local.conf")
|
2011-07-15 17:30:48 +00:00
|
|
|
|
2012-09-26 10:44:08 +00:00
|
|
|
def set_sstate_mirrors(self, url):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("SSTATE_MIRRORS", url, "local.conf")
|
2011-09-23 20:13:17 +00:00
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def set_extra_size(self, image_extra_size):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("IMAGE_ROOTFS_EXTRA_SPACE", str(image_extra_size), "local.conf")
|
2011-07-15 17:30:48 +00:00
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def set_rootfs_size(self, image_rootfs_size):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("IMAGE_ROOTFS_SIZE", str(image_rootfs_size), "local.conf")
|
2011-07-15 17:30:48 +00:00
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def set_incompatible_license(self, incompat_license):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("INCOMPATIBLE_LICENSE", incompat_license, "local.conf")
|
2011-07-15 17:30:48 +00:00
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def set_extra_config(self, extra_setting):
|
|
|
|
for key in extra_setting.keys():
|
|
|
|
value = extra_setting[key]
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file(key, value, "local.conf")
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-03-22 06:20:03 +00:00
|
|
|
def set_http_proxy(self, http_proxy):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("http_proxy", http_proxy, "local.conf")
|
2012-03-22 06:20:03 +00:00
|
|
|
|
|
|
|
def set_https_proxy(self, https_proxy):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("https_proxy", https_proxy, "local.conf")
|
2012-03-22 06:20:03 +00:00
|
|
|
|
|
|
|
def set_ftp_proxy(self, ftp_proxy):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("ftp_proxy", ftp_proxy, "local.conf")
|
2012-03-22 06:20:03 +00:00
|
|
|
|
2013-04-08 16:06:33 +00:00
|
|
|
def set_socks_proxy(self, socks_proxy):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("all_proxy", socks_proxy, "local.conf")
|
2012-03-22 06:20:03 +00:00
|
|
|
|
|
|
|
def set_cvs_proxy(self, host, port):
|
2013-06-20 14:21:17 +00:00
|
|
|
self.set_var_in_file("CVS_PROXY_HOST", host, "local.conf")
|
|
|
|
self.set_var_in_file("CVS_PROXY_PORT", port, "local.conf")
|
2012-03-22 06:20:03 +00:00
|
|
|
|
2012-04-09 14:13:43 +00:00
|
|
|
def request_package_info(self):
|
2012-03-23 06:30:43 +00:00
|
|
|
self.commands_async.append(self.SUB_GENERATE_PKGINFO)
|
2011-11-28 06:32:40 +00:00
|
|
|
self.run_next_command(self.POPULATE_PACKAGEINFO)
|
|
|
|
|
2012-04-24 08:16:12 +00:00
|
|
|
def trigger_sanity_check(self):
|
|
|
|
self.commands_async.append(self.SUB_SANITY_CHECK)
|
|
|
|
self.run_next_command(self.SANITY_CHECK)
|
|
|
|
|
2012-10-11 11:45:07 +00:00
|
|
|
def trigger_network_test(self):
|
|
|
|
self.commands_async.append(self.SUB_NETWORK_TEST)
|
|
|
|
self.run_next_command(self.NETWORK_TEST)
|
|
|
|
|
2012-03-23 06:30:43 +00:00
|
|
|
def generate_configuration(self):
|
2012-04-15 07:26:38 +00:00
|
|
|
self.commands_async.append(self.SUB_PARSE_CONFIG)
|
2012-03-23 06:30:43 +00:00
|
|
|
self.commands_async.append(self.SUB_PATH_LAYERS)
|
|
|
|
self.commands_async.append(self.SUB_FILES_DISTRO)
|
|
|
|
self.commands_async.append(self.SUB_FILES_MACH)
|
|
|
|
self.commands_async.append(self.SUB_FILES_SDKMACH)
|
|
|
|
self.commands_async.append(self.SUB_MATCH_CLASS)
|
|
|
|
self.run_next_command(self.GENERATE_CONFIGURATION)
|
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def generate_recipes(self):
|
2012-03-23 06:30:43 +00:00
|
|
|
self.commands_async.append(self.SUB_PARSE_CONFIG)
|
|
|
|
self.commands_async.append(self.SUB_GNERATE_TGTS)
|
2011-11-28 06:32:40 +00:00
|
|
|
self.run_next_command(self.GENERATE_RECIPES)
|
2012-06-04 10:52:13 +00:00
|
|
|
|
2012-04-12 17:14:14 +00:00
|
|
|
def generate_packages(self, tgts, default_task="build"):
|
2011-11-28 06:32:40 +00:00
|
|
|
targets = []
|
|
|
|
targets.extend(tgts)
|
|
|
|
self.recipe_queue = targets
|
2012-04-12 17:14:14 +00:00
|
|
|
self.default_task = default_task
|
2012-03-23 06:30:43 +00:00
|
|
|
self.commands_async.append(self.SUB_PARSE_CONFIG)
|
|
|
|
self.commands_async.append(self.SUB_BUILD_RECIPES)
|
2011-11-28 06:32:40 +00:00
|
|
|
self.run_next_command(self.GENERATE_PACKAGES)
|
|
|
|
|
2012-12-12 11:51:51 +00:00
|
|
|
def generate_image(self, image, base_image, toolchain, image_packages=[], toolchain_packages=[], default_task="build"):
|
2012-04-12 17:04:50 +00:00
|
|
|
self.image = image
|
2012-12-12 11:51:51 +00:00
|
|
|
self.base_image = base_image
|
2012-04-12 17:04:50 +00:00
|
|
|
self.toolchain = toolchain
|
|
|
|
self.package_queue = image_packages
|
2012-04-01 12:14:15 +00:00
|
|
|
self.toolchain_packages = toolchain_packages
|
2012-04-12 17:14:14 +00:00
|
|
|
self.default_task = default_task
|
2012-03-23 06:30:43 +00:00
|
|
|
self.commands_async.append(self.SUB_PARSE_CONFIG)
|
|
|
|
self.commands_async.append(self.SUB_BUILD_IMAGE)
|
2011-11-28 06:32:40 +00:00
|
|
|
self.run_next_command(self.GENERATE_IMAGE)
|
|
|
|
|
2013-07-29 10:02:24 +00:00
|
|
|
def generate_new_image(self, image, base_image, package_queue, description):
|
2013-07-29 09:55:06 +00:00
|
|
|
base_image = self.runCommand(["matchFile", self.base_image + ".bb"])
|
2013-07-29 10:02:24 +00:00
|
|
|
self.runCommand(["generateNewImage", image, base_image, package_queue, False, description])
|
2013-07-29 09:55:06 +00:00
|
|
|
|
|
|
|
def ensure_dir(self, directory):
|
|
|
|
self.runCommand(["ensureDir", directory])
|
|
|
|
|
2012-03-29 12:54:50 +00:00
|
|
|
def build_succeeded_async(self):
|
|
|
|
self.building = False
|
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def build_failed_async(self):
|
|
|
|
self.initcmd = None
|
|
|
|
self.commands_async = []
|
|
|
|
self.building = False
|
2011-02-02 13:02:43 +00:00
|
|
|
|
2012-03-13 09:10:26 +00:00
|
|
|
def cancel_parse(self):
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["stateStop"])
|
2012-03-13 09:10:26 +00:00
|
|
|
|
2011-07-01 22:58:50 +00:00
|
|
|
def cancel_build(self, force=False):
|
|
|
|
if force:
|
|
|
|
# Force the cooker to stop as quickly as possible
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["stateStop"])
|
2011-07-01 22:58:50 +00:00
|
|
|
else:
|
|
|
|
# Wait for tasks to complete before shutting down, this helps
|
|
|
|
# leave the workdir in a usable state
|
2012-04-15 16:09:25 +00:00
|
|
|
self.runCommand(["stateShutdown"])
|
2011-07-01 22:58:50 +00:00
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def reset_build(self):
|
|
|
|
self.build.reset()
|
|
|
|
|
2012-08-02 11:06:01 +00:00
|
|
|
def get_logfile(self):
|
2012-11-08 13:03:42 +00:00
|
|
|
return self.server.runCommand(["getVariable", "BB_CONSOLELOG"])[0]
|
2012-08-02 11:06:01 +00:00
|
|
|
|
2013-07-25 07:25:38 +00:00
|
|
|
def get_topdir(self):
|
|
|
|
return self.runCommand(["getVariable", "TOPDIR"]) or ""
|
|
|
|
|
2012-04-01 12:14:12 +00:00
|
|
|
def _remove_redundant(self, string):
|
|
|
|
ret = []
|
|
|
|
for i in string.split():
|
|
|
|
if i not in ret:
|
|
|
|
ret.append(i)
|
|
|
|
return " ".join(ret)
|
|
|
|
|
2013-01-25 14:10:12 +00:00
|
|
|
def set_var_in_file(self, var, val, default_file=None):
|
2013-06-20 10:19:42 +00:00
|
|
|
self.runCommand(["enableDataTracking"])
|
2013-07-29 11:44:58 +00:00
|
|
|
self.server.runCommand(["setVarFile", var, val, default_file, "set"])
|
2013-06-20 10:19:42 +00:00
|
|
|
self.runCommand(["disableDataTracking"])
|
2013-01-25 14:10:12 +00:00
|
|
|
|
2013-07-29 11:44:58 +00:00
|
|
|
def append_var_in_file(self, var, val, default_file=None):
|
|
|
|
self.server.runCommand(["setVarFile", var, val, default_file, "append"])
|
|
|
|
|
|
|
|
def append_to_bbfiles(self, val):
|
|
|
|
bbfiles = self.runCommand(["getVariable", "BBFILES", "False"]) or ""
|
|
|
|
bbfiles = bbfiles.split()
|
|
|
|
if val not in bbfiles:
|
|
|
|
self.append_var_in_file("BBFILES", val, "local.conf")
|
|
|
|
|
2011-11-28 06:32:40 +00:00
|
|
|
def get_parameters(self):
|
|
|
|
# retrieve the parameters from bitbake
|
|
|
|
params = {}
|
2012-04-15 16:09:25 +00:00
|
|
|
params["core_base"] = self.runCommand(["getVariable", "COREBASE"]) or ""
|
2011-11-28 06:32:40 +00:00
|
|
|
hob_layer = params["core_base"] + "/meta-hob"
|
2012-04-15 16:09:25 +00:00
|
|
|
params["layer"] = self.runCommand(["getVariable", "BBLAYERS"]) or ""
|
2012-11-27 14:41:31 +00:00
|
|
|
params["layers_non_removable"] = self.runCommand(["getVariable", "BBLAYERS_NON_REMOVABLE"]) or ""
|
2012-03-29 12:01:08 +00:00
|
|
|
if hob_layer not in params["layer"].split():
|
|
|
|
params["layer"] += (" " + hob_layer)
|
2012-11-26 07:42:36 +00:00
|
|
|
if hob_layer not in params["layers_non_removable"].split():
|
|
|
|
params["layers_non_removable"] += (" " + hob_layer)
|
2012-04-15 16:09:25 +00:00
|
|
|
params["dldir"] = self.runCommand(["getVariable", "DL_DIR"]) or ""
|
|
|
|
params["machine"] = self.runCommand(["getVariable", "MACHINE"]) or ""
|
|
|
|
params["distro"] = self.runCommand(["getVariable", "DISTRO"]) or "defaultsetup"
|
|
|
|
params["pclass"] = self.runCommand(["getVariable", "PACKAGE_CLASSES"]) or ""
|
|
|
|
params["sstatedir"] = self.runCommand(["getVariable", "SSTATE_DIR"]) or ""
|
2012-09-26 10:44:08 +00:00
|
|
|
params["sstatemirror"] = self.runCommand(["getVariable", "SSTATE_MIRRORS"]) or ""
|
2012-04-15 16:09:25 +00:00
|
|
|
|
|
|
|
num_threads = self.runCommand(["getCpuCount"])
|
2011-11-28 06:32:40 +00:00
|
|
|
if not num_threads:
|
|
|
|
num_threads = 1
|
|
|
|
max_threads = 65536
|
|
|
|
else:
|
2012-04-02 08:29:15 +00:00
|
|
|
try:
|
|
|
|
num_threads = int(num_threads)
|
|
|
|
max_threads = 16 * num_threads
|
|
|
|
except:
|
|
|
|
num_threads = 1
|
|
|
|
max_threads = 65536
|
2011-11-28 06:32:40 +00:00
|
|
|
params["max_threads"] = max_threads
|
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
bbthread = self.runCommand(["getVariable", "BB_NUMBER_THREADS"])
|
2011-11-28 06:32:40 +00:00
|
|
|
if not bbthread:
|
|
|
|
bbthread = num_threads
|
|
|
|
else:
|
2012-04-02 08:29:15 +00:00
|
|
|
try:
|
|
|
|
bbthread = int(bbthread)
|
|
|
|
except:
|
|
|
|
bbthread = num_threads
|
2011-11-28 06:32:40 +00:00
|
|
|
params["bbthread"] = bbthread
|
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
pmake = self.runCommand(["getVariable", "PARALLEL_MAKE"])
|
2011-11-28 06:32:40 +00:00
|
|
|
if not pmake:
|
|
|
|
pmake = num_threads
|
|
|
|
elif isinstance(pmake, int):
|
|
|
|
pass
|
|
|
|
else:
|
2012-04-02 08:29:15 +00:00
|
|
|
try:
|
|
|
|
pmake = int(pmake.lstrip("-j "))
|
|
|
|
except:
|
|
|
|
pmake = num_threads
|
2012-04-02 08:29:20 +00:00
|
|
|
params["pmake"] = "-j %s" % pmake
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
params["image_addr"] = self.runCommand(["getVariable", "DEPLOY_DIR_IMAGE"]) or ""
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
image_extra_size = self.runCommand(["getVariable", "IMAGE_ROOTFS_EXTRA_SPACE"])
|
2011-11-28 06:32:40 +00:00
|
|
|
if not image_extra_size:
|
|
|
|
image_extra_size = 0
|
|
|
|
else:
|
2012-04-02 08:29:15 +00:00
|
|
|
try:
|
|
|
|
image_extra_size = int(image_extra_size)
|
|
|
|
except:
|
|
|
|
image_extra_size = 0
|
2011-11-28 06:32:40 +00:00
|
|
|
params["image_extra_size"] = image_extra_size
|
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
image_rootfs_size = self.runCommand(["getVariable", "IMAGE_ROOTFS_SIZE"])
|
2011-11-28 06:32:40 +00:00
|
|
|
if not image_rootfs_size:
|
|
|
|
image_rootfs_size = 0
|
|
|
|
else:
|
2012-04-02 08:29:15 +00:00
|
|
|
try:
|
|
|
|
image_rootfs_size = int(image_rootfs_size)
|
|
|
|
except:
|
|
|
|
image_rootfs_size = 0
|
2011-11-28 06:32:40 +00:00
|
|
|
params["image_rootfs_size"] = image_rootfs_size
|
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
image_overhead_factor = self.runCommand(["getVariable", "IMAGE_OVERHEAD_FACTOR"])
|
2011-11-28 06:32:40 +00:00
|
|
|
if not image_overhead_factor:
|
|
|
|
image_overhead_factor = 1
|
|
|
|
else:
|
2012-04-02 08:29:15 +00:00
|
|
|
try:
|
|
|
|
image_overhead_factor = float(image_overhead_factor)
|
|
|
|
except:
|
|
|
|
image_overhead_factor = 1
|
2011-11-28 06:32:40 +00:00
|
|
|
params['image_overhead_factor'] = image_overhead_factor
|
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
params["incompat_license"] = self._remove_redundant(self.runCommand(["getVariable", "INCOMPATIBLE_LICENSE"]) or "")
|
|
|
|
params["sdk_machine"] = self.runCommand(["getVariable", "SDKMACHINE"]) or self.runCommand(["getVariable", "SDK_ARCH"]) or ""
|
2011-11-28 06:32:40 +00:00
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
params["image_fstypes"] = self._remove_redundant(self.runCommand(["getVariable", "IMAGE_FSTYPES"]) or "")
|
2012-02-29 14:15:02 +00:00
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
params["image_types"] = self._remove_redundant(self.runCommand(["getVariable", "IMAGE_TYPES"]) or "")
|
2012-03-16 08:48:13 +00:00
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
params["conf_version"] = self.runCommand(["getVariable", "CONF_VERSION"]) or ""
|
|
|
|
params["lconf_version"] = self.runCommand(["getVariable", "LCONF_VERSION"]) or ""
|
2012-03-23 17:12:09 +00:00
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
params["runnable_image_types"] = self._remove_redundant(self.runCommand(["getVariable", "RUNNABLE_IMAGE_TYPES"]) or "")
|
|
|
|
params["runnable_machine_patterns"] = self._remove_redundant(self.runCommand(["getVariable", "RUNNABLE_MACHINE_PATTERNS"]) or "")
|
|
|
|
params["deployable_image_types"] = self._remove_redundant(self.runCommand(["getVariable", "DEPLOYABLE_IMAGE_TYPES"]) or "")
|
2012-06-04 10:52:13 +00:00
|
|
|
params["kernel_image_type"] = self.runCommand(["getVariable", "KERNEL_IMAGETYPE"]) or ""
|
2012-04-15 16:09:25 +00:00
|
|
|
params["tmpdir"] = self.runCommand(["getVariable", "TMPDIR"]) or ""
|
|
|
|
params["distro_version"] = self.runCommand(["getVariable", "DISTRO_VERSION"]) or ""
|
|
|
|
params["target_os"] = self.runCommand(["getVariable", "TARGET_OS"]) or ""
|
|
|
|
params["target_arch"] = self.runCommand(["getVariable", "TARGET_ARCH"]) or ""
|
|
|
|
params["tune_pkgarch"] = self.runCommand(["getVariable", "TUNE_PKGARCH"]) or ""
|
|
|
|
params["bb_version"] = self.runCommand(["getVariable", "BB_MIN_VERSION"]) or ""
|
2012-03-22 06:20:03 +00:00
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
params["default_task"] = self.runCommand(["getVariable", "BB_DEFAULT_TASK"]) or "build"
|
2012-04-12 17:14:14 +00:00
|
|
|
|
2013-04-08 16:06:33 +00:00
|
|
|
params["socks_proxy"] = self.runCommand(["getVariable", "all_proxy"]) or ""
|
2012-04-15 16:09:25 +00:00
|
|
|
params["http_proxy"] = self.runCommand(["getVariable", "http_proxy"]) or ""
|
|
|
|
params["ftp_proxy"] = self.runCommand(["getVariable", "ftp_proxy"]) or ""
|
|
|
|
params["https_proxy"] = self.runCommand(["getVariable", "https_proxy"]) or ""
|
2012-03-22 06:20:03 +00:00
|
|
|
|
2012-04-15 16:09:25 +00:00
|
|
|
params["cvs_proxy_host"] = self.runCommand(["getVariable", "CVS_PROXY_HOST"]) or ""
|
|
|
|
params["cvs_proxy_port"] = self.runCommand(["getVariable", "CVS_PROXY_PORT"]) or ""
|
2012-03-22 06:20:03 +00:00
|
|
|
|
2012-05-22 03:08:34 +00:00
|
|
|
params["image_white_pattern"] = self.runCommand(["getVariable", "BBUI_IMAGE_WHITE_PATTERN"]) or ""
|
|
|
|
params["image_black_pattern"] = self.runCommand(["getVariable", "BBUI_IMAGE_BLACK_PATTERN"]) or ""
|
2011-11-28 06:32:40 +00:00
|
|
|
return params
|