system-builder 0.0.21 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,15 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in metalive.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem "rake"
8
+ end
9
+
10
+ group :test do
11
+ gem "rspec"
12
+ gem "autotest"
13
+ gem "fakeweb"
14
+ gem "rcov"
15
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,34 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ system-builder (0.0.22)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ ZenTest (4.5.0)
10
+ autotest (4.4.6)
11
+ ZenTest (>= 4.4.1)
12
+ diff-lcs (1.1.2)
13
+ fakeweb (1.3.0)
14
+ rake (0.9.2)
15
+ rcov (0.9.9)
16
+ rspec (2.6.0)
17
+ rspec-core (~> 2.6.0)
18
+ rspec-expectations (~> 2.6.0)
19
+ rspec-mocks (~> 2.6.0)
20
+ rspec-core (2.6.4)
21
+ rspec-expectations (2.6.0)
22
+ diff-lcs (~> 1.1.2)
23
+ rspec-mocks (2.6.0)
24
+
25
+ PLATFORMS
26
+ ruby
27
+
28
+ DEPENDENCIES
29
+ autotest
30
+ fakeweb
31
+ rake
32
+ rcov
33
+ rspec
34
+ system-builder!
data/bin/box CHANGED
@@ -20,6 +20,8 @@ OptionParser.new do |opts|
20
20
  "The box image to be cloned") { |arg| @options[:image] = arg }
21
21
  opts.on("-h", "--host=<host>", String,
22
22
  "The host to be upgraded") { |arg| @options[:host] = arg }
23
+ opts.on("-s", "--skip-format",
24
+ "Skip partitionning and formatting") { |arg| @options[:skip_format] = true }
23
25
  opts.on("-h", "--help",
24
26
  "Show this help message.") { puts opts; exit }
25
27
  opts.parse!(ARGV)
@@ -98,9 +100,12 @@ class BoxCommand
98
100
  exit 1 unless system "sudo umount #{partition}"
99
101
  end
100
102
 
101
- puts "Install filesystem"
102
- sh "echo ',,L,*' | sudo /sbin/sfdisk -f -uS #{target}"
103
- sudo "mke2fs -j -L boot #{partition}"
103
+ unless options[:skip_format]
104
+ puts "Formatting filesystem"
105
+ sh "echo ',,L,*' | sudo /sbin/sfdisk -f -uS #{target}"
106
+ sh "grep -q #{partition} /proc/mounts && sudo umount #{partition} || true"
107
+ sudo "mke2fs -j -L boot #{partition}"
108
+ end
104
109
 
105
110
  sh "[ -d #{partition_mount_point} ]||mkdir #{partition_mount_point}"
106
111
 
@@ -49,7 +49,8 @@ module SystemBuilder
49
49
 
50
50
  unless File.directory?(manifest)
51
51
  chroot.image.install "/tmp/puppet.pp", manifest
52
- chroot.sudo "puppet --color=false tmp/puppet.pp | tee /tmp/puppet.log"
52
+ # chmod +r to make file readable for buildbot
53
+ chroot.sudo "puppet --color=false tmp/puppet.pp | tee /tmp/puppet.log && chmod +r /tmp/puppet.log"
53
54
  process_log_file(chroot.image.expand_path("/tmp/puppet.log"))
54
55
  else
55
56
  context_dir = "/tmp/puppet"
@@ -92,7 +92,7 @@ class SystemBuilder::DiskSquashfsImage
92
92
  f.puts "LABEL linux"
93
93
  f.puts "SAY Now booting #{version} from syslinux ..."
94
94
  f.puts "KERNEL /vmlinuz"
95
- f.puts "APPEND ro initrd=/initrd.img boot=local root=/boot/filesystem.squashfs rootflags=loop rootfstype=squashfs"
95
+ f.puts "APPEND ro initrd=/initrd.img boot=local root=/boot/filesystem.squashfs rootflags=loop rootfstype=squashfs rootdelay=6"
96
96
  end
97
97
  end
98
98
  end
@@ -44,7 +44,7 @@ class SystemBuilder::IsoImage
44
44
  end
45
45
 
46
46
  def make_iso_fs
47
- FileUtils::sudo "mkisofs -quiet -R -o #{file} -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -A #{root_fs_label} -V #{root_fs_label} -graft-points -hide build/root/initrd.img -hide build/root/vmlinuz vmlinuz=#{boot.root}/boot/#{readlink_boot_file('vmlinuz')} initrd.img=#{boot.root}/boot/#{readlink_boot_file('initrd.img')} #{boot.root}"
47
+ FileUtils::sudo "genisoimage -quiet -R -o #{file} -b boot/isolinux/isolinux.bin -c boot/isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -A #{root_fs_label} -V #{root_fs_label} -graft-points -hide build/root/initrd.img -hide build/root/vmlinuz vmlinuz=#{boot.root}/boot/#{readlink_boot_file('vmlinuz')} initrd.img=#{boot.root}/boot/#{readlink_boot_file('initrd.img')} #{boot.root}"
48
48
  FileUtils::sudo "chown $USER #{file}"
49
49
  end
50
50
 
@@ -49,7 +49,7 @@ class SystemBuilder::IsoSquashfsImage
49
49
  end
50
50
 
51
51
  def make_iso_fs
52
- FileUtils::sudo "mkisofs -quiet -R -o #{file} -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -graft-points vmlinuz=#{boot.root}/boot/#{readlink_boot_file('vmlinuz')} initrd.img=#{boot.root}/boot/#{readlink_boot_file('initrd.img')} filesystem.squashfs=build/filesystem.squashfs #{boot.root}/boot"
52
+ FileUtils::sudo "genisoimage -quiet -R -o #{file} -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -graft-points vmlinuz=#{boot.root}/boot/#{readlink_boot_file('vmlinuz')} initrd.img=#{boot.root}/boot/#{readlink_boot_file('initrd.img')} filesystem.squashfs=build/filesystem.squashfs #{boot.root}/boot"
53
53
  FileUtils::sudo "chown $USER #{file}"
54
54
  end
55
55
 
@@ -1,3 +1,3 @@
1
1
  module SystemBuilder
2
- VERSION = "0.0.21"
2
+ VERSION = "0.0.22"
3
3
  end
data/tasks/rspec.rake CHANGED
@@ -1,11 +1,11 @@
1
1
  begin
2
- require 'spec'
2
+ require 'rspec'
3
3
  rescue LoadError
4
4
  require 'rubygems' unless ENV['NO_RUBYGEMS']
5
- require 'spec'
5
+ require 'rspec'
6
6
  end
7
7
  begin
8
- require 'spec/rake/spectask'
8
+ require 'rspec/core/rake_task'
9
9
  rescue LoadError
10
10
  puts <<-EOS
11
11
  To use rspec for testing you must install rspec gem:
@@ -15,7 +15,6 @@ EOS
15
15
  end
16
16
 
17
17
  desc "Run the specs under spec/models"
18
- Spec::Rake::SpecTask.new do |t|
19
- t.spec_opts = ['--options', "spec/spec.opts"]
20
- t.spec_files = FileList['spec/**/*_spec.rb']
18
+ RSpec::Core::RakeTask.new do |t|
19
+ t.pattern = 'spec/**/*_spec.rb'
21
20
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: system-builder
3
3
  version: !ruby/object:Gem::Version
4
- hash: 53
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 21
10
- version: 0.0.21
9
+ - 22
10
+ version: 0.0.22
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alban Peignier
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-05-18 00:00:00 Z
19
+ date: 2011-07-24 00:00:00 Z
20
20
  dependencies: []
21
21
 
22
22
  description: ""
@@ -32,6 +32,8 @@ extra_rdoc_files: []
32
32
 
33
33
  files:
34
34
  - .gitignore
35
+ - Gemfile
36
+ - Gemfile.lock
35
37
  - History.txt
36
38
  - Manifest.txt
37
39
  - PostInstall.txt