diff options
Diffstat (limited to 'poky/scripts')
-rwxr-xr-x | poky/scripts/buildhistory-diff | 9 | ||||
-rw-r--r-- | poky/scripts/lib/devtool/deploy.py | 8 | ||||
-rw-r--r-- | poky/scripts/lib/devtool/standard.py | 2 | ||||
-rw-r--r-- | poky/scripts/lib/wic/ksparser.py | 20 | ||||
-rw-r--r-- | poky/scripts/lib/wic/misc.py | 5 | ||||
-rw-r--r-- | poky/scripts/lib/wic/plugins/imager/direct.py | 8 | ||||
-rw-r--r-- | poky/scripts/lib/wic/plugins/source/bootimg-efi.py | 8 | ||||
-rwxr-xr-x | poky/scripts/oe-publish-sdk | 8 | ||||
-rwxr-xr-x | poky/scripts/runqemu | 9 |
9 files changed, 51 insertions, 26 deletions
diff --git a/poky/scripts/buildhistory-diff b/poky/scripts/buildhistory-diff index 833f7c33a..3bd40a2a1 100755 --- a/poky/scripts/buildhistory-diff +++ b/poky/scripts/buildhistory-diff @@ -28,10 +28,12 @@ def get_args_parser(): %(prog)s [options] [from-revision [to-revision]] (if not specified, from-revision defaults to build-minus-1, and to-revision defaults to HEAD)""") + default_dir = os.path.join(os.environ.get('BUILDDIR', '.'), 'buildhistory') + parser.add_argument('-p', '--buildhistory-dir', action='store', dest='buildhistory_dir', - default='buildhistory/', + default=default_dir, help="Specify path to buildhistory directory (defaults to buildhistory/ under cwd)") parser.add_argument('-v', '--report-version', action='store_true', @@ -80,11 +82,6 @@ def main(): parser.print_help() sys.exit(1) - if not os.path.exists(args.buildhistory_dir): - if args.buildhistory_dir == 'buildhistory/': - cwd = os.getcwd() - if os.path.basename(cwd) == 'buildhistory': - args.buildhistory_dir = cwd if not os.path.exists(args.buildhistory_dir): sys.stderr.write('Buildhistory directory "%s" does not exist\n\n' % args.buildhistory_dir) diff --git a/poky/scripts/lib/devtool/deploy.py b/poky/scripts/lib/devtool/deploy.py index b1749ce67..e5af2c95a 100644 --- a/poky/scripts/lib/devtool/deploy.py +++ b/poky/scripts/lib/devtool/deploy.py @@ -177,13 +177,19 @@ def deploy(args, config, basepath, workspace): rd.getVar('base_libdir'), rd) filelist = [] + inodes = set({}) ftotalsize = 0 for root, _, files in os.walk(recipe_outdir): for fn in files: + fstat = os.lstat(os.path.join(root, fn)) # Get the size in kiB (since we'll be comparing it to the output of du -k) # MUST use lstat() here not stat() or getfilesize() since we don't want to # dereference symlinks - fsize = int(math.ceil(float(os.lstat(os.path.join(root, fn)).st_size)/1024)) + if fstat.st_ino in inodes: + fsize = 0 + else: + fsize = int(math.ceil(float(fstat.st_size)/1024)) + inodes.add(fstat.st_ino) ftotalsize += fsize # The path as it would appear on the target fpath = os.path.join(destdir, os.path.relpath(root, recipe_outdir), fn) diff --git a/poky/scripts/lib/devtool/standard.py b/poky/scripts/lib/devtool/standard.py index bab644b83..d140b97de 100644 --- a/poky/scripts/lib/devtool/standard.py +++ b/poky/scripts/lib/devtool/standard.py @@ -1711,7 +1711,7 @@ def _update_recipe_patch(recipename, workspace, srctree, rd, appendlayerdir, wil def _guess_recipe_update_mode(srctree, rdata): """Guess the recipe update mode to use""" - src_uri = (rdata.getVar('SRC_URI', False) or '').split() + src_uri = (rdata.getVar('SRC_URI') or '').split() git_uris = [uri for uri in src_uri if uri.startswith('git://')] if not git_uris: return 'patch' diff --git a/poky/scripts/lib/wic/ksparser.py b/poky/scripts/lib/wic/ksparser.py index 3453d9cb9..913e3283d 100644 --- a/poky/scripts/lib/wic/ksparser.py +++ b/poky/scripts/lib/wic/ksparser.py @@ -51,11 +51,11 @@ class KickStartParser(ArgumentParser): def error(self, message): raise ArgumentError(None, message) -def sizetype(default): +def sizetype(default, size_in_bytes=False): def f(arg): """ Custom type for ArgumentParser - Converts size string in <num>[K|k|M|G] format into the integer value + Converts size string in <num>[S|s|K|k|M|G] format into the integer value """ try: suffix = default @@ -67,12 +67,20 @@ def sizetype(default): except ValueError: raise ArgumentTypeError("Invalid size: %r" % arg) + + if size_in_bytes: + if suffix == 's' or suffix == 'S': + return size * 512 + mult = 1024 + else: + mult = 1 + if suffix == "k" or suffix == "K": - return size + return size * mult if suffix == "M": - return size * 1024 + return size * mult * 1024 if suffix == "G": - return size * 1024 * 1024 + return size * mult * 1024 * 1024 raise ArgumentTypeError("Invalid size: %r" % arg) return f @@ -141,7 +149,7 @@ class KickStart(): part.add_argument('mountpoint', nargs='?') part.add_argument('--active', action='store_true') part.add_argument('--align', type=int) - part.add_argument('--offset', type=sizetype("K")) + part.add_argument('--offset', type=sizetype("K", True)) part.add_argument('--exclude-path', nargs='+') part.add_argument('--include-path', nargs='+', action='append') part.add_argument('--change-directory') diff --git a/poky/scripts/lib/wic/misc.py b/poky/scripts/lib/wic/misc.py index 91975ba15..4b08d649c 100644 --- a/poky/scripts/lib/wic/misc.py +++ b/poky/scripts/lib/wic/misc.py @@ -138,8 +138,9 @@ def exec_native_cmd(cmd_and_args, native_sysroot, pseudo=""): if pseudo: cmd_and_args = pseudo + cmd_and_args - native_paths = "%s/sbin:%s/usr/sbin:%s/usr/bin" % \ - (native_sysroot, native_sysroot, native_sysroot) + native_paths = "%s/sbin:%s/usr/sbin:%s/usr/bin:%s/bin" % \ + (native_sysroot, native_sysroot, + native_sysroot, native_sysroot) native_cmd_and_args = "export PATH=%s:$PATH;%s" % \ (native_paths, cmd_and_args) diff --git a/poky/scripts/lib/wic/plugins/imager/direct.py b/poky/scripts/lib/wic/plugins/imager/direct.py index 2f0199940..55db826e9 100644 --- a/poky/scripts/lib/wic/plugins/imager/direct.py +++ b/poky/scripts/lib/wic/plugins/imager/direct.py @@ -429,14 +429,14 @@ class PartitionedImage(): self.offset += align_sectors if part.offset is not None: - offset = (part.offset * 1024) // self.sector_size + offset = part.offset // self.sector_size - if offset * self.sector_size != part.offset * 1024: - raise WicError("Could not place %s%s at offset %dK with sector size %d" % (part.disk, self.numpart, part.offset, self.sector_size)) + if offset * self.sector_size != part.offset: + raise WicError("Could not place %s%s at offset %d with sector size %d" % (part.disk, self.numpart, part.offset, self.sector_size)) 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, self.offset, delta)) + raise WicError("Could not place %s%s at offset %d: 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/lib/wic/plugins/source/bootimg-efi.py b/poky/scripts/lib/wic/plugins/source/bootimg-efi.py index 14c172357..cdc72543c 100644 --- a/poky/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/poky/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -212,8 +212,8 @@ class BootimgEFIPlugin(SourcePlugin): except KeyError: raise WicError("bootimg-efi requires a loader, none specified") - if get_bitbake_var("IMAGE_BOOT_FILES") is None: - logger.debug('No boot files defined in IMAGE_BOOT_FILES') + if get_bitbake_var("IMAGE_EFI_BOOT_FILES") is None: + logger.debug('No boot files defined in IMAGE_EFI_BOOT_FILES') else: boot_files = None for (fmt, id) in (("_uuid-%s", part.uuid), ("_label-%s", part.label), (None, None)): @@ -222,7 +222,7 @@ class BootimgEFIPlugin(SourcePlugin): else: var = "" - boot_files = get_bitbake_var("IMAGE_BOOT_FILES" + var) + boot_files = get_bitbake_var("IMAGE_EFI_BOOT_FILES" + var) if boot_files: break @@ -292,7 +292,7 @@ class BootimgEFIPlugin(SourcePlugin): (staging_kernel_dir, kernel, hdddir, kernel) exec_cmd(install_cmd) - if get_bitbake_var("IMAGE_BOOT_FILES"): + if get_bitbake_var("IMAGE_EFI_BOOT_FILES"): for src_path, dst_path in cls.install_task: install_cmd = "install -m 0644 -D %s %s" \ % (os.path.join(kernel_dir, src_path), diff --git a/poky/scripts/oe-publish-sdk b/poky/scripts/oe-publish-sdk index 4b70f436b..deb8ae180 100755 --- a/poky/scripts/oe-publish-sdk +++ b/poky/scripts/oe-publish-sdk @@ -94,7 +94,10 @@ def publish(args): logger.error('Failed to unpack %s to %s' % (dest_sdk, destination)) return ret else: - cmd = "ssh %s 'sh %s -p -y -d %s && rm -f %s'" % (host, dest_sdk, destdir, dest_sdk) + rm_or_not = " && rm -f %s" % dest_sdk + if args.keep_orig: + rm_or_not = "" + cmd = "ssh %s 'sh %s -p -y -d %s%s'" % (host, dest_sdk, destdir, rm_or_not) ret = subprocess.call(cmd, shell=True) if ret == 0: logger.info('Successfully unpacked %s to %s' % (dest_sdk, destdir)) @@ -106,7 +109,7 @@ def publish(args): if not is_remote: cmd = 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; cp .git/hooks/post-update.sample .git/hooks/post-commit; echo "*.pyc\n*.pyo\npyshtables.py" > .gitignore; fi; git add -A .; git config user.email "oe@oe.oe" && git config user.name "OE" && git commit -q -m "init repo" || true' % (destination, destination) else: - cmd = "ssh %s 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; cp .git/hooks/post-update.sample .git/hooks/post-commit; echo '*.pyc\n*.pyo\npyshtables.py' > .gitignore; fi; git add -A .; git config user.email 'oe@oe.oe' && git config user.name 'OE' && git commit -q -m \"init repo\" || true'" % (host, destdir, destdir) + cmd = "ssh %s 'set -e; mkdir -p %s/layers; cd %s/layers; if [ ! -e .git ]; then git init .; cp .git/hooks/post-update.sample .git/hooks/post-commit; echo '*.pyc' > .gitignore; echo '*.pyo' >> .gitignore; echo 'pyshtables.py' >> .gitignore; fi; git add -A .; git config user.email 'oe@oe.oe' && git config user.name 'OE' && git commit -q -m \"init repo\" || true'" % (host, destdir, destdir) ret = subprocess.call(cmd, shell=True) if ret == 0: logger.info('SDK published successfully') @@ -119,6 +122,7 @@ def main(): parser = argparse_oe.ArgumentParser(description="OpenEmbedded extensible SDK publishing tool - writes server-side data to support the extensible SDK update process to a specified location") parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true') + parser.add_argument('-k', '--keep-orig', help='When published to a remote host, the eSDK installer gets deleted by default.', action='store_true') parser.add_argument('sdk', help='Extensible SDK to publish (path to .sh installer file)') parser.add_argument('dest', help='Destination to publish SDK to; can be local path or remote in the form of user@host:/path (in the latter case ssh/scp will be used).') diff --git a/poky/scripts/runqemu b/poky/scripts/runqemu index 7fb5f7db5..e62d869c2 100755 --- a/poky/scripts/runqemu +++ b/poky/scripts/runqemu @@ -456,6 +456,10 @@ class BaseConfig(object): if arg in self.fstypes + self.vmtypes + self.wictypes: self.check_arg_fstype(arg) elif arg == 'nographic': + if ('sdl' in sys.argv): + raise RunQemuError('Option nographic makes no sense alongside the sdl option.' % (arg)) + if ('gtk' in sys.argv): + raise RunQemuError('Option nographic makes no sense alongside the gtk option.' % (arg)) self.qemu_opt_script += ' -nographic' self.kernel_cmdline_script += ' console=ttyS0' elif arg == 'sdl': @@ -1515,6 +1519,11 @@ def main(): try: config = BaseConfig() + renice = os.path.expanduser("~/bin/runqemu-renice") + if os.path.exists(renice): + logger.info('Using %s to renice' % renice) + subprocess.check_call([renice, str(os.getpid())]) + def sigterm_handler(signum, frame): logger.info("SIGTERM received") os.kill(config.qemupid, signal.SIGTERM) |