From: Alexander Smirnov <asmirnov@ilbers.de>
To: isar-users@googlegroups.com
Cc: Alexander Smirnov <asmirnov@ilbers.de>
Subject: [PATCH 1/4] meta-isar-bin: Add reprepro configs
Date: Mon, 2 Oct 2017 18:45:28 +0300 [thread overview]
Message-ID: <20171002154531.4930-2-asmirnov@ilbers.de> (raw)
In-Reply-To: <20171002154531.4930-1-asmirnov@ilbers.de>
Add template for reprepro configuration file and function that
generates final config for specific deistro.
Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
---
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
next prev parent reply other threads:[~2017-10-02 15:45 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-02 15:45 [PATCH v4 0/4] Basic binary cache implementation Alexander Smirnov
2017-10-02 15:45 ` Alexander Smirnov [this message]
2017-10-02 15:45 ` [PATCH 2/4] meta-isar-bin: Generate cache repos Alexander Smirnov
2017-10-04 9:03 ` Henning Schild
2017-10-04 10:57 ` Alexander Smirnov
2017-10-04 14:09 ` Henning Schild
2017-10-02 15:45 ` [PATCH 3/4] meta-isar-bin: Populate cache Alexander Smirnov
2017-10-02 15:45 ` [PATCH 4/4] meta-isar-bin: Install packages via multistrap Alexander Smirnov
2017-10-04 9:05 ` Henning Schild
2017-10-04 10:59 ` Alexander Smirnov
2017-10-04 8:32 ` [PATCH v4 0/4] Basic binary cache implementation Claudius Heine
2017-10-04 11:57 ` Jan Kiszka
2017-10-04 14:29 ` Alexander Smirnov
2017-10-04 15:40 ` Henning Schild
2017-10-04 16:50 ` Alexander Smirnov
2017-10-04 16:58 ` Henning Schild
2017-10-04 17:34 ` Claudius Heine
2017-10-04 18:47 ` Alexander Smirnov
2017-10-05 8:38 ` Claudius Heine
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171002154531.4930-2-asmirnov@ilbers.de \
--to=asmirnov@ilbers.de \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox