From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6467463440282681344 X-Received: by 10.25.228.65 with SMTP id b62mr463515lfh.37.1506333626037; Mon, 25 Sep 2017 03:00:26 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.20.17 with SMTP id u17ls2280192ljd.9.gmail; Mon, 25 Sep 2017 03:00:25 -0700 (PDT) X-Google-Smtp-Source: AOwi7QA2LNI4qkT1SXtTESTNDcjHKRXVQWpz5GXqqPfIDkHL2gE4Zggr0SyULOo/KxcDLpEDtLU8 X-Received: by 10.25.155.140 with SMTP id d134mr492115lfe.28.1506333625746; Mon, 25 Sep 2017 03:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506333625; cv=none; d=google.com; s=arc-20160816; b=bqGJfIX+BMb8FQPIiap8yw7QMSrZ1e4cPhluMkCYuwEgU/fFnc3mqVsW+6H1yfKw+2 ajBriTxOmHNqGIFJBK/ERxhJA6Hdq6S7NH67/5bqKPpMLrPceZ6P62fcPAsYxVUPHpqY eNo9+/pJqrE+DyLEVe4hojwlGMnLyS8zxL+7fPFOfQ9Hdbo9ZiCQZmf50q/Z/mHEXogS qCN2iA9CjkOkzOdsBZloQxKXOm1uHauYRd1v9XunStBeov39vNnXhSwukTh/H4a1EaSm ePxuaV1k/HLSrcUfRoa5OklM0qV9kf178glaAOHgQwPgQ1ziNdS4rDbSVoBZYP7taluS XAhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+VbKq9cV61HrcmB5EkX0OXapwzc6fj2Z2UybVdO7OBM=; b=xrL9s9IX35Shhq+6RAg3FVwaNUCTVsMvwldZ9hMkPPAhIOMnmO2PV7z/2VqN5tmFtF J6rf/J7hVFEeijQe99Kz4SCPLUDy9fKr6PGlFpcKU6dEFdloXAT1UIpHmuvInC367R99 qbP3iHO6Y6tDEEU4lEe9KY84Wt+FyftkuSTkmtIu0o67C+k/O6RdJ+Ur54jROrxRAcU5 ck86+wRqetg/xVfMoC36nge41cxvDWvgLDjKd/C80HXauchV8m7CxtGxXRkFa+njSqMM RdA/mjzjX835PQdoscLn2elIfPvfuJ2g0UmJ3TJ1Ii/jgsjSjsY19skILdJxVzFDAsxB INCQ== 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 p70si442319wma.1.2017.09.25.03.00.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Sep 2017 03:00:25 -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 localhost.localdomain ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id v8PA07Fd002132 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Sep 2017 12:00:14 +0200 From: Alexander Smirnov To: isar-users@googlegroups.com Cc: Alexander Smirnov Subject: [PATCH v3 2/4] meta-isar-bin: Generate cache repos Date: Mon, 25 Sep 2017 12:59:58 +0300 Message-Id: <20170925100000.5368-3-asmirnov@ilbers.de> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170925100000.5368-1-asmirnov@ilbers.de> References: <20170925100000.5368-1-asmirnov@ilbers.de> X-TUID: lXbA2tABP6sQ Generate repos for each configuration in multiconfig. Signed-off-by: Alexander Smirnov --- meta-isar-bin/conf/layer.conf | 3 +++ meta-isar/conf/local.conf.sample | 4 ++++ meta/classes/image.bbclass | 16 ++++++++++++++++ 3 files changed, 23 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-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample index a456b1b..660958f 100644 --- a/meta-isar/conf/local.conf.sample +++ b/meta-isar/conf/local.conf.sample @@ -158,3 +158,7 @@ IMAGE_INSTALL = "hello example-raw" # # Default parallel jobs for bitbake: BB_NUMBER_THREADS = "4" + +# +# Number of attempts to try to get reprepro lock for access to apt cache +REPREPRO_LOCK_ATTEMPTS = "16" diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 9ab9b19..6f39c7a 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -14,11 +14,27 @@ CACHE_CONF_DIR = "${DEBCACHEDIR}/${DISTRO}/conf" do_cache_config[dirs] = "${CACHE_CONF_DIR}" do_cache_config[stamp-extra-info] = "${DISTRO}" +call_reprepro() { + for i in $(seq 1 ${REPREPRO_LOCK_ATTEMPTS}); do + reprepro --waitforlock 5 $* \ + || bbwarn "Failed to get reprepro lock, trying again..." + done +} + do_cache_config() { if [ ! -e "${CACHE_CONF_DIR}/distributions" ]; then sed -e "s#{DISTRO_NAME}#"${DEBDISTRONAME}"#g" \ ${DEBFILESDIR}/distributions.in > ${CACHE_CONF_DIR}/distributions fi + + path_cache="${DEBCACHEDIR}/${DISTRO}" + path_databases="${DEBDBDIR}/${DISTRO}" + + if [ ! -d "${path_databases}" ]; then + call_reprepro -b ${path_cache} \ + --dbdir ${path_databases} \ + export ${DEBDISTRONAME} + fi } addtask cache_config before do_fetch -- 2.1.4