From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6434342401255407616 X-Received: by 10.46.5.22 with SMTP id 22mr105162ljf.18.1498112082458; Wed, 21 Jun 2017 23:14:42 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.83.12 with SMTP id h12ls103889ljb.15.gmail; Wed, 21 Jun 2017 23:14:42 -0700 (PDT) X-Received: by 10.46.84.91 with SMTP id y27mr99165ljd.7.1498112081969; Wed, 21 Jun 2017 23:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498112081; cv=none; d=google.com; s=arc-20160816; b=VJFG2IcGeZ1jQVTsh7XrN3G+gffE10Owxs5SyzcqzRvFuY5K2Ok/l/j4PPJeJxh4cw s0CIZ4fGk+4m7P+rZQ7Tq+Ga8Od06I8zZXdmI+ALVlBbEcq3zn2tTdAifkXRS4b74oxM xlcQ8pkRrXREbaYUo5bHAIgUnO6lqvxPlyaKTfoXK/koyVLpuvBd9l9AeqU1e28IYv4+ AbLAY98V2qrKwnyxVMEaMWhjjXVihEk2tdYAtH3qlvM/pvv32auq/lczW7Ep6aiYOFTB 9rd5B48fiDKoCJwKvbPUHEUgcxgrlnnD/MjJgL5UypkPkHCq4R+hb3l4Jd2WoiRcGi4W 3cmw== 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=AkYknoUIIXBAeRVeIHtyWsosTxXAmI3itoS2SgsQoXY=; b=Vo8wFV9dU6GwjCj1gHufGnKggKJTM8f2gRSn5A3DpfE/kirD2zOH0fuV3njvGR7ZYp gfwVYXOPjEQYJd8T/DBrZaoIfHNWRtQWwqIl2OOjCs5RVb+N5p27F/8CoZwekow43s5D UovF98FWoD1BX4Dfvu4sX/kj19yZ0LdAH4QzctCrXuouEeVXNMx3zbYKshm8ifmoRBO4 6hB73dsFpKlvYsPALEe6pP+Er0bDEsGvCKubDswHRDA+oJ0jeJs6WT9Gywgm12+S4Z14 VNEVNHI0qzRhbR4aorSMUY58Egx3hEOswspAew07mDs9x/7j60LZRb5/4wLIEtL1E6DL tSOA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 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 thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id 197si147745wmo.0.2017.06.21.23.14.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jun 2017 23:14:41 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of jan.kiszka@siemens.com) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of jan.kiszka@siemens.com) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id v5M6EfGb009399 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Jun 2017 08:14:41 +0200 Received: from md1f2u6c.ww002.siemens.net ([146.254.78.36]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id v5M6EemQ004500; Thu, 22 Jun 2017 08:14:41 +0200 To: "kas-devel@googlegroups.com" , Baurzhan Ismagulov , Daniel Wagner Cc: isar-users@googlegroups.com, Johann Pfefferl From: Jan Kiszka Subject: [PATCH] Add support for Isar build system Message-ID: <5153df1f-347d-32e6-3b4d-dff378979427@siemens.com> Date: Thu, 22 Jun 2017 08:14:40 +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: yHm+gG1JnKzO 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 --- This was tested against next branch of kas using a full-fledged Debian 8.8 as host, a private bug-fix branch of Isar (hope we can resolve that soon) and the following basic config: machine: qemu-amd64 distro: debian-stretch target: isar-image-base repos: - url: "" sublayers: - meta - meta-isar bblayers_conf_header: | LCONF_VERSION = "6" BBPATH = "${TOPDIR}" BBFILES ?= "" local_conf_header: | CONF_VERSION = "1" DISTRO_ARCH = "amd64" We probably need to discuss if/how multiconfig support could be added to kas. Note that Docker support is WiP (Baurzhan is helping me to debug a remaining issue). kas/libcmds.py | 4 ++-- kas/libkas.py | 25 ++++++++++++++----------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/kas/libcmds.py b/kas/libcmds.py index 6dcef1f..d9d8a87 100644 --- a/kas/libcmds.py +++ b/kas/libcmds.py @@ -26,7 +26,7 @@ import shutil import os from urllib.parse import urlparse 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' @@ -126,7 +126,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 b2e6dd0..72acf34 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -128,25 +128,28 @@ def find_program(paths, name): return None -def get_oe_environ(config, build_dir): - # nasty side effect function: running oe-init-build-env also +def get_build_environ(config, build_dir): + # 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 f: script = """#!/bin/bash - source oe-init-build-env $1 > /dev/null 2>&1 + source %s $1 > /dev/null 2>&1 env - """ + """ % init_script f.write(script) os.chmod(get_bb_env_file, 0o775) @@ -154,7 +157,7 @@ def get_oe_environ(config, build_dir): env['PATH'] = '/bin:/usr/bin' (rc, 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) -- Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence Center Embedded Linux