config: Implemented multi-target support

With this patch support for building multiple targets in parallel with
bitbake is now supported.

Changes:

  - Its now possible to state a list of targets under the target key in
    the configuration file.

    Example:

        target:
          - product-image
          - product-update-image

  - Its now possible to define multiple targets in the kas command line.

    Example:

        $ kas build --target product-image --target product-update-image \
          kas.yml

  - Its now possible to define multiple targets via the environment:

    Example:

        $ export KAS_TARGET="product-image product-update-image"
        $ kas build kas.yml

Signed-off-by: Claudius Heine <ch@denx.de>
This commit is contained in:
Claudius Heine
2017-10-13 12:20:04 +02:00
committed by Daniel Wagner
parent f7d2e5ae20
commit ab8e4cd375
5 changed files with 21 additions and 11 deletions

View File

@@ -55,6 +55,7 @@ class Build:
bld_psr.add_argument('config',
help='Config file')
bld_psr.add_argument('--target',
action='append',
help='Select target to build')
bld_psr.add_argument('--task',
help='Select which task should be executed')
@@ -118,6 +119,6 @@ class BuildCommand(Command):
"""
# Start bitbake build of image
bitbake = find_program(config.environ['PATH'], 'bitbake')
run_cmd([bitbake, '-k', config.get_bitbake_target(),
'-c', config.get_bitbake_task()],
run_cmd([bitbake, '-k', '-c', config.get_bitbake_task()] +
config.get_bitbake_targets(),
env=config.environ, cwd=config.build_dir)