From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6473366578589073408 X-Received: by 10.28.94.5 with SMTP id s5mr652176wmb.15.1507198109709; Thu, 05 Oct 2017 03:08:29 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.38.134 with SMTP id m128ls3830949wmm.4.gmail; Thu, 05 Oct 2017 03:08:29 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCrkSR9KbK6x296MoG6I9D7cIN5hVentlDph1vXrnn1mZek+HwbDkpvnxzN9ReF4R76ofxo X-Received: by 10.28.217.201 with SMTP id q192mr1430686wmg.20.1507198109443; Thu, 05 Oct 2017 03:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507198109; cv=none; d=google.com; s=arc-20160816; b=PxG/VasofxEMyS8FLmRk/ohU2F1xQ6ZKDskBjmT49MpXaX7jouta3wRXDJKG2sVH8K cOa79Oe5VJqfmeIAtOVHAOB1EDn9g5zLPVsUhxVL9VTMQ60oJHRqof2YElX7TRpveq3P eofvum0mDE0AAU8ev/CeTlHhCa62N2i3uVhXgPy5SM9IodzHeLhtoD5aMsmZxrCyBafE 3n1HnK+oBpRF91PjC3op55t7pHRLmx3RGpaZ6uKrM1T+rbUlZlYRxuioAyTzbl7z8PN+ sbHX5KDM7tzXfHNv331rbeweRRUZ5GS3LVgK/7zIRyhdSxRTg2VsicqbhE2LYT1nuqIv TscA== 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=QnHRHXtaajZTHidY8ExFpEdbuv666rTKs5bs0Uxv6Vo=; b=z6HhErOYJb0cC+r9YaJFmQyGIvGU8Oo3KYeING7qPBHWERgR0ejsUsxuv+McFv0MWi T1nTRqUFIkKGvkyyBvxGBk75umjmi1A9voJY9ziYxsirwNOzyRtS9SCD4iZk+4eEsIBx ehxGaB1x/UPO4m+6Ym0tD4Z7AdEx2zAng8Jrk14jKyu+22mBW7BKhYVQllo1fzEachMC ouGEz/64eOIbH2lp7FVdVzJKPHYx3A36oxpj7TsdSh7sefL0A8zsZ2yYSk/VTvKhj7wI 2X5ZflSR7QSodok6tow84qlN5bq7T0CUuqTJWeadHxnwmXeSaDKeGIvmwIpPfWg1wKBh E7yQ== 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 p200si2214747wmg.4.2017.10.05.03.08.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2017 03:08:29 -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 v95A8DXY003858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 5 Oct 2017 12:08:19 +0200 From: Alexander Smirnov To: isar-users@googlegroups.com Cc: Alexander Smirnov Subject: [PATCH 1/4] apt: Generate configs for apt Date: Thu, 5 Oct 2017 13:08:04 +0300 Message-Id: <20171005100807.3369-2-asmirnov@ilbers.de> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20171005100807.3369-1-asmirnov@ilbers.de> References: <20171005100807.3369-1-asmirnov@ilbers.de> X-TUID: BzeyY11F2N7Z Generate reprepro configuration files for apt deployment. Signed-off-by: Alexander Smirnov --- meta-isar/conf/layer.conf | 10 ++++++++-- meta-isar/recipes-core/images/files/distributions.in | 3 +++ meta/classes/image.bbclass | 17 ++++++++++++++++- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 meta-isar/recipes-core/images/files/distributions.in diff --git a/meta-isar/conf/layer.conf b/meta-isar/conf/layer.conf index 72a103c..0950a34 100644 --- a/meta-isar/conf/layer.conf +++ b/meta-isar/conf/layer.conf @@ -1,5 +1,5 @@ # This software is a part of ISAR. -# Copyright (C) 2015-2016 ilbers GmbH +# Copyright (C) 2015-2017 ilbers GmbH # We have a conf and classes directory, add to BBPATH BBPATH .= ":${LAYERDIR}" @@ -13,6 +13,12 @@ BBFILE_PRIORITY_isar = "5" # This should only be incremented on significant changes that will # cause compatibility issues with other layers -LAYERVERSION_isar = "2" +LAYERVERSION_isar = "3" LAYERDIR_isar = "${LAYERDIR}" + +# Codename of the repository created by the caching class +DEBDISTRONAME = "isar" + +# Path to the Isar apt repository +DEPLOY_DIR_APT ?= "${DEPLOY_DIR}/apt" diff --git a/meta-isar/recipes-core/images/files/distributions.in b/meta-isar/recipes-core/images/files/distributions.in new file mode 100644 index 0000000..cd214c6 --- /dev/null +++ b/meta-isar/recipes-core/images/files/distributions.in @@ -0,0 +1,3 @@ +Codename: {DISTRO_NAME} +Architectures: i386 armhf amd64 source +Components: main diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 5bf9524..57705a7 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -1,5 +1,5 @@ # This software is a part of ISAR. -# Copyright (C) 2015-2016 ilbers GmbH +# Copyright (C) 2015-2017 ilbers GmbH KERNEL_IMAGE ?= "" INITRD_IMAGE ?= "" @@ -10,6 +10,21 @@ IMAGE_ROOTFS = "${WORKDIR}/rootfs" inherit ${IMAGE_TYPE} +CACHE_CONF_DIR = "${DEPLOY_DIR_APT}/${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" \ + ${FILESDIR}/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