public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: <Cedric_Hombourger@mentor.com>
To: <isar-users@googlegroups.com>
Cc: Cedric Hombourger <Cedric_Hombourger@mentor.com>
Subject: [PATCH 5/5] multistrap: make the security feed optional
Date: Sun, 4 Feb 2018 17:56:39 +0000	[thread overview]
Message-ID: <20180204175639.315-1-Cedric_Hombourger@mentor.com> (raw)
In-Reply-To: <20180204175454.220-1-Cedric_Hombourger@mentor.com>

From: Cedric Hombourger <Cedric_Hombourger@mentor.com>

Leave the security feed commented in the generated multistrap
configuration if DISTRO_APT_SOURCE_SEC is empty or set to "none"

Signed-off-by: Cedric Hombourger <Cedric_Hombourger@mentor.com>
---
 meta-isar/recipes-core/images/files/multistrap.conf.in     | 10 +++++-----
 meta-isar/recipes-core/images/isar-image-base.bb           |  8 ++++++++
 meta/recipes-devtools/buildchroot/buildchroot.bb           |  8 ++++++++
 meta/recipes-devtools/buildchroot/files/multistrap.conf.in | 10 +++++-----
 4 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/meta-isar/recipes-core/images/files/multistrap.conf.in b/meta-isar/recipes-core/images/files/multistrap.conf.in
index 8e4e276..94db7fa 100644
--- a/meta-isar/recipes-core/images/files/multistrap.conf.in
+++ b/meta-isar/recipes-core/images/files/multistrap.conf.in
@@ -24,11 +24,11 @@ suite=##DISTRO_SUITE##-updates
 components=##DISTRO_COMPONENTS##
 omitdebsrc=false
 
-[security]
-source=##DISTRO_APT_SOURCE_SEC##
-suite=##DISTRO_SUITE##/updates
-components=##DISTRO_COMPONENTS##
-omitdebsrc=false
+##SEC_ENABLE_DISABLE## [security]
+##SEC_ENABLE_DISABLE## source=##DISTRO_APT_SOURCE_SEC##
+##SEC_ENABLE_DISABLE## suite=##DISTRO_SUITE##/updates
+##SEC_ENABLE_DISABLE## components=##DISTRO_COMPONENTS##
+##SEC_ENABLE_DISABLE## omitdebsrc=true
 
 [Isar]
 packages=##IMAGE_INSTALL##
diff --git a/meta-isar/recipes-core/images/isar-image-base.bb b/meta-isar/recipes-core/images/isar-image-base.bb
index 6ce3d6d..a2c2282 100644
--- a/meta-isar/recipes-core/images/isar-image-base.bb
+++ b/meta-isar/recipes-core/images/isar-image-base.bb
@@ -135,12 +135,20 @@ do_rootfs() {
     cd ${TOPDIR}
     WORKDIR_REL=${@ os.path.relpath(d.getVar("WORKDIR", True))}
 
+    # Check whether to include the distro security feed in the multistrap config
+    if [ -z "${DISTRO_APT_SOURCE_SEC}" ] || [ "${DISTRO_APT_SOURCE_SEC}" = "none" ]; then
+        sec_enable_disable="#"
+    else
+        sec_enable_disable=""
+    fi
+
     # Adjust multistrap config
     sed -e 's|##IMAGE_PREINSTALL##|${IMAGE_PREINSTALL}|g' \
         -e 's|##DISTRO_MULTICONF_BOOTSTRAP##|${DISTRO_MULTICONF_BOOTSTRAP}|g' \
         -e 's|##DISTRO_MULTICONF_APTSOURCES##|${DISTRO_MULTICONF_APTSOURCES}|g' \
         -e 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|g' \
         -e 's|##DISTRO_APT_SOURCE_SEC##|${DISTRO_APT_SOURCE_SEC}|g' \
+        -e 's|##SEC_ENABLE_DISABLE##|'"$sec_enable_disable"'|g' \
         -e 's|##DISTRO_SUITE##|${DISTRO_SUITE}|g' \
         -e 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|g' \
         -e 's|##CONFIG_SCRIPT##|./'"$WORKDIR_REL"'/${DISTRO_CONFIG_SCRIPT}|g' \
diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot.bb
index 4ebd090..fa335b3 100644
--- a/meta/recipes-devtools/buildchroot/buildchroot.bb
+++ b/meta/recipes-devtools/buildchroot/buildchroot.bb
@@ -47,12 +47,20 @@ do_build() {
     cd ${TOPDIR}
     WORKDIR_REL=${@ os.path.relpath(d.getVar("WORKDIR", True))}
 
+    # Check whether to include the distro security feed in the multistrap config
+    if [ -z "${DISTRO_APT_SOURCE_SEC}" ] || [ "${DISTRO_APT_SOURCE_SEC}" = "none" ]; then
+        sec_enable_disable="#"
+    else
+        sec_enable_disable=""
+    fi
+
     # Adjust multistrap config
     sed -e 's|##BUILDCHROOT_PREINSTALL##|${BUILDCHROOT_PREINSTALL}|g' \
         -e 's|##DISTRO_MULTICONF_BOOTSTRAP##|${DISTRO_MULTICONF_BOOTSTRAP}|g' \
         -e 's|##DISTRO_MULTICONF_APTSOURCES##|${DISTRO_MULTICONF_APTSOURCES}|g' \
         -e 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|g' \
         -e 's|##DISTRO_APT_SOURCE_SEC##|${DISTRO_APT_SOURCE_SEC}|g' \
+        -e 's|##SEC_ENABLE_DISABLE##|'"$sec_enable_disable"'|g' \
         -e 's|##DISTRO_SUITE##|${DISTRO_SUITE}|g' \
         -e 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|g' \
         -e 's|##CONFIG_SCRIPT##|./'"$WORKDIR_REL"'/configscript.sh|g' \
diff --git a/meta/recipes-devtools/buildchroot/files/multistrap.conf.in b/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
index a0b28e3..1e3425f 100644
--- a/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
+++ b/meta/recipes-devtools/buildchroot/files/multistrap.conf.in
@@ -24,8 +24,8 @@ suite=##DISTRO_SUITE##-updates
 components=##DISTRO_COMPONENTS##
 omitdebsrc=true
 
-[security]
-source=##DISTRO_APT_SOURCE_SEC##
-suite=##DISTRO_SUITE##/updates
-components=##DISTRO_COMPONENTS##
-omitdebsrc=true
+##SEC_ENABLE_DISABLE## [security]
+##SEC_ENABLE_DISABLE## source=##DISTRO_APT_SOURCE_SEC##
+##SEC_ENABLE_DISABLE## suite=##DISTRO_SUITE##/updates
+##SEC_ENABLE_DISABLE## components=##DISTRO_COMPONENTS##
+##SEC_ENABLE_DISABLE## omitdebsrc=true
-- 
2.11.0


  parent reply	other threads:[~2018-02-04 17:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-04 17:54 [PATCH 0/5] support creation of a full repo for offline/reproducible builds Cedric_Hombourger
2018-02-04 17:54 ` [PATCH 1/5] base: add populate_repo task to include distro packages to the repo Cedric_Hombourger
2018-02-05 10:06   ` Alexander Smirnov
2018-02-04 17:54 ` [PATCH 2/5] meta: move reprepro handling code to its own class Cedric_Hombourger
2018-02-04 17:54 ` [PATCH 3/5] buildchroot: use reprepro to populate the full repo Cedric_Hombourger
2018-02-04 17:54 ` [PATCH 4/5] reprepro: create the -updates distribution Cedric_Hombourger
2018-02-04 17:56 ` Cedric_Hombourger [this message]
2018-02-05  7:18 ` [PATCH 0/5] support creation of a full repo for offline/reproducible builds Jan Kiszka
2018-02-05  9:11   ` Benedikt Niedermayr
2018-02-05 10:26   ` Alexander Smirnov
2018-02-05 10:31     ` Jan Kiszka
2018-02-05 11:22     ` Benedikt Niedermayr
2018-02-05 10:08 ` Benedikt Niedermayr
2018-02-05 10:16   ` chombourger

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=20180204175639.315-1-Cedric_Hombourger@mentor.com \
    --to=cedric_hombourger@mentor.com \
    --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