From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6467463440282681344 X-Received: by 10.223.176.122 with SMTP id g55mr373592wra.29.1506959153713; Mon, 02 Oct 2017 08:45:53 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.184.83 with SMTP id i80ls2148561wmf.5.canary-gmail; Mon, 02 Oct 2017 08:45:53 -0700 (PDT) X-Google-Smtp-Source: AOwi7QC4A7bVGBh+nW/sBl/kVS1JmvH4h2eVWwf5pNybxlA4cD2U/mRTZFxg/VW7tt6GW9uqwTW7 X-Received: by 10.28.131.208 with SMTP id f199mr1883510wmd.11.1506959153449; Mon, 02 Oct 2017 08:45:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506959153; cv=none; d=google.com; s=arc-20160816; b=ATrN52c39KcNb822Vs0jHYV2IDJUV/JJ4EL++VWoUMbEF8L/GWSNsuIs23tAWpRQWu r+/dhk66HP44Yn5PIIKW/79sWpQpF6RgADbTerQcOiWLiuVOVtpbedtNCiyvWnExwSdJ Zpoth0weEB5l2qS/dPX64Z4dpj3D7P3tSzIpNnnI8zzFlGNa4GIe8A/XrlDpSHBCJEJd 4nBb4854SfUIn2Z34r4kebe08FJuOFnI+JUmPQZPOAtsJ0oc4jyM4OuO2pBcwZ1OwZd1 +TPAZeRaDAML1XHTYazuLAgyUb3abXJzkBzpZApGSkGsM9snOLXgo+NBBTyoi7ZL+f2P YOcQ== 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=Yz3iU9BvHX3RJpI4ieEkwi9kGQuotD3GHI05pNK9wi8=; b=I8lQTBdwypTsqmfNTw+bkuNmSbW5PSj7F4pko9fpdvvnOvKoJBBcngRUG16Zl/nqe7 bQbxJQFr2ayjsjf78bveN0fMF8k2jnCr1OU88RN4oR6L2hCws7ZTAOlEsWJVdFfOxjql Mus1jdzK1Wdc/xYRwwRQ3+RdELTaayS8DS6UML0xP+4kdC7YTI/xW2HipZBAsD3jA8u3 FUMeY9ELiJA7qUg9dtLP1pU7XCY5k960AS8ECf0zMnHLrcnzGfkWI4/2BHaswQJclf0I Bo/MCPIrcgnb51hO85SD/zXgBbSd9VfwzELZWabZrMwMGiUHCepc64eqda9ZQwL3RUeE U8OQ== 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 200si1553517wmj.0.2017.10.02.08.45.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Oct 2017 08:45:53 -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 v92Fjc8A020957 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 2 Oct 2017 17:45:45 +0200 From: Alexander Smirnov To: isar-users@googlegroups.com Cc: Alexander Smirnov Subject: [PATCH 1/4] meta-isar-bin: Add reprepro configs Date: Mon, 2 Oct 2017 18:45:28 +0300 Message-Id: <20171002154531.4930-2-asmirnov@ilbers.de> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20171002154531.4930-1-asmirnov@ilbers.de> References: <20171002154531.4930-1-asmirnov@ilbers.de> X-TUID: fBXYMfHA9wUg Add template for reprepro configuration file and function that generates final config for specific deistro. Signed-off-by: Alexander Smirnov --- meta-isar-bin/conf/layer.conf | 11 +++++++++++ meta-isar-bin/files/distributions.in | 3 +++ meta-isar/conf/bblayers.conf.sample | 1 + meta/classes/image.bbclass | 15 +++++++++++++++ 4 files changed, 30 insertions(+) create mode 100644 meta-isar-bin/conf/layer.conf create mode 100644 meta-isar-bin/files/distributions.in diff --git a/meta-isar-bin/conf/layer.conf b/meta-isar-bin/conf/layer.conf new file mode 100644 index 0000000..3518184 --- /dev/null +++ b/meta-isar-bin/conf/layer.conf @@ -0,0 +1,11 @@ +# This software is a part of ISAR. +# Copyright (C) 2017 ilbers GmbH + +# Codename of the repository created by the caching class +DEBDISTRONAME = "isar" + +# Path to the caching repository +DEBCACHEDIR ?= "${LAYERDIR}/apt" + +# Path to the configuration files templates used by `reprepro` +DEBFILESDIR ?= "${LAYERDIR}/files" diff --git a/meta-isar-bin/files/distributions.in b/meta-isar-bin/files/distributions.in new file mode 100644 index 0000000..cd214c6 --- /dev/null +++ b/meta-isar-bin/files/distributions.in @@ -0,0 +1,3 @@ +Codename: {DISTRO_NAME} +Architectures: i386 armhf amd64 source +Components: main diff --git a/meta-isar/conf/bblayers.conf.sample b/meta-isar/conf/bblayers.conf.sample index 80867e7..53a362b 100644 --- a/meta-isar/conf/bblayers.conf.sample +++ b/meta-isar/conf/bblayers.conf.sample @@ -8,6 +8,7 @@ BBFILES ?= "" BBLAYERS ?= " \ ##ISARROOT##/meta \ ##ISARROOT##/meta-isar \ + ##ISARROOT##/meta-isar-bin \ " BBLAYERS_NON_REMOVABLE ?= " \ ##ISARROOT##/meta \ diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 5bf9524..d30b139 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -10,6 +10,21 @@ IMAGE_ROOTFS = "${WORKDIR}/rootfs" inherit ${IMAGE_TYPE} +CACHE_CONF_DIR = "${DEBCACHEDIR}/${DISTRO}/conf" +do_cache_config[dirs] = "${CACHE_CONF_DIR}" +do_cache_config[stamp-extra-info] = "${DISTRO}" + +# Generate reprepro config for current distro if it doesn't exist. Once it's +# generated, this task should do nothing. +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 +} + +addtask cache_config before do_fetch + do_populate[stamp-extra-info] = "${DISTRO}-${MACHINE}" # Install Debian packages, that were built from sources -- 2.1.4