From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6491554293275951104 X-Received: by 10.80.242.138 with SMTP id f10mr4246544edm.11.1511769380911; Sun, 26 Nov 2017 23:56:20 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.80.219.194 with SMTP id s2ls6902795edk.5.gmail; Sun, 26 Nov 2017 23:56:20 -0800 (PST) X-Google-Smtp-Source: AGs4zMZbo0amcIO8CCEQgWSCrcheQGpVsOPVn7Y0nysmZtqMttgRdCb7r+EQ7/6g4m8troGMjgly X-Received: by 10.80.164.203 with SMTP id x11mr10449936edb.7.1511769380599; Sun, 26 Nov 2017 23:56:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511769380; cv=none; d=google.com; s=arc-20160816; b=q0k56Ll+mbZGSO2Cei6Hksf+AWtgjMJQfGmvLqjbkSbbJkrGEZZRnWIpWGQf80ryGE pSgZERMi4SDzCM77ZBdo6XOYrXwA16eHzNe18SF8kBeqpXrphcByOM9OiaueUuJeAhUs 4EQJ7v4yHIDgjqR83EpLsPLXpCpu2s4y1EAMm2Pqsx0bnSlF3tdVLYU8xu1qiVsg+Hr2 qtAwdRnDaqKe+lNH6A0FDmmndQSXoIoQ7NCheYhMl16XV1eSCObTMMDx74XH5dr3kIxk 79CafXoIM0ETm+SndVyvoDnW51u29QiRSO6+jhEDv3MBNoMB/M5ZEEq3i+eT34crzuij UqrQ== 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=OwqSw5bVJSQRJWzTpyctXoeo9XR8malJPyszU0NUqDA=; b=wb7xh4KXZPStbq74RmWLLPLNDXVShOaIk4kCBVo1BoUYum4wNxXYKPkSNxI8OrJ5AK dKGONvpNMfzg7VTK2MsySp80hJgYk/52tOjZJLt7oFlhMnN13t1f43lAJL3Li3BhqYo2 9stLsrkKa3FgBdxgH+Pl0HaOQRY8kpzdzt33oJDpOSG7UTrLyZD5VrwdSTscaJ18TQND vUyrCPGrkDIs0cXuGDxA44PY9XX2vpIq79FbnUmF3dIjn0hIy4McDTqcGRYBWav0ixEx YH2W5FJk2P+WYp3DgOht8v3EEGBzfH7F7r4n1EebQfFvLVnYhFqLBMAH4eW3xTxaCKRO O1og== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id h23si161472ede.4.2017.11.26.23.56.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Nov 2017 23:56:20 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id vAR7uKdx004982 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Nov 2017 08:56:20 +0100 Received: from md1em3qc ([167.87.0.164]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id vAR7uJh6027508; Mon, 27 Nov 2017 08:56:19 +0100 Date: Mon, 27 Nov 2017 08:56:19 +0100 From: Henning Schild To: Alexander Smirnov Cc: Subject: Re: [PATCH 3/4 v2] buildchroot: Add prepare and cleanup tasks Message-ID: <20171127085619.755c58f5@md1em3qc> In-Reply-To: <1456b2b1-7c28-6fa6-11a9-74d851417af2@ilbers.de> References: <20171123102532.26274-1-asmirnov@ilbers.de> <20171123102532.26274-4-asmirnov@ilbers.de> <20171124173408.7a2cc881@md1em3qc> <1456b2b1-7c28-6fa6-11a9-74d851417af2@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: nRU1USdS0ffb Am Fri, 24 Nov 2017 19:51:26 +0300 schrieb Alexander Smirnov : > On 11/24/2017 07:34 PM, Henning Schild wrote: > > Am Thu, 23 Nov 2017 13:25:31 +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 | 21 > >> +++++++++++++++++++++ 3 files changed, 23 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" > > > > Why do we need that? To me that looks redundant. > > 1. buildchroot:do_cleanup task should be executed after all the > packages are build, so that's why the following is used: > > DEPENDS += "${IMAGE_INSTALL}" > do_cleanup[deptask] = "do_deploy_deb" That one is clear. > 2. buildchroot:do_cleanup should be somehow integrated to Isar > pipeline, so some dependency from late task (which runs after > packages building) should be added. I chose image:do_populate, so the > following line forces Isar to run do_cleanup during build: > > do_populate[depends] = "buildchroot:do_cleanup" If you do not depend on it in the image-recipe, will it not be executed? Please remember that we discussed dropping do_populate, so it might be a good idea to integrate that step somewhere else. Maybe give the image its own do_cleanup. https://groups.google.com/d/msg/isar-users/efer3RF989o/mB5Fce9WBgAJ Henning > Alex > > > > > Henning > > > >> 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..fe88e98 100644 --- > >> a/meta/recipes-devtools/buildchroot/buildchroot.bb +++ > >> b/meta/recipes-devtools/buildchroot/buildchroot.bb @@ -67,7 +67,28 > >> @@ do_build() { # Install package builder script > >> sudo install -m 755 ${WORKDIR}/build.sh ${BUILDCHROOT_DIR} > >> > >> + # Create share point for downloads > >> + sudo install -d ${BUILDCHROOT_DIR}/git > >> + > >> # Configure root filesystem > >> sudo chroot ${BUILDCHROOT_DIR} /configscript.sh > >> _do_build_cleanup > >> } > >> + > >> +do_prepare[nostamp] = "1" > >> + > >> +do_prepare() { > >> + sudo mount --bind ${GITDIR} ${BUILDCHROOT_DIR}/git > >> +} > >> + > >> +addtask prepare after do_build > >> + > >> +DEPENDS += "${IMAGE_INSTALL}" > >> +do_cleanup[deptask] = "do_deploy_deb" > >> +do_cleanup[nostamp] = "1" > >> + > >> +do_cleanup() { > >> + sudo umount ${BUILDCHROOT_DIR}/git > >> +} > >> + > >> +addtask cleanup after do_prepare > > >