From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6434342401255407616 X-Received: by 10.46.33.217 with SMTP id h86mr170135lji.28.1498120151210; Thu, 22 Jun 2017 01:29:11 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.191.23 with SMTP id p23ls112356wmf.0.gmail; Thu, 22 Jun 2017 01:29:10 -0700 (PDT) X-Received: by 10.223.130.73 with SMTP id 67mr106428wrb.21.1498120150896; Thu, 22 Jun 2017 01:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498120150; cv=none; d=google.com; s=arc-20160816; b=TkG/ZKqVRou7VAx2PF9AcXiEOTpKw3SKn8vD31dQLtiNUIyCI1L2e96sZq5b8m6oSk 8GmxZeP6Cb0/hb05Il5NlQgc24CoPLweuNXZpNKymEVnKdQfctfhEdqbDxgH3DxGkfyH +PbmxTNct7fn2DT10x2DiV2vYPR4kojo2RGHgrl5nNtyUj7w1PsraOEFeSzSxxtnv1p5 cvBhEmXPvW69VAO1a5e8pMdVxpDgDkP2EWZpb2q9vvIEuj4D8bJ5T7ccetk00lJSasjx PGU1tHeW8z9ajyHnW1NOs6mQfRMmXXfVbtvw0BOGtjMr93hZOCL9e8XtR1Nvhn/FjT8N Xn0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version:user-agent :date:message-id:subject:from:cc:to:arc-authentication-results; bh=L2Tmzf7lIJAFU5NI50h+BKfaNyEzJzYbvmg07kNBlyI=; b=Y5bYuA39O97XuI7AVRZMyegRbyLHElIXCK1y8VuXFeobfLh5+lyp+8fseJGcsIbsSP TsFLrKzDlbZpquIB7rXuR2Kgl9uogJ6RtJL/lZtSSEtIBag4bRQjNEnELs0u1krbsrXw lEi6+BQ0Zs30CQRmknlqR0SS0QfgsSAwVE1+qzWbgT8wUsdMRUU3A+ztzjITrz0a3Vdb XkK7E/pRjXZuoBqmrg4FOIQcs4A8VO4vBc9dOYzi/fRWcg1AAxGFVmu3XGDNqIPNR/pj iT0eQ39dFQl/OUt4WrcSxL1GQiSLT5s71r28sXU7cY4igHB5hZzqR/sUSq+wJAjgduRW VX+w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.28 is neither permitted nor denied by best guess record for domain of jan.kiszka@siemens.com) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id 143si231390wmr.0.2017.06.22.01.29.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jun 2017 01:29:10 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.28 is neither permitted nor denied by best guess record for domain of jan.kiszka@siemens.com) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.28 is neither permitted nor denied by best guess record for domain of jan.kiszka@siemens.com) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id v5M8TAcE030197 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Jun 2017 10:29:10 +0200 Received: from md1f2u6c.ww002.siemens.net ([139.25.68.37]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v5M8TAEK021174; Thu, 22 Jun 2017 10:29:10 +0200 To: Daniel Wagner , "kas-devel@googlegroups.com" Cc: isar-users@googlegroups.com, Baurzhan Ismagulov , Johann Pfefferl From: Jan Kiszka Subject: [PATCH v2] Add support for Isar build system Message-ID: Date: Thu, 22 Jun 2017 10:29:10 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: cWsIrFCWKPlJ From: Jan Kiszka Isar allows to build Debian-based images using bitbake and the usual layer structures. It's very similar to OE, we just need to account for a different init script name. Signed-off-by: Jan Kiszka --- Changes in v2: - rebased over next Here is the updated kas file: header: version: "0.9" machine: qemu-amd64 distro: debian-stretch target: isar-image-base repos: isar: layers: meta: meta-isar: bblayers_conf_header: standard: | LCONF_VERSION = "6" BBPATH = "${TOPDIR}" BBFILES ?= "" local_conf_header: distro-arch: | CONF_VERSION = "1" DISTRO_ARCH = "amd64" kas/libcmds.py | 4 ++-- kas/libkas.py | 27 +++++++++++++++------------ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/kas/libcmds.py b/kas/libcmds.py index 70733c5..91133f0 100644 --- a/kas/libcmds.py +++ b/kas/libcmds.py @@ -28,7 +28,7 @@ import logging import shutil import os from .libkas import (ssh_cleanup_agent, ssh_setup_agent, ssh_no_host_key_check, - run_cmd, get_oe_environ) + run_cmd, get_build_environ) __license__ = 'MIT' __copyright__ = 'Copyright (c) Siemens AG, 2017' @@ -168,7 +168,7 @@ class SetupEnviron(Command): return 'setup_environ' def execute(self, config): - config.environ.update(get_oe_environ(config, config.build_dir)) + config.environ.update(get_build_environ(config, config.build_dir)) class WriteConfig(Command): diff --git a/kas/libkas.py b/kas/libkas.py index 53fc8e0..3c08acc 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -158,29 +158,32 @@ def find_program(paths, name): return None -def get_oe_environ(config, build_dir): +def get_build_environ(config, build_dir): """ - Create the openembedded environment variables. + Create the build environment variables. """ # pylint: disable=too-many-locals - # nasty side effect function: running oe-init-build-env also + # nasty side effect function: running oe/isar-init-build-env also # creates the conf directory - oe_path = None - for repo in config.get_repos(): - if os.path.exists(repo.path + '/oe-init-build-env'): - oe_path = repo.path + permutations = \ + [(repo, script) for repo in config.get_repos() + for script in ['oe-init-build-env', 'isar-init-build-env']] + for (repo, script) in permutations: + if os.path.exists(repo.path + '/' + script): + init_path = repo.path + init_script = script break - if not oe_path: - logging.error('Did not find oe-init-build-env') + else: + logging.error('Did not find any init-build-env script') sys.exit(1) get_bb_env_file = tempfile.mktemp() with open(get_bb_env_file, 'w') as fds: script = """#!/bin/bash - source oe-init-build-env $1 > /dev/null 2>&1 + source %s $1 > /dev/null 2>&1 env - """ + """ % init_script fds.write(script) os.chmod(get_bb_env_file, 0o775) @@ -188,7 +191,7 @@ def get_oe_environ(config, build_dir): env['PATH'] = '/bin:/usr/bin' (_, output) = run_cmd([get_bb_env_file, build_dir], - cwd=oe_path, env=env, liveupdate=False) + cwd=init_path, env=env, liveupdate=False) os.remove(get_bb_env_file)