summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Rakefile15
-rwxr-xr-xvagrant/provision/assets/build-tails1
2 files changed, 15 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index 2563074..204b5e3 100644
--- a/Rakefile
+++ b/Rakefile
@@ -27,6 +27,19 @@ VAGRANT_PATH = File.expand_path('../vagrant', __FILE__)
# Environment variables that will be exported to the build script
EXPORTED_VARIABLES = ['http_proxy', 'MKSQUASHFS_OPTIONS']
+task :parse_build_options do
+ options = ENV['TAILS_BUILD_OPTIONS'] || ''
+ options.split(' ').each do |opt|
+ case opt
+ # SquashFS compression settings
+ when 'gzipcomp'
+ ENV['MKSQUASHFS_OPTIONS'] = '-comp gzip'
+ when 'defaultcomp'
+ ENV['MKSQUASHFS_OPTIONS'] = nil
+ end
+ end
+end
+
task :validate_http_proxy do
if ENV['http_proxy']
proxy_host = URI.parse(ENV['http_proxy']).host
@@ -48,7 +61,7 @@ task :validate_http_proxy do
end
desc 'Build Tails'
-task :build => ['validate_http_proxy', 'vm:up'] do
+task :build => ['parse_build_options', 'validate_http_proxy', 'vm:up'] do
exported_env = EXPORTED_VARIABLES.select { |k| ENV[k] }.
collect { |k| "#{k}='#{ENV[k]}'" }.join(' ')
diff --git a/vagrant/provision/assets/build-tails b/vagrant/provision/assets/build-tails
index a2cedf3..f491b5d 100755
--- a/vagrant/provision/assets/build-tails
+++ b/vagrant/provision/assets/build-tails
@@ -9,6 +9,7 @@ as_root_do() {
${https_proxy:+https_proxy="$https_proxy"} \
${ftp_proxy:+ftp_proxy="$ftp_proxy"} \
${no_proxy:+no_proxy="$no_proxy"} \
+ ${MKSQUASHFS_OPTIONS:+MKSQUASHFS_OPTIONS="$MKSQUASHFS_OPTIONS"} \
"$@"
}