From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6566555412143800320 X-Received: by 2002:a7b:c047:: with SMTP id u7-v6mr96495wmc.9.1529060976529; Fri, 15 Jun 2018 04:09:36 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:add5:: with SMTP id w79-v6ls3446367wrc.10.gmail; Fri, 15 Jun 2018 04:09:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLTm16xI2V7j4Xa9NPF4hFhnoMSNBoMI5UAcA3kOlXYaVg3q7jf5IaoYKhqwNJpsavJ5AXa X-Received: by 2002:adf:f610:: with SMTP id t16-v6mr122635wrp.16.1529060976155; Fri, 15 Jun 2018 04:09:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529060976; cv=none; d=google.com; s=arc-20160816; b=mRaq6KitINFtSMnlPRyM2wHzZbxZz4hpSYNsUQsL7qwAyVWD29ZkACCvdA3e91DiWQ ouQ9SshxHhkoFwRdMtuRJZ2844WOJy//XQVZ7PceRu1ehAHT11TGJuB3t5IP1I1+E2B1 hT1/5FFs68z720oYYPLqbS7nfIHYhLPAGU91PNiLqoYz+WqShwMqRtdlAB1qP33AaIdE iYMaBEc7966WMWdXVBKMIZKVeEW4te1nbazBuFZjearap+Lr2QVw7UWMgWpvlb5mHarX EfuLo/F0JROWwmIT+XKGAXiXtkEdgcMtl0Pge9RyVWpgupTcH8SR3qsh0yP7ix4jvae/ CqxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:arc-authentication-results; bh=yUN3WkMKeTiJJigfrHVpzvo1gRK03FN0fkJuqspY2lE=; b=kUtpBwuqY7CoS4H9U42s8teMAEXzE93ezj8zNFjZBA8zKeDC0chcEk8DFDWv6+A8OT XMUu54daP4cl6da5oSVBw2tVFj+EZeLNa8FAN3Y3aMnYf7fsyQhFeF9TAtrlZl6BAmtq DqaEKMM9Lt52LiWH+ICrauhDozLxyePAElMDn257iA30j6z3kVfZ/8qD+9j/uPRHpVaI PRVYdnZj3KJT8A11XTBMv49EsfF6vLV33kJuIBw5Pn6+75g88x0HM2fIRISa8cXaH66g GwYIpasd80yH8425tmEgMZuISKvJMkZnIdg76C/Psi23yku4mXI48bBZVaHYJwFUrufz U2RA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id o4-v6si230162wrm.1.2018.06.15.04.09.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jun 2018 04:09:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from azat.radix50.net (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w5FB9W4x005084 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 15 Jun 2018 13:09:35 +0200 Date: Fri, 15 Jun 2018 13:09:32 +0200 From: Alexander Smirnov To: Henning Schild Cc: isar-users@googlegroups.com Subject: Re: [PATCH 3/9] isar-bootstrap: Add host architecture support Message-ID: <20180615110932.GD24273@azat.radix50.net> References: <20180613130807.2461-1-asmirnov@ilbers.de> <20180613130807.2461-4-asmirnov@ilbers.de> <20180614132737.01d88b06@md1pvb1c.ad001.siemens.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180614132737.01d88b06@md1pvb1c.ad001.siemens.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-TUID: ZFLOtD33kHLa On Thu, Jun 14, 2018 at 01:27:37PM +0200, Henning Schild wrote: Hi Henning, > This + 2/9 looks very much like what Maxim posted. Again i would like > to understand why we need a copy of the debootstrap code. Maybe the > differences can be addressed with introducing variables. > For sure, that's the first idea came to my mind. But after an attempts to implement this I've faced with the following issues: - buildchroot/buildchroot-cross are optional. They should be added to pipeline if some recipe requires them, i.e. ihnerits dpkg-* class. - Each buildchroot should have its own set of stamps to avoid duplications. For example each multiconfig has its own instance of target rootfs, but host rootfs should be singletone. Current Isar implementation contains very comfortable way to chose the way how to build the package - inherit respective class. Re-use of this approach to implement cross-building looks for me very comfortable way: - We should not invent the wheel and introduce new user-interface how to implement recipes. For example dpkg.bbclass depends on buildchroot:do_build, so I simply implement dpkg-cross.bbclass which depends on buildchroot-cross:do_build. - The Isar will stay flexible and builds the only really needed parts Regarding the duplication - I've tried to reduce it as much as possible. The shareble part is moved to .inc file, so the recipe payload contains the only arch-specific stuff. Alex > Henning > > Am Wed, 13 Jun 2018 15:08:01 +0200 > schrieb Alexander Smirnov : > > > Add recipe to generate bootstrap with the host architecture. > > > > Signed-off-by: Alexander Smirnov > > --- > > .../isar-bootstrap/isar-bootstrap-host.bb | 44 > > ++++++++++++++++++++++ 1 file changed, 44 insertions(+) > > create mode 100644 > > meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb > > > > diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb > > b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb new file > > mode 100644 index 0000000..c61c665 > > --- /dev/null > > +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb > > @@ -0,0 +1,44 @@ > > +# Minimal host Debian root file system > > +# > > +# This software is a part of ISAR. > > +# Copyright (c) Siemens AG, 2018 > > +# > > +# SPDX-License-Identifier: MIT > > + > > +Description = "Minimal host Debian root file system" > > + > > +include isar-bootstrap.inc > > +inherit isar-bootstrap-helper > > + > > +do_bootstrap[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > > +do_bootstrap[vardeps] += "DISTRO_APT_SOURCES" > > +do_bootstrap[vardeps] += "DISTRO_APT_PREMIRRORS" > > +do_bootstrap() { > > + if [ -e "${ROOTFSDIR}" ]; then > > + sudo umount -l "${ROOTFSDIR}/dev" || true > > + sudo umount -l "${ROOTFSDIR}/proc" || true > > + sudo rm -rf "${ROOTFSDIR}" > > + fi > > + E="${@bb.utils.export_proxies(d)}" > > + sudo -E "${DEBOOTSTRAP}" --verbose \ > > + --variant=minbase \ > > + --include=locales \ > > + ${@get_distro_components_argument(d)} \ > > + ${DEBOOTSTRAP_KEYRING} \ > > + "${@get_distro_suite(d)}" \ > > + "${ROOTFSDIR}" \ > > + "${@get_distro_source(d)}" > > +} > > +addtask bootstrap before do_build after do_generate_keyring > > + > > +do_deploy[stamp-extra-info] = "${DISTRO}-${HOST_ARCH}" > > +do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}" > > +do_deploy() { > > + ln -Tfsr "${ROOTFSDIR}" > > "${DEPLOY_DIR_IMAGE}/isar-bootstrap-${DISTRO}-${HOST_ARCH}" +} > > +addtask deploy before do_build after do_apt_update > > + > > +CLEANFUNCS = "clean_deploy" > > +clean_deploy() { > > + rm -f "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${HOST_ARCH}" > > +} >