From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6577660805416747008 X-Received: by 2002:a1c:7e91:: with SMTP id z139-v6mr657025wmc.11.1531492438108; Fri, 13 Jul 2018 07:33:58 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:eb4b:: with SMTP id u11-v6ls2912209wrn.0.gmail; Fri, 13 Jul 2018 07:33:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeha9YvnKTqo7v2oH7H1Tc87YVNfiIwoAtv+Otpj5G87IrcOlK3MW2/w1OrJL//VbvFs1zJ X-Received: by 2002:adf:ee03:: with SMTP id y3-v6mr726578wrn.20.1531492437559; Fri, 13 Jul 2018 07:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531492437; cv=none; d=google.com; s=arc-20160816; b=GHQH2sB6kOFHsfSGULwexUHXDt7nO2XzfJA5tP7+046l4p59WO9HP9VVkB1WScy08l DecpIKMY3jmbkIKjjlTOGv3JAePuK6lyXaU9GP1K0oAHPC3Ui/5VrZq+fF636uKMJRLX ofvNZBdj1ssyD+j2QHvTRZW8T5KYPR7XfGG4BFIJnxUBQqkWtguLf3jdq/W2KLd2f2AX f3jC269xijlv+s36B/VH0mg4HDgHpqrCF7rgPPks+z0TQj6P7PeH1FUYZlQYn/ck7IQK r7nvnSQ3Ymteujf0Zdib5rz/sSxHsGKmRWk+YWIgUny4wN9C/hr0v7hBh3W50xJ3R/Yb GPTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :arc-authentication-results; bh=a2lv8Ya1riBvFCJcGtme09d/Sx4WJiFdgulk+jd3E5c=; b=lBYOW2aGs3FTcwpkk6MopkSY0uGpcXBvOvFAQtuAx42+OuEseQXdlh/VfYE2m9FIz4 nbo4oopsdBY33AX67rjrgRkSxg7wGQobeqGnDcX0Kh0jg6FPWWIHPgQOoIfsc6BEXMl2 +fRTOx38TDabScTDS2uypPGonvGmCqaZoqXxAtpLFGeqrC6BGzLADUJw19P1oPUhBhua hKLQp+Gr9r3E7x+ZlC7UezrwShFiAmbx6US1aprWcLgOLFZaHZCW4GoCu9PRRzpUWSbj uBCmRdSuwzqsQoFXoV61Id4HkxkVdo8wFIfhjX2zD/RBwJG4MWPgj+V0MHEKV4UXGeWm x6lw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) 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 d18-v6si641197wrq.4.2018.07.13.07.33.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jul 2018 07:33:57 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w6DEXv0S004879 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Jul 2018 16:33:57 +0200 Received: from [139.25.68.37] (md1q0hnc.ad001.siemens.net [139.25.68.37] (may be forged)) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id w6DEXue5023514; Fri, 13 Jul 2018 16:33:57 +0200 Subject: Re: [PATCH] isar-bootstrap: Eliminate multiple debootstraps for the same distro/host To: "Maxim Yu. Osipov" , isar-users@googlegroups.com References: <20180713112259.19647-1-mosipov@ilbers.de> From: Jan Kiszka Message-ID: <28698641-b811-2973-9daf-e68c8de53cf3@siemens.com> Date: Fri, 13 Jul 2018 16:33:56 +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 In-Reply-To: <20180713112259.19647-1-mosipov@ilbers.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: D08NY+ipFchr On 2018-07-13 13:22, Maxim Yu. Osipov wrote: > After applying this patch only single debootstrap for > particular platform is created and pointed by corresponding > link uder DEPLOY_DIR_IMAGE. under > > For proper locking of parallel builds shell tasks > apt_config_install, set_locale, setup_chroot, apt_update > and deploy were collapsed to common debotstrap helper. debootstrap > Due to problems in bitbake with shell functions expansion > under quotes these functions were substituted by their > bodies. But this implies no code duplications, just inlining, right? > > Signed-off-by: Maxim Yu. Osipov > --- > meta/classes/image.bbclass | 2 +- > .../isar-bootstrap/isar-bootstrap-host.bb | 57 +++------ > .../isar-bootstrap/isar-bootstrap-target.bb | 52 +++------ > .../recipes-core/isar-bootstrap/isar-bootstrap.inc | 127 ++++++++++++++------- > meta/recipes-devtools/buildchroot/buildchroot.bb | 2 +- > meta/recipes-devtools/sdkchroot/sdkchroot.bb | 2 +- > 6 files changed, 119 insertions(+), 123 deletions(-) > > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass > index 7935b69..20eb3fd 100644 > --- a/meta/classes/image.bbclass > +++ b/meta/classes/image.bbclass > @@ -66,7 +66,7 @@ INITRD_IMAGE ?= "${@get_image_name(d, 'initrd.img')[1]}" > inherit ${IMAGE_TYPE} > > do_rootfs[stamp-extra-info] = "${MACHINE}-${DISTRO}" > -do_rootfs[depends] = "isar-apt:do_cache_config isar-bootstrap-target:do_deploy" > +do_rootfs[depends] = "isar-apt:do_cache_config isar-bootstrap-target:do_bootstrap" > > do_rootfs() { > die "No root filesystem function defined, please implement in your recipe" > diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb > index cca0984..3996d8d 100644 > --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb > +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb > @@ -8,13 +8,15 @@ > Description = "Minimal host Debian root file system" > > WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}-${HOST_DISTRO}-${HOST_ARCH}" > +DEPLOY_ISAR_BOOTSTRAP = "${DEPLOY_DIR_IMAGE}/isar-bootstrap-${HOST_DISTRO}-${HOST_ARCH}" > +ISAR_BOOTSTRAP_LOCK = "${DEPLOY_DIR_IMAGE}/isar-bootstrap-${HOST_DISTRO}-${HOST_ARCH}.lock" > > include isar-bootstrap.inc > inherit isar-bootstrap-helper > > -do_generate_keyring[stamp-extra-info] = "${HOST_DISTRO}-${HOST_ARCH}" > +do_generate_keyring[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > > -do_apt_config_prepare[stamp-extra-info] = "${HOST_DISTRO}-${HOST_ARCH}" > +do_apt_config_prepare[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > do_apt_config_prepare[dirs] = "${WORKDIR}" > do_apt_config_prepare[vardeps] += "\ > APTPREFS \ > @@ -22,54 +24,25 @@ do_apt_config_prepare[vardeps] += "\ > DEBDISTRONAME \ > APTSRCS \ > HOST_DISTRO_APT_SOURCES \ > + DEPLOY_ISAR_BOOTSTRAP \ > " > python do_apt_config_prepare() { > - apt_preferences_out = d.getVar("APTPREFS", True) > - apt_preferences_list = (d.getVar("HOST_DISTRO_APT_PREFERENCES", True) or "" > - ).split() > - aggregate_files(d, apt_preferences_list, apt_preferences_out) > + if not os.path.islink(d.getVar("DEPLOY_ISAR_BOOTSTRAP", True)): > + apt_preferences_out = d.getVar("APTPREFS", True) > + apt_preferences_list = (d.getVar("HOST_DISTRO_APT_PREFERENCES", True) or "" > + ).split() > + aggregate_files(d, apt_preferences_list, apt_preferences_out) Shouldn't this be indented consistently (4 space)? Also in the rest of the patch. Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux