From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6491554293275951104 X-Received: by 10.28.31.82 with SMTP id f79mr104460wmf.26.1513143827446; Tue, 12 Dec 2017 21:43:47 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.124.26 with SMTP id x26ls241726wmc.7.canary-gmail; Tue, 12 Dec 2017 21:43:46 -0800 (PST) X-Google-Smtp-Source: ACJfBotbmWP29/qynwrFA35wTaHui4iVYl0cmWf9bTb2JD4eB1sXk/8iROFVlO9F+zNAB7F7ip3v X-Received: by 10.28.191.90 with SMTP id p87mr104534wmf.26.1513143826758; Tue, 12 Dec 2017 21:43:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513143826; cv=none; d=google.com; s=arc-20160816; b=rVyv7JL3YPcfvviuSUln+aKHld1YM+zUH9Jo8A2w+yWy0QysJGRv/SeexFZV9X4g2W VskFZlBbsC5Yh32IQqshFMNQg4HQLZ9FbhsgPIDQYrc5TdCCnpL/fBBtdnxRxWuWGvcC b3XRTKstwqvOOS2EvFlqEvQr5pxroge3SflaiezKgbz3t+g6DThOLLOgdHyFGNfZO+rK dmwrGOj0TFOKxladv8cDvm9kaaKmEdZPCEIZtmfULtoxLwXjjXohmK5wEjXoQnXmOJmq dWupn6ZDelPnVjn7fPdv2VsZofrYQsSfQLGOTLrLUsyPyCSbMNaChfElHl6h0nv381TH cZDg== 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=ISf3n+PtTdwJ4/QSYR5uqNSFLnf0kAGCXVCDJW4ixYY=; b=wxhG3uOfE/sz6hqSOuUgyYTTUpiWd0XPPSTb4Iy+VND95soEljStPhJ4e5R5dew2SR 3b0o98zUiBfwjZ9HIjLDlby++r2/quNNElaJqlFIWBs1yxuDkIXXVVHV9ASJX5DcWy1W XS4poQd4RAxJWk/ElPjqILhKa5RNfF2tte7+dnZqH+9Hcw3cNtVjmNYDssZz3JfEvHv5 yB2+TGv8pKL+FWQiwGkN7q1pHwaRyEEqI3F8Yr6OTHaU3MJMhCEepR1d4GrZ7WCVvyDk dFW7mucJ0P4KBLKSD74Z5ZnxZxgz4/WwYrGFWyYmfgybJQ9XqwUo6WzqD2o2T96bpkW1 25DA== 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 h76si120247wmd.1.2017.12.12.21.43.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Dec 2017 21:43:46 -0800 (PST) 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 mail3.siemens.de (mail3.siemens.de [139.25.208.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id vBD5hknQ006096 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 Dec 2017 06:43:46 +0100 Received: from md1f2u6c.ww002.siemens.net ([167.87.0.128]) by mail3.siemens.de (8.15.2/8.15.2) with ESMTP id vBD5hjb5006655; Wed, 13 Dec 2017 06:43:46 +0100 Subject: Re: [PATCH 3/4 v2] buildchroot: Add prepare and cleanup tasks To: "[ext] Henning Schild" , Alexander Smirnov Cc: isar-users@googlegroups.com References: <20171123102532.26274-1-asmirnov@ilbers.de> <20171123102532.26274-4-asmirnov@ilbers.de> <20171211192958.79ff98e6@md1pvb1c> <20171212130521.53a9632c@md1pvb1c> From: Jan Kiszka Message-ID: <8d5c570e-2d7d-f35c-991e-717afffd3d5f@siemens.com> Date: Wed, 13 Dec 2017 06:43:44 +0100 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: <20171212130521.53a9632c@md1pvb1c> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: RP4V4xRCJJuV On 2017-12-12 13:05, [ext] Henning Schild wrote: > Am Mon, 11 Dec 2017 22:56:42 +0300 > schrieb Alexander Smirnov : > >> Hi, >> >> On 12/11/2017 09:29 PM, Henning Schild wrote: >>> Just found another issue with this one. Building something on >>> current next. >>> >>>>> ERROR: Nothing PROVIDES '${IMAGE_INSTALL}' (but >>>>> multiconfig:qemuamd64-stretch:/builder/isar/meta/recipes-devtools/buildchroot/buildchroot.bb >>>>> DEPENDS on or otherwise requires it) >>> >>> a 'IMAGE_INSTALL ?= ""' fixes that. >>> >> >> Thanks for this catch. >> >> It would be helpful if you describe your changes from upstream Isar >> that leads to this issue. Am I right, that you do not set >> IMAGE_INSTALL variable in local.conf file? > > Yes it is a layer with IMAGE_INSTALL not set in its local.conf, no > changes to Isar. > >> Also an ideas how to handle such cases in pure Isar are welcome. > > If we really need a VARIABLE to be initialized in a local.conf that > should probably be documented. If that was required, it would be a bug in the design. Such default initializations belong into a central conf file in the Isar repo that is of the required scope so that local.conf does not require any special additions. Jan > It might make sense to extend the testing to actually testing the > layering a well. Such a layer could be in the tree and we should build > targets with and without the layer. > > But before that we should probably sort meta and meta-isar. As far as i > see it "meta" should be the core of Isar while "meta-isar" could > eventually be the layer using that core. At the moment i do not really > have an idea what the idea behind the current split is, and whether > that cut is clean. > > I am already thinking about patches for more layering features, > i.e. customization of multistrap.conf. > > Henning > >> Alex >> >>> Henning >>> >>> 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" >>>> >>>> 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 >>> >> > -- Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence Center Embedded Linux