From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6467463440282681344 X-Received: by 10.25.225.195 with SMTP id l64mr142670lfk.16.1505823675519; Tue, 19 Sep 2017 05:21:15 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.68.4 with SMTP id r4ls810176lja.19.gmail; Tue, 19 Sep 2017 05:21:15 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCeTYbLZOZLpPMUJhPyIf6DP4PtUZFaYaSN3vL+xz819tqgkS1r8tF5tyWEgsaoWtb2JLSJ X-Received: by 10.46.91.143 with SMTP id m15mr144815lje.2.1505823675105; Tue, 19 Sep 2017 05:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505823675; cv=none; d=google.com; s=arc-20160816; b=jL/icVpDcMZbDBsCmoMA4+ZDyHHMHeAZ6mF6I5PeqL84v+nRjff9hdTKI1RrOQyvdX vBOsRjsU+XAR5ewYbSA2BGfcTgGHnYfavHaaxpiSTuZc/gsmbNPvV4qyXdp3GffAPT1O wf4TgrIyz4GxqG2oLoVwEgBMPeJ6IYUTMtjdlbvrjuspGBp+3vI5Knh8LqoiV9k7Fjai jmzDWBcx52iIXhyVJqsb0t4z6iglKb4hyHZcNRNnckXca867FAnsNl2+lNq9AB46EXMg /HPcv+Cr8fucneo4H0ZWjyEtCNG0qbYU5cENhtuTqlzGxhtpqDziOTiK5EFmnPFr1Dg8 izOA== 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=2NdBB0pSU13+/aZqfVP799hOt/531rFMtBzLb0/EdoY=; b=sAVDWg2yMCpoOODWox6HWvXOIVLDn3gQXLTn5F8qWNAaa7/lpV5IeiEuSje9/fioe6 r304dJ3lmZiJHApRz0a9Ok9EnCwM73hvA48Ni3hUsy442E2CKs3zBLrSHx+2efOj4/ct +/fTEcCnST7y+eX2VxEQFbaw+tlE3945S5tLttF0uKP+wpKRKOAihPrGEBneliwl8d9l k9yjWBpAS1pAQqHjDSR9Lfdan/i371CmvxlbmBo+YgcCX79TwyqEMLYx/D4d9a7I9XLi hUiG+ZLPe8Pq2U1WUCfILxz3R8UfTSuG0lNASVDDEZPFFTIDRaH1FHGpsh6+f8Loqnqd g+tA== 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 d82si113080wmd.1.2017.09.19.05.21.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Sep 2017 05:21:15 -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 v8JCKxnF010376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 19 Sep 2017 14:21:07 +0200 From: Alexander Smirnov To: isar-users@googlegroups.com Cc: Alexander Smirnov Subject: [PATCH v2 1/4] meta-isar-bin: Add reprepro configs Date: Tue, 19 Sep 2017 15:20:49 +0300 Message-Id: <20170919122052.28688-2-asmirnov@ilbers.de> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170919122052.28688-1-asmirnov@ilbers.de> References: <20170919122052.28688-1-asmirnov@ilbers.de> X-TUID: xeLWn3nXYb+Z 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 | 25 +++++++++++++++++++++++++ 4 files changed, 40 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..30f241a 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -10,6 +10,31 @@ IMAGE_ROOTFS = "${WORKDIR}/rootfs" inherit ${IMAGE_TYPE} +# Generate apt cache configuration file +python __anonymous () { + DISTRO = d.getVar("DISTRO", True) + DEBFILESDIR = d.getVar("DEBFILESDIR", True) + DEBCACHEDIR = d.getVar("DEBCACHEDIR", True) + + cache_conf_path = os.path.join(DEBCACHEDIR, DISTRO, "conf") + cache_conf_file = os.path.join(cache_conf_path, "distributions") + cache_conf_file_in = os.path.join(DEBFILESDIR, "distributions.in") + + import subprocess + + if not os.path.exists(cache_conf_path): + os.makedirs(cache_conf_path) + + if not os.path.exists(cache_conf_file): + f = open(cache_conf_file, "w") + subprocess.check_call([ + "sed", + "-e", "s#{DISTRO_NAME}#" + d.getVar("DEBDISTRONAME", True) + "#g", + cache_conf_file_in, + ], stdout=f) + f.close() +} + do_populate[stamp-extra-info] = "${DISTRO}-${MACHINE}" # Install Debian packages, that were built from sources -- 2.1.4