diff options
Diffstat (limited to 'poky/scripts')
-rw-r--r-- | poky/scripts/lib/checklayer/__init__.py | 14 | ||||
-rw-r--r-- | poky/scripts/lib/wic/plugins/source/bootimg-efi.py | 60 | ||||
-rw-r--r-- | poky/scripts/lib/wic/plugins/source/bootimg-partition.py | 2 | ||||
-rwxr-xr-x | poky/scripts/runqemu | 7 | ||||
-rwxr-xr-x | poky/scripts/yocto-check-layer | 9 |
5 files changed, 87 insertions, 5 deletions
diff --git a/poky/scripts/lib/checklayer/__init__.py b/poky/scripts/lib/checklayer/__init__.py index f625d59896..fe545607bb 100644 --- a/poky/scripts/lib/checklayer/__init__.py +++ b/poky/scripts/lib/checklayer/__init__.py @@ -229,6 +229,20 @@ def add_layers(bblayersconf, layers, logger): f.write("\nBBLAYERS += \"%s\"\n" % path) return True +def check_bblayers(bblayersconf, layer_path, logger): + ''' + If layer_path found in BBLAYERS return True + ''' + import bb.parse + import bb.data + + ldata = bb.parse.handle(bblayersconf, bb.data.init(), include=True) + for bblayer in (ldata.getVar('BBLAYERS') or '').split(): + if os.path.normpath(bblayer) == os.path.normpath(layer_path): + return True + + return False + def check_command(error_msg, cmd, cwd=None): ''' Run a command under a shell, capture stdout and stderr in a single stream, diff --git a/poky/scripts/lib/wic/plugins/source/bootimg-efi.py b/poky/scripts/lib/wic/plugins/source/bootimg-efi.py index 2cfdc10ecd..14c1723577 100644 --- a/poky/scripts/lib/wic/plugins/source/bootimg-efi.py +++ b/poky/scripts/lib/wic/plugins/source/bootimg-efi.py @@ -13,6 +13,9 @@ import logging import os import shutil +import re + +from glob import glob from wic import WicError from wic.engine import get_custom_config @@ -209,6 +212,57 @@ 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') + else: + boot_files = None + for (fmt, id) in (("_uuid-%s", part.uuid), ("_label-%s", part.label), (None, None)): + if fmt: + var = fmt % id + else: + var = "" + + boot_files = get_bitbake_var("IMAGE_BOOT_FILES" + var) + if boot_files: + break + + logger.debug('Boot files: %s', boot_files) + + # list of tuples (src_name, dst_name) + deploy_files = [] + for src_entry in re.findall(r'[\w;\-\./\*]+', boot_files): + if ';' in src_entry: + dst_entry = tuple(src_entry.split(';')) + if not dst_entry[0] or not dst_entry[1]: + raise WicError('Malformed boot file entry: %s' % src_entry) + else: + dst_entry = (src_entry, src_entry) + + logger.debug('Destination entry: %r', dst_entry) + deploy_files.append(dst_entry) + + cls.install_task = []; + for deploy_entry in deploy_files: + src, dst = deploy_entry + if '*' in src: + # by default install files under their basename + entry_name_fn = os.path.basename + if dst != src: + # unless a target name was given, then treat name + # as a directory and append a basename + entry_name_fn = lambda name: \ + os.path.join(dst, + os.path.basename(name)) + + srcs = glob(os.path.join(kernel_dir, src)) + + logger.debug('Globbed sources: %s', ', '.join(srcs)) + for entry in srcs: + src = os.path.relpath(entry, kernel_dir) + entry_dst_name = entry_name_fn(entry) + cls.install_task.append((src, entry_dst_name)) + else: + cls.install_task.append((src, dst)) @classmethod def do_prepare_partition(cls, part, source_params, creator, cr_workdir, @@ -238,6 +292,12 @@ class BootimgEFIPlugin(SourcePlugin): (staging_kernel_dir, kernel, hdddir, kernel) exec_cmd(install_cmd) + if get_bitbake_var("IMAGE_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), + os.path.join(hdddir, dst_path)) + exec_cmd(install_cmd) try: if source_params['loader'] == 'grub-efi': diff --git a/poky/scripts/lib/wic/plugins/source/bootimg-partition.py b/poky/scripts/lib/wic/plugins/source/bootimg-partition.py index 138986a71e..5dbe2558d2 100644 --- a/poky/scripts/lib/wic/plugins/source/bootimg-partition.py +++ b/poky/scripts/lib/wic/plugins/source/bootimg-partition.py @@ -141,7 +141,7 @@ class BootimgPartitionPlugin(SourcePlugin): break if not kernel_name: - raise WicError('No kernel file founded') + raise WicError('No kernel file found') # Compose the extlinux.conf extlinux_conf = "default Yocto\n" diff --git a/poky/scripts/runqemu b/poky/scripts/runqemu index f2168c18a3..7fb5f7db57 100755 --- a/poky/scripts/runqemu +++ b/poky/scripts/runqemu @@ -478,7 +478,8 @@ class BaseConfig(object): 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 + if ('gtk' not in sys.argv) and ('sdl' not in sys.argv): + raise RunQemuError('Option %s also needs gtk or sdl option.' % (arg)) elif arg == 'egl-headless': self.set_dri_path() self.qemu_opt_script += ' -vga virtio -display egl-headless,show-cursor=on' @@ -585,10 +586,10 @@ class BaseConfig(object): logger.error("For further help see:") raise RunQemuError(yocto_paravirt_kvm_wiki) - if not os.access(dev_kvm, os.W_OK|os.R_OK): + if not os.access(dev_vhost, os.W_OK|os.R_OK): logger.error("You have no read or write permission on /dev/vhost-net.") logger.error("Please change the ownership of this file as described at:") - raise RunQemuError(yocto_kvm_wiki) + raise RunQemuError(yocto_paravirt_kvm_wiki) def check_fstype(self): """Check and setup FSTYPE""" diff --git a/poky/scripts/yocto-check-layer b/poky/scripts/yocto-check-layer index ca6c79bc8d..b7c83c8b54 100755 --- a/poky/scripts/yocto-check-layer +++ b/poky/scripts/yocto-check-layer @@ -24,7 +24,7 @@ import scriptpath scriptpath.add_oe_lib_path() scriptpath.add_bitbake_lib_path() -from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_signatures +from checklayer import LayerType, detect_layers, add_layers, add_layer_dependencies, get_signatures, check_bblayers from oeqa.utils.commands import get_bb_vars PROGNAME = 'yocto-check-layer' @@ -138,6 +138,13 @@ def main(): layer['type'] == LayerType.ERROR_BSP_DISTRO: continue + if check_bblayers(bblayersconf, layer['path'], logger): + logger.info("%s already in %s. To capture initial signatures, layer under test should not present " + "in BBLAYERS. Please remove %s from BBLAYERS." % (layer['name'], bblayersconf, layer['name'])) + results[layer['name']] = None + results_status[layer['name']] = 'SKIPPED (Layer under test should not present in BBLAYERS)' + continue + logger.info('') logger.info("Setting up for %s(%s), %s" % (layer['name'], layer['type'], layer['path'])) |