diff options
Diffstat (limited to 'poky/scripts')
-rwxr-xr-x | poky/scripts/buildhistory-collect-srcrevs | 1 | ||||
-rwxr-xr-x | poky/scripts/contrib/graph-tool | 100 | ||||
-rwxr-xr-x | poky/scripts/install-buildtools | 38 | ||||
-rw-r--r-- | poky/scripts/lib/devtool/deploy.py | 4 | ||||
-rw-r--r-- | poky/scripts/lib/recipetool/create.py | 1 | ||||
-rw-r--r-- | poky/scripts/lib/recipetool/edit.py | 2 | ||||
-rw-r--r-- | poky/scripts/lib/wic/plugins/imager/direct.py | 2 | ||||
-rwxr-xr-x | poky/scripts/runqemu | 14 |
8 files changed, 104 insertions, 58 deletions
diff --git a/poky/scripts/buildhistory-collect-srcrevs b/poky/scripts/buildhistory-collect-srcrevs index c4d203ff4d..340bee78bb 100755 --- a/poky/scripts/buildhistory-collect-srcrevs +++ b/poky/scripts/buildhistory-collect-srcrevs @@ -59,6 +59,7 @@ def main(): all_srcrevs = collections.defaultdict(list) for root, dirs, files in os.walk(options.buildhistory_dir): + dirs.sort() if '.git' in dirs: dirs.remove('.git') for fn in files: diff --git a/poky/scripts/contrib/graph-tool b/poky/scripts/contrib/graph-tool index 6d2e68b82e..26488930e0 100755 --- a/poky/scripts/contrib/graph-tool +++ b/poky/scripts/contrib/graph-tool @@ -11,6 +11,13 @@ # import sys +import os +import argparse + +scripts_lib_path = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'lib')) +sys.path.insert(0, scripts_lib_path) +import argparse_oe + def get_path_networkx(dotfile, fromnode, tonode): try: @@ -34,47 +41,78 @@ def get_path_networkx(dotfile, fromnode, tonode): return networkx.all_simple_paths(graph, source=fromnode, target=tonode) -def find_paths(args, usage): - if len(args) < 3: - usage() - sys.exit(1) - - fromnode = args[1] - tonode = args[2] - +def find_paths(args): path = None - for path in get_path_networkx(args[0], fromnode, tonode): + for path in get_path_networkx(args.dotfile, args.fromnode, args.tonode): print(" -> ".join(map(str, path))) if not path: - print("ERROR: no path from %s to %s in graph" % (fromnode, tonode)) - sys.exit(1) + print("ERROR: no path from %s to %s in graph" % (args.fromnode, args.tonode)) + return 1 + + +def filter_graph(args): + import fnmatch + + exclude_tasks = [] + if args.exclude_tasks: + for task in args.exclude_tasks.split(','): + if not task.startswith('do_'): + task = 'do_%s' % task + exclude_tasks.append(task) + + def checkref(strval): + strval = strval.strip().strip('"') + target, taskname = strval.rsplit('.', 1) + if exclude_tasks: + for extask in exclude_tasks: + if fnmatch.fnmatch(taskname, extask): + return False + if strval in args.ref or target in args.ref: + return True + return False + + with open(args.infile, 'r') as f: + for line in f: + line = line.rstrip() + if line.startswith(('digraph', '}')): + print(line) + elif '->' in line: + linesplit = line.split('->') + if checkref(linesplit[0]) and checkref(linesplit[1]): + print(line) + elif (not args.no_nodes) and checkref(line.split()[0]): + print(line) + def main(): - import optparse - parser = optparse.OptionParser( - usage = '''%prog [options] <command> <arguments> + parser = argparse_oe.ArgumentParser(description='Small utility for working with .dot graph files') -Available commands: - find-paths <dotfile> <from> <to> - Find all of the paths between two nodes in a dot graph''') + subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>') + subparsers.required = True - #parser.add_option("-d", "--debug", - # help = "Report all SRCREV values, not just ones where AUTOREV has been used", - # action="store_true", dest="debug", default=False) + parser_find_paths = subparsers.add_parser('find-paths', + help='Find all of the paths between two nodes in a dot graph', + description='Finds all of the paths between two nodes in a dot graph') + parser_find_paths.add_argument('dotfile', help='.dot graph to search in') + parser_find_paths.add_argument('fromnode', help='starting node name') + parser_find_paths.add_argument('tonode', help='ending node name') + parser_find_paths.set_defaults(func=find_paths) - options, args = parser.parse_args(sys.argv) - args = args[1:] + parser_filter = subparsers.add_parser('filter', + help='Pare down a task graph to contain only the specified references', + description='Pares down a task-depends.dot graph produced by bitbake -g to contain only the specified references') + parser_filter.add_argument('infile', help='Input file') + parser_filter.add_argument('ref', nargs='+', help='Reference to include (either recipe/target name or full target.taskname specification)') + parser_filter.add_argument('-n', '--no-nodes', action='store_true', help='Skip node formatting lines') + parser_filter.add_argument('-x', '--exclude-tasks', help='Comma-separated list of tasks to exclude (do_ prefix optional, wildcards allowed)') + parser_filter.set_defaults(func=filter_graph) - if len(args) < 1: - parser.print_help() - sys.exit(1) + args = parser.parse_args() - if args[0] == "find-paths": - find_paths(args[1:], parser.print_help) - else: - parser.print_help() - sys.exit(1) + ret = args.func(args) + return ret if __name__ == "__main__": - main() + ret = main() + sys.exit(ret) diff --git a/poky/scripts/install-buildtools b/poky/scripts/install-buildtools index c6b3a1eed7..7118f48be9 100755 --- a/poky/scripts/install-buildtools +++ b/poky/scripts/install-buildtools @@ -35,6 +35,7 @@ import argparse import logging import os +import platform import re import shutil import shlex @@ -56,9 +57,9 @@ logger = scriptutils.logger_create(PROGNAME, stream=sys.stdout) DEFAULT_INSTALL_DIR = os.path.join(os.path.split(scripts_path)[0],'buildtools') DEFAULT_BASE_URL = 'http://downloads.yoctoproject.org/releases/yocto' -DEFAULT_RELEASE = 'yocto-3.1' -DEFAULT_INSTALLER_VERSION = '3.1' -DEFAULT_BUILDDATE = '' +DEFAULT_RELEASE = 'yocto-3.2_M1' +DEFAULT_INSTALLER_VERSION = '3.1+snapshot' +DEFAULT_BUILDDATE = '20200617' # Python version sanity check if not (sys.version_info.major == 3 and sys.version_info.minor >= 4): @@ -112,6 +113,7 @@ def main(): release = "" buildtools_url = "" install_dir = "" + arch = platform.machine() parser = argparse.ArgumentParser( description="Buildtools installation helper", @@ -152,9 +154,11 @@ def main(): group.add_argument('--without-extended-buildtools', action='store_false', dest='with_extended_buildtools', help='disable extended buildtools (traditional buildtools tarball)') - parser.add_argument('-c', '--check', help='enable md5 checksum checking', - default=True, - action='store_true') + group = parser.add_mutually_exclusive_group() + group.add_argument('-c', '--check', help='enable checksum validation', + default=True, action='store_true') + group.add_argument('-n', '--no-check', help='disable checksum validation', + dest="check", action='store_false') parser.add_argument('-D', '--debug', help='enable debug output', action='store_true') parser.add_argument('-q', '--quiet', help='print only errors', @@ -194,19 +198,19 @@ def main(): logger.error("Milestone installers require --build-date") else: if args.with_extended_buildtools: - filename = "x86_64-buildtools-extended-nativesdk-standalone-%s-%s.sh" % ( - args.installer_version, args.build_date) + filename = "%s-buildtools-extended-nativesdk-standalone-%s-%s.sh" % ( + arch, args.installer_version, args.build_date) else: - filename = "x86_64-buildtools-nativesdk-standalone-%s-%s.sh" % ( - args.installer_version, args.build_date) + filename = "%s-buildtools-nativesdk-standalone-%s-%s.sh" % ( + arch, args.installer_version, args.build_date) safe_filename = quote(filename) buildtools_url = "%s/milestones/%s/buildtools/%s" % (base_url, args.release, safe_filename) # regular release SDK else: if args.with_extended_buildtools: - filename = "x86_64-buildtools-extended-nativesdk-standalone-%s.sh" % args.installer_version + filename = "%s-buildtools-extended-nativesdk-standalone-%s.sh" % (arch, args.installer_version) else: - filename = "x86_64-buildtools-nativesdk-standalone-%s.sh" % args.installer_version + filename = "%s-buildtools-nativesdk-standalone-%s.sh" % (arch, args.installer_version) safe_filename = quote(filename) buildtools_url = "%s/%s/buildtools/%s" % (base_url, args.release, safe_filename) @@ -225,7 +229,7 @@ def main(): if args.check: logger.info("Fetching buildtools installer checksum") checksum_type = "" - for checksum_type in ["md5sum", "sha256"]: + for checksum_type in ["md5sum", "sha256sum"]: check_url = "{}.{}".format(buildtools_url, checksum_type) checksum_filename = "{}.{}".format(filename, checksum_type) tmpbuildtools_checksum = os.path.join(tmpsdk_dir, checksum_filename) @@ -237,7 +241,7 @@ def main(): if ret != 0: logger.error("Could not download file from %s" % check_url) return ret - regex = re.compile(r"^(?P<checksum>[0-9a-f]+)\s\s(?P<path>.*/)?(?P<filename>.*)$") + regex = re.compile(r"^(?P<checksum>[0-9a-f]+)\s+(?P<path>.*/)?(?P<filename>.*)$") with open(tmpbuildtools_checksum, 'rb') as f: original = f.read() m = re.search(regex, original.decode("utf-8")) @@ -258,6 +262,7 @@ def main(): else: logger.error("Checksum %s expected. Actual checksum is %s." % (checksum, checksum_value)) + return 1 # Make installer executable logger.info("Making installer executable") @@ -273,12 +278,13 @@ def main(): ret = subprocess.call("%s -y" % tmpbuildtools, shell=True) if ret != 0: logger.error("Could not run buildtools installer") + return ret # Setup the environment logger.info("Setting up the environment") regex = re.compile(r'^(?P<export>export )?(?P<env_var>[A-Z_]+)=(?P<env_val>.+)$') - with open("%s/environment-setup-x86_64-pokysdk-linux" % - install_dir, 'rb') as f: + with open("%s/environment-setup-%s-pokysdk-linux" % + (install_dir, arch), 'rb') as f: for line in f: match = regex.search(line.decode('utf-8')) logger.debug("export regex: %s" % match) diff --git a/poky/scripts/lib/devtool/deploy.py b/poky/scripts/lib/devtool/deploy.py index 6a997735fc..b1749ce672 100644 --- a/poky/scripts/lib/devtool/deploy.py +++ b/poky/scripts/lib/devtool/deploy.py @@ -330,7 +330,7 @@ def register_commands(subparsers, context): parser_deploy.add_argument('-e', '--ssh-exec', help='Executable to use in place of ssh') parser_deploy.add_argument('-P', '--port', help='Specify port to use for connection to the target') parser_deploy.add_argument('-I', '--key', - help='Specifiy ssh private key for connection to the target') + help='Specify ssh private key for connection to the target') strip_opts = parser_deploy.add_mutually_exclusive_group(required=False) strip_opts.add_argument('-S', '--strip', @@ -355,6 +355,6 @@ def register_commands(subparsers, context): parser_undeploy.add_argument('-e', '--ssh-exec', help='Executable to use in place of ssh') parser_undeploy.add_argument('-P', '--port', help='Specify port to use for connection to the target') parser_undeploy.add_argument('-I', '--key', - help='Specifiy ssh private key for connection to the target') + help='Specify ssh private key for connection to the target') parser_undeploy.set_defaults(func=undeploy) diff --git a/poky/scripts/lib/recipetool/create.py b/poky/scripts/lib/recipetool/create.py index 6cbf4de674..8d78c5b6f9 100644 --- a/poky/scripts/lib/recipetool/create.py +++ b/poky/scripts/lib/recipetool/create.py @@ -460,6 +460,7 @@ def create_recipe(args): logger.error('branch= parameter and -B/--srcbranch option cannot both be specified - use one or the other') sys.exit(1) srcbranch = args.srcbranch + params['branch'] = srcbranch nobranch = params.get('nobranch') if nobranch and srcbranch: logger.error('nobranch= cannot be used if you specify a branch') diff --git a/poky/scripts/lib/recipetool/edit.py b/poky/scripts/lib/recipetool/edit.py index 94bdf7bca4..d5b980a1c0 100644 --- a/poky/scripts/lib/recipetool/edit.py +++ b/poky/scripts/lib/recipetool/edit.py @@ -34,7 +34,7 @@ def edit(args): recipe_path = tinfoil.get_recipe_file(args.target) appends = tinfoil.get_file_appends(recipe_path) - return scriptutils.run_editor([recipe_path] + appends, logger) + return scriptutils.run_editor([recipe_path] + list(appends), logger) def register_commands(subparsers): diff --git a/poky/scripts/lib/wic/plugins/imager/direct.py b/poky/scripts/lib/wic/plugins/imager/direct.py index 1f65a7afe5..2f01999405 100644 --- a/poky/scripts/lib/wic/plugins/imager/direct.py +++ b/poky/scripts/lib/wic/plugins/imager/direct.py @@ -436,7 +436,7 @@ class PartitionedImage(): delta = offset - self.offset if delta < 0: - raise WicError("Could not place %s%s at offset %dK: next free sector is %d (delta: %d)" % (part.disk, self.numpart, part.offset, offset, delta)) + raise WicError("Could not place %s%s at offset %dK: next free sector is %d (delta: %d)" % (part.disk, self.numpart, part.offset, self.offset, delta)) logger.debug("Skipping %d sectors to place %s%s at offset %dK", delta, part.disk, self.numpart, part.offset) diff --git a/poky/scripts/runqemu b/poky/scripts/runqemu index 21680b49d2..85f323a712 100755 --- a/poky/scripts/runqemu +++ b/poky/scripts/runqemu @@ -461,27 +461,27 @@ class BaseConfig(object): elif arg == 'sdl': if 'gl' in sys.argv[1:]: self.set_dri_path() - self.qemu_opt_script += ' -vga virtio -display sdl,gl=on' + self.qemu_opt_script += ' -vga virtio -display sdl,gl=on,show-cursor=on' elif 'gl-es' in sys.argv[1:]: self.set_dri_path() - self.qemu_opt_script += ' -vga virtio -display sdl,gl=es' + self.qemu_opt_script += ' -vga virtio -display sdl,gl=es,show-cursor=on' else: - self.qemu_opt_script += ' -display sdl' + self.qemu_opt_script += ' -display sdl,show-cursor=on' elif arg == 'gtk': if 'gl' in sys.argv[1:]: self.set_dri_path() - self.qemu_opt_script += ' -vga virtio -display gtk,gl=on' + self.qemu_opt_script += ' -vga virtio -display gtk,gl=on,show-cursor=on' elif 'gl-es' in sys.argv[1:]: self.set_dri_path() - self.qemu_opt_script += ' -vga virtio -display gtk,gl=es' + self.qemu_opt_script += ' -vga virtio -display gtk,gl=es,show-cursor=on' else: - self.qemu_opt_script += ' -display gtk' + self.qemu_opt_script += ' -display gtk,show-cursor=on' elif arg == 'gl' or arg == 'gl-es': # These args are handled inside sdl or gtk blocks above pass elif arg == 'egl-headless': self.set_dri_path() - self.qemu_opt_script += ' -vga virtio -display egl-headless' + self.qemu_opt_script += ' -vga virtio -display egl-headless,show-cursor=on' elif arg == 'serial': self.kernel_cmdline_script += ' console=ttyS0' self.serialconsole = True |