From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6490941990528614400 X-Received: by 10.28.148.214 with SMTP id w205mr298607wmd.6.1511293006904; Tue, 21 Nov 2017 11:36:46 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.223.156.134 with SMTP id d6ls480172wre.14.gmail; Tue, 21 Nov 2017 11:36:46 -0800 (PST) X-Google-Smtp-Source: AGs4zMbzamklQ8xWd66DIV/IGV2m6r6KNsRdAvZ50yNVujpmgEbOpbjYVjvzT8Ki2Ioefqh2oRZO X-Received: by 10.223.141.212 with SMTP id o78mr1481676wrb.13.1511293006636; Tue, 21 Nov 2017 11:36:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511293006; cv=none; d=google.com; s=arc-20160816; b=J5t607JYnSa0i4v1w8AeBmeUcaiMUP1zOMhmz3Af89G/p3STGM09Z87tMpuwQMASbY F7ANkPhXe9AVnh4gMMH8PqOWCUN9SmOpCmrYuWwiqgFADMIA6Igzb5nlwpgjFRiqk7rl mikh9ymYZlXHxcJgc2vi2xeh1Lto44PV0yqgPesbOGIapUW0ZvhQ9hfN/6621JGDfHWY m+IgCBRN4tlRkgcu8JMtv2zqyvaUfzj0cKH7SW4MSRvG6fQDgosSlFg+sbR3Gb3lvc19 5xDcVC0+o5zb7GJy/+B42bYWSj2SxHUtA/Cv/EPhNmFipKweBNKLn8xzOb0aQm+EwaR+ npTw== 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:cc:to:subject :arc-authentication-results; bh=yUMQvGFWcNkfnNiS+vSqcVprY/UG0roHgjeGqOuvgZw=; b=KukQzMYy8ipgPZe+qeSCDG89puMn2a88gZtd5SDuEuXT0kDG3VnDVUZ7ITe538z21U uuzs5+QbpV/sIuy/x6cSOU9h1b0EHkUXJKh0R0R1nNc4iqs3McnVQ8yTaKxRkvLOaF1K HGoQWvLKMBIXf2ZbpYvFM6GsGj4Y+xS/Ap2wkPcwLmZRVLJQMF7XDysxfN73c2bHj/72 /Roq+0gRKVw7xT5CEjdRCgXl5O7RfEYjxENzdeOSIwdDQ+rfkdVMnOaa7XitsIoBQso/ Tj65xIa7e1VKIu4BlNnM25iySUvtfuEWkEQF6VV/KBvkoUR5SVtSq3TejMb1VA0Bhizn 5qEg== 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 c51si1004836wrc.1.2017.11.21.11.36.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Nov 2017 11:36:46 -0800 (PST) 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 [10.0.2.15] ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id vALJagwX001672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 21 Nov 2017 20:36:45 +0100 Subject: Re: [PATCH 3/3] buildchroot: Add prepare and cleanup tasks To: Henning Schild Cc: isar-users@googlegroups.com References: <20171121184940.5425-1-asmirnov@ilbers.de> <20171121184940.5425-4-asmirnov@ilbers.de> <20171121201553.040b36b1@md1em3qc> From: Alexander Smirnov Message-ID: Date: Tue, 21 Nov 2017 22:36:37 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171121201553.040b36b1@md1em3qc> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: RdZrGb2UP+ic On 11/21/2017 10:15 PM, Henning Schild wrote: > Please repost this with a use-case. At the moment i can only guess what > that could be used for. What is the Issue? > The issue is the same: - mount downloads to buildchroot - build packages - umount downloads from buildchroot It would be nice to discuss the overall approach before implementing specific usecase to avoid unnecessary effort. The series to apply will include use-case for sure. Alex > 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 > -- With best regards, Alexander Smirnov ilbers GmbH Baierbrunner Str. 28c D-81379 Munich +49 (89) 122 67 24-0 http://ilbers.de/ Commercial register Munich, HRB 214197 General manager: Baurzhan Ismagulov