From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6490941990528614400 X-Received: by 10.223.139.198 with SMTP id w6mr1684446wra.4.1511291736986; Tue, 21 Nov 2017 11:15:36 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.128.150 with SMTP id b144ls458258wmd.2.canary-gmail; Tue, 21 Nov 2017 11:15:36 -0800 (PST) X-Google-Smtp-Source: AGs4zMaKGfU2YvjaKGQ8YVnpADGr1ffEsxV0Yj6W0UFTwr+eECPTls1MclXE41ogAA4T4Q4I54hv X-Received: by 10.223.142.214 with SMTP id q80mr1393009wrb.22.1511291736607; Tue, 21 Nov 2017 11:15:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511291736; cv=none; d=google.com; s=arc-20160816; b=h6VrlSKywXbGC7ewz7DKEkpk44HzYdIU3SBOFOEBViiSxX4iQ/HIXTw42MmREJCwjV rBahcdrMptFtecu3Uu80htSeaiEGh1jG9T7TpNiqgsTnA2wo+obiIu/IXE6kaiSPp2BV CYmsOS3bCpLrTtomHfjqs9d7uiJ6Jnsj8rjy8p8cWV7pAXvdLAYkrrq98SYQrWdAamp5 5erHt8dEJtZ86dUoDFghK9wza0AYNSt3+OVvOeyvCvnN69jfE0BotSEeXIA8wd0/T+TF UG9G1VmvPECWB3R5Ix20qWFcO286rtb4y/vMsG0R6F2iLXvA0hrzcDQFqV6r6F9+S4h1 vbdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=nDzCWaMKuTNlLSyIRVnVEINbi9QGx3kd4jn+DCbRSao=; b=XSz/FRITMsBmHL+kdmT+Nh/NB97/zQ/IBLZpnJ6jREaVkUU8WQYJau43+fPIuBDwvI 4ZEmUl7wYoQoHAu6BOTqBH47d0JD9rOJqdKr/nl/V03iov7Bf5OA1FljRbcHajVn7ZQb VKdap+498og9TqOmV6hgBSwzSifZcKU2JSkMQTHwY0omza7RefOxPQwlxhIddCSYUr9S fOI6xzoZfluKCVvxLXH5gMw9mQ9n6V6ynNIpAEUgsURfPhFWLMXB2dnABRHMfH7CzNwv t6/FNc29jpTWCG1VKQLYBd+jYurRjoyB2NUMuUwLzbG6vvx7s6FdfSaQjuTnglC1nphG IZkw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id i136si167161wmd.2.2017.11.21.11.15.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Nov 2017 11:15:36 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@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 henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@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 vALJFauW017949 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Nov 2017 20:15:36 +0100 Received: from md1em3qc ([139.25.68.40]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id vALJFaR5027158; Tue, 21 Nov 2017 20:15:36 +0100 Date: Tue, 21 Nov 2017 20:15:53 +0100 From: Henning Schild To: Alexander Smirnov Cc: Subject: Re: [PATCH 3/3] buildchroot: Add prepare and cleanup tasks Message-ID: <20171121201553.040b36b1@md1em3qc> In-Reply-To: <20171121184940.5425-4-asmirnov@ilbers.de> References: <20171121184940.5425-1-asmirnov@ilbers.de> <20171121184940.5425-4-asmirnov@ilbers.de> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: Y2HAUfXheM8J Please repost this with a use-case. At the moment i can only guess what that could be used for. What is the Issue? Henning Am Tue, 21 Nov 2017 21:49:40 +0300 schrieb Alexander Smirnov : > Some packages could require builchroot filesystem tunning, for > example share Isar downloads folder with chroot filesystem. > > This patch adds two tasks for buildchroot: > > 1. 'do_prepare': This task is executed after buildchroot rootfs > generation and before 'do_build' from packages to be built. > Some notes: > - An individual task is required for the case when you want to > rebuild some package, this would require to run this preparation > stuff for existing buildchroot rootfs. > - This task should not have stamp. This means that anytime you want > to build something, 'do_prepare' should be executed. > > 2. 'do_cleanup': This task is executed after all the packages are > deployed. Some notes: > - This task also should not have stamp. > - This task depends from the recipes listed in IMAGE_INSTALL. > > Signed-off-by: Alexander Smirnov > --- > meta/classes/dpkg-base.bbclass | 2 +- > meta/classes/image.bbclass | 1 + > meta/recipes-devtools/buildchroot/buildchroot.bb | 18 > ++++++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) > > diff --git a/meta/classes/dpkg-base.bbclass > b/meta/classes/dpkg-base.bbclass index 4941f9b..21ae88d 100644 > --- a/meta/classes/dpkg-base.bbclass > +++ b/meta/classes/dpkg-base.bbclass > @@ -2,7 +2,7 @@ > # Copyright (C) 2017 Siemens AG > > # Add dependency from buildchroot creation > -do_build[depends] = "buildchroot:do_build" > +do_build[depends] = "buildchroot:do_prepare" > > # Each package should have its own unique build folder, so use > # recipe name as identifier > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass > index 7813b16..b0f645c 100644 > --- a/meta/classes/image.bbclass > +++ b/meta/classes/image.bbclass > @@ -83,6 +83,7 @@ do_populate() { > > addtask populate before do_build after do_unpack > do_populate[deptask] = "do_deploy_deb" > +do_populate[depends] = "buildchroot:do_cleanup" > > do_rootfs[stamp-extra-info] = "${MACHINE}-${DISTRO}" > > diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb > b/meta/recipes-devtools/buildchroot/buildchroot.bb index > 6a94733..4be094c 100644 --- > a/meta/recipes-devtools/buildchroot/buildchroot.bb +++ > b/meta/recipes-devtools/buildchroot/buildchroot.bb @@ -71,3 +71,21 @@ > do_build() { sudo chroot ${BUILDCHROOT_DIR} /configscript.sh > _do_build_cleanup > } > + > +do_prepare[nostamp] = "1" > + > +do_prepare() { > + bbnote "Prepare buildchroot for packages building" > +} > + > +addtask prepare after do_build > + > +DEPENDS += "${IMAGE_INSTALL}" > +do_cleanup[deptask] = "do_deploy_deb" > +do_cleanup[nostamp] = "1" > + > +do_cleanup() { > + bbnote "Cleanup buildchroot after packages building" > +} > + > +addtask cleanup after do_prepare