From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6467463440282681344 X-Received: by 10.25.77.17 with SMTP id a17mr118384lfb.21.1505895988915; Wed, 20 Sep 2017 01:26:28 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.2.28 with SMTP id 28ls77519ljc.5.gmail; Wed, 20 Sep 2017 01:26:28 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBv57zC2bKfu6hqaeADPZLvvItDZ9CB3UbGrvd1BTqb8HDIOw6f6rgMv2Ht8wA11GT+VKpJ X-Received: by 10.25.207.83 with SMTP id f80mr129019lfg.0.1505895988578; Wed, 20 Sep 2017 01:26:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505895988; cv=none; d=google.com; s=arc-20160816; b=XJ4I+ygkjh2ewoCSoW7gj4qbg/IoemUT2E46rRSUdLKxJWH4LtNd0rPqtgIL70y6vr KXAVbVjZ56B/dfOMYxNDglL58T1LFuLG5ZEHIFbDDjOBx+TRzdqZ/D8bZR7LZ4fqEZUf 5pIE+W1xHni8WWZyx8pVTIKSpVP2D7JjLs6pfIlzWZva594okoFLGDcT4T2yctHzja5r bfMKQnFxgrIl3d/+GyHcTULGsA7T71kyShM6nSOODGr4+ufrQMCpZ5pU7z67TT8bxSy0 l521H3Uv8YPV4oOfsElr+TBdZKWeKV6KEHrGOmBSVjAjSphbV6IuRePVuoBWEkXBJk2B WrXQ== 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=XUqhh3Bf4tfhUkJM2EcvZT9L8tnCh11vXGAPvdeOjeI=; b=xApgEIoArQrG3wySSYJjIejEuqNFXrCiu+9XwjTAz7UbgQrFNks8O6s9gglcYAtIpO zBfeyvk6QWQ4iPLwerxEI5b+gafLKeZZMQPUYF0I35BLG2nQDAIsE1/sbq3/rHVpmmJg 38fNzGIoRuN1muDXuap3BVno4bqdzRg+OpDnFLwJeowINb5BinViUqu3p4Dd7GVtlv9U O+bMfA7if8PAINai9JT6XLhtt5HXdvtcCG/vfmpVLRMBAhw6soyKnyhAHSMGwzRz173P Cw0LJLJEt/ABC0ZpW7BcXaw4hbSa1V0zNhfU08LvU311t/0uiDp03p57GH0h11utfZbb nb+w== 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 j4si108903wmi.2.2017.09.20.01.26.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Sep 2017 01:26:28 -0700 (PDT) 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 v8K8QPLP013162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 20 Sep 2017 10:26:27 +0200 Subject: Re: [PATCH v2 2/4] meta-isar-bin: Generate cache repos To: Henning Schild Cc: isar-users@googlegroups.com References: <20170919122052.28688-1-asmirnov@ilbers.de> <20170919122052.28688-3-asmirnov@ilbers.de> <20170920101159.5b086d0c@md1em3qc> From: Alexander Smirnov Message-ID: <69b055e2-e711-8a94-3e1b-0f066566d7d1@ilbers.de> Date: Wed, 20 Sep 2017 11:26:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170920101159.5b086d0c@md1em3qc> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: z/YeOF7+E+ND On 09/20/2017 11:11 AM, Henning Schild wrote: > Am Tue, 19 Sep 2017 15:20:50 +0300 > schrieb Alexander Smirnov : > >> Generate repos for each configuration in multiconfig. >> >> Signed-off-by: Alexander Smirnov >> --- >> meta-isar-bin/conf/layer.conf | 3 +++ >> meta/classes/image.bbclass | 14 ++++++++++++++ >> 2 files changed, 17 insertions(+) >> >> diff --git a/meta-isar-bin/conf/layer.conf >> b/meta-isar-bin/conf/layer.conf index 3518184..5ef6e60 100644 >> --- a/meta-isar-bin/conf/layer.conf >> +++ b/meta-isar-bin/conf/layer.conf >> @@ -9,3 +9,6 @@ DEBCACHEDIR ?= "${LAYERDIR}/apt" >> >> # Path to the configuration files templates used by `reprepro` >> DEBFILESDIR ?= "${LAYERDIR}/files" >> + >> +# Path to the databases used by `reprepro` >> +DEBDBDIR ?= "${LAYERDIR}/db" >> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass >> index 30f241a..9db7371 100644 >> --- a/meta/classes/image.bbclass >> +++ b/meta/classes/image.bbclass >> @@ -35,6 +35,20 @@ python __anonymous () { >> f.close() >> } >> >> +do_create_cache_db[stamp-extra-info] = "${DISTRO}" >> + >> +do_create_cache_db() { >> + path_cache="${DEBCACHEDIR}/${DISTRO}" >> + path_databases="${DEBDBDIR}/${DISTRO}" >> + >> + if [ ! -d "${path_databases}" ]; then >> + reprepro --waitforlock 3 -b ${path_cache} --dbdir >> ${path_databases} \ >> + export ${DEBDISTRONAME} >> + fi >> +} >> + >> +addtask create_cache_db before do_fetch > > This adds a new tool dependency, maybe update docs with the patch or > keep in mind for later. For sure, I'll document everything before merge, when we agree on general architecture. > > Why "waitforlock 3" is there any chance at all that multiple images run > into that at the same time? And if so how do we know 3 is enough? I just > tested that a second "reprepro export" will still return 0, so it seems > safe to do that multiple times, not sure what would happen if some > packages where already added and you "export" again. Yes, this task could be run multiple times, for example by the following line: bitbake \ multiconfig:qemuarm-jessie:isar-image-base \ multiconfig:qemui386-jessie:isar-image-base \ multiconfig:qemuamd64-jessie:isar-image-base I'll start jessie build for 3 architectures: - arm - i386 - amd64 After build, there will be the following in the cache (example for hello): $ ls -1 meta-isar-bin/apt/debian-jessie/pool/main/h/hello/ hello_0.1+g7f35942-1_amd64.deb hello_0.1+g7f35942-1_armhf.deb hello_0.1+g7f35942-1_i386.deb So using waitforlock is an attempt to protect reprepro from crashing. In general this will never happen for single-distro single-arch builds. Alex > > Henning > >> do_populate[stamp-extra-info] = "${DISTRO}-${MACHINE}" >> >> # Install Debian packages, that were built from sources > -- 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