Re: [Tails-dev] Tails build system update

Delete this message

Reply to this message
Author: Vasiliy Kaygorodov
Date:  
To: The Tails public development discussion list
Subject: Re: [Tails-dev] Tails build system update
On Wed, May 10, 2017 at 7:17 PM, anonym <anonym@???> wrote:
>
>
> If the above isn't good enough: sure, that would work, patches are
> welcome! As would patches for the simpler approach where the path is given
> in an environment variable (that defaults to `vmdebootstrap` if not set).



This is what I have in mind actually. Please check if it fits.

--
vk
From feb76596db530904b98f351a45c432d5accf310a Mon Sep 17 00:00:00 2001
From: Vasiliy Kaygorodov <vkaygorodov@???>
Date: Thu, 11 May 2017 11:22:17 +0200
Subject: [PATCH] Allow overriding some of the generate-tails-builder-box.sh
variables

---
 .gitignore                                                    |  1 +
 .../definitions/tails-builder/generate-tails-builder-box.sh   | 11 +++++++----
 2 files changed, 8 insertions(+), 4 deletions(-)


diff --git a/.gitignore b/.gitignore
index 2aca529..9b008dc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,6 +35,7 @@
/vagrant/definitions/squeeze/preseed.cfg
/vagrant/iso
/vagrant/squeeze.box
+/vagrant/definitions/tails-builder/generate-tails-builder-box-overrides.sh
# Jenkins artifacts directory
/build-artifacts/

diff --git a/vagrant/definitions/tails-builder/generate-tails-builder-box.sh b/vagrant/definitions/tails-builder/generate-tails-builder-box.sh
index f9c6911..4623004 100755
--- a/vagrant/definitions/tails-builder/generate-tails-builder-box.sh
+++ b/vagrant/definitions/tails-builder/generate-tails-builder-box.sh
@@ -5,13 +5,15 @@ set -u
 # Based on ypcs' scripts found at:
 #     https://github.com/ypcs/vmdebootstrap-vagrant/


+[ -f "$(pwd)/generate-tails-builder-box-overrides.sh" ] && \
+    source $(pwd)/generate-tails-builder-box-overrides.sh
 SERIAL="${1}"
 COMMENT="${2:-}"
-ARCHITECTURE="amd64"
-DISTRIBUTION="jessie"
+ARCHITECTURE="${OVERRIDE_ARCHITECTURE:-amd64}"
+DISTRIBUTION="${OVERRIDE_DISTRIBUTION:-jessie}"
 USERNAME="vagrant"
 PASSWORD="vagrant"
-SIZE="20G"
+SIZE="${OVERRIDE_SIZE:-20G}"
 HOSTNAME="vagrant-${DISTRIBUTION}"
 TARGET_NAME="tails-builder-${ARCHITECTURE}-${DISTRIBUTION}-${SERIAL}"
 if [ -n "${COMMENT}" ]; then
@@ -20,6 +22,7 @@ fi
 TARGET_IMG="${TARGET_NAME}.qcow2"
 TARGET_BOX="${TARGET_NAME}.box"
 LC_ALL=C
+VMDEBOOTSTRAP=${OVERRIDE_VMDEBOOTSTRAP:-vmdebootstrap}


 SECURITY_SERIAL="$(
     cd ../../.. && \
@@ -45,7 +48,7 @@ sudo ${http_proxy:+http_proxy="$http_proxy"} \
      DISTRIBUTION=${DISTRIBUTION} \
      SECURITY_SERIAL=${SECURITY_SERIAL} \
      SERIAL=${SERIAL} \
-     vmdebootstrap \
+     ${VMDEBOOTSTRAP} \
      --arch "${ARCHITECTURE}" \
      --distribution "${DISTRIBUTION}" \
      --image "${TARGET_IMG}" \
-- 
2.7.4