summaryrefslogtreecommitdiffstats
path: root/Rakefile
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2012-05-14 19:58:59 +0200
committerTails developers <amnesia@boum.org>2012-05-16 13:30:40 +0200
commit55c016f2c7907f9865043bf6bc681c16df50cdbe (patch)
treeb439f25ff046f0b62b5b8cbe8ed95a41095703e6 /Rakefile
parente83285c382104a2904400d77378ac97ebc81fec0 (diff)
vagrant: Add suport for SquashFS build settings
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile15
1 files changed, 14 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(' ')