HeSYINUvSBZfxqA-veewee 0.2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. data/.gitignore +15 -0
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +69 -0
  4. data/HeSYINUvSBZfxqA-veewee.gemspec +33 -0
  5. data/README.md +198 -0
  6. data/Rakefile +92 -0
  7. data/bin/veewee +79 -0
  8. data/lib/java/README.txt +5 -0
  9. data/lib/java/dir2floppy.jar +0 -0
  10. data/lib/java/dir2floppy.java +137 -0
  11. data/lib/vagrant_init.rb +6 -0
  12. data/lib/veewee/command.rb +82 -0
  13. data/lib/veewee/config.rb +5 -0
  14. data/lib/veewee/export.rb +81 -0
  15. data/lib/veewee/scancode.rb +151 -0
  16. data/lib/veewee/session.rb +783 -0
  17. data/lib/veewee/shell.rb +54 -0
  18. data/lib/veewee/ssh.rb +193 -0
  19. data/lib/veewee/transaction.rb +122 -0
  20. data/lib/veewee/utils.rb +26 -0
  21. data/lib/veewee/version.rb +3 -0
  22. data/lib/veewee/web.rb +48 -0
  23. data/lib/veewee.rb +2 -0
  24. data/templates/CentOS-4.8-i386/definition.rb +14 -0
  25. data/templates/CentOS-4.8-i386/ks.cfg +45 -0
  26. data/templates/CentOS-4.8-i386/postinstall.sh +55 -0
  27. data/templates/CentOS-5.6-i386/definition.rb +17 -0
  28. data/templates/CentOS-5.6-i386/ks.cfg +45 -0
  29. data/templates/CentOS-5.6-i386/postinstall.sh +50 -0
  30. data/templates/CentOS-5.6-i386-netboot/definition.rb +16 -0
  31. data/templates/CentOS-5.6-i386-netboot/ks.cfg +45 -0
  32. data/templates/CentOS-5.6-i386-netboot/postinstall.sh +52 -0
  33. data/templates/CentOS-5.6-x86_64-netboot/definition.rb +16 -0
  34. data/templates/CentOS-5.6-x86_64-netboot/ks.cfg +45 -0
  35. data/templates/CentOS-5.6-x86_64-netboot/postinstall.sh +60 -0
  36. data/templates/CentOS-6.0-i386/definition.rb +17 -0
  37. data/templates/CentOS-6.0-i386/ks.cfg +47 -0
  38. data/templates/CentOS-6.0-i386/postinstall.sh +48 -0
  39. data/templates/CentOS-6.0-i386-netboot/definition.rb +16 -0
  40. data/templates/CentOS-6.0-i386-netboot/ks.cfg +52 -0
  41. data/templates/CentOS-6.0-i386-netboot/postinstall.sh +30 -0
  42. data/templates/CentOS-6.0-x86_64/definition.rb +17 -0
  43. data/templates/CentOS-6.0-x86_64/ks.cfg +47 -0
  44. data/templates/CentOS-6.0-x86_64/postinstall.sh +48 -0
  45. data/templates/CentOS-6.0-x86_64-netboot/definition.rb +16 -0
  46. data/templates/CentOS-6.0-x86_64-netboot/ks.cfg +52 -0
  47. data/templates/CentOS-6.0-x86_64-netboot/postinstall.sh +30 -0
  48. data/templates/Debian-5.0.8-amd64-netboot/definition.rb +39 -0
  49. data/templates/Debian-5.0.8-amd64-netboot/postinstall.sh +60 -0
  50. data/templates/Debian-5.0.8-amd64-netboot/preseed.cfg +312 -0
  51. data/templates/Debian-5.0.8-i386-netboot/definition.rb +39 -0
  52. data/templates/Debian-5.0.8-i386-netboot/postinstall.sh +60 -0
  53. data/templates/Debian-5.0.8-i386-netboot/preseed.cfg +312 -0
  54. data/templates/Debian-6.0.2-amd64-netboot/definition.rb +39 -0
  55. data/templates/Debian-6.0.2-amd64-netboot/postinstall.sh +71 -0
  56. data/templates/Debian-6.0.2-amd64-netboot/preseed.cfg +312 -0
  57. data/templates/Debian-6.0.2-i386-netboot/definition.rb +41 -0
  58. data/templates/Debian-6.0.2-i386-netboot/postinstall.sh +83 -0
  59. data/templates/Debian-6.0.2-i386-netboot/preseed.cfg +312 -0
  60. data/templates/Fedora-14-amd64/definition.rb +16 -0
  61. data/templates/Fedora-14-amd64/ks.cfg +41 -0
  62. data/templates/Fedora-14-amd64/postinstall.sh +54 -0
  63. data/templates/Fedora-14-amd64-netboot/definition.rb +16 -0
  64. data/templates/Fedora-14-amd64-netboot/ks.cfg +40 -0
  65. data/templates/Fedora-14-amd64-netboot/postinstall.sh +54 -0
  66. data/templates/Fedora-14-i386/definition.rb +16 -0
  67. data/templates/Fedora-14-i386/ks.cfg +41 -0
  68. data/templates/Fedora-14-i386/postinstall.sh +54 -0
  69. data/templates/Fedora-14-i386-netboot/definition.rb +16 -0
  70. data/templates/Fedora-14-i386-netboot/ks.cfg +40 -0
  71. data/templates/Fedora-14-i386-netboot/postinstall.sh +54 -0
  72. data/templates/Fedora-15-i386/definition.rb +17 -0
  73. data/templates/Fedora-15-i386/ks.cfg +64 -0
  74. data/templates/Fedora-15-i386/postinstall.sh +33 -0
  75. data/templates/Fedora-15-i386-netboot/definition.rb +17 -0
  76. data/templates/Fedora-15-i386-netboot/ks.cfg +82 -0
  77. data/templates/Fedora-15-i386-netboot/postinstall.sh +18 -0
  78. data/templates/Sysrescuecd-2.0.0-experimental/autorun0 +3 -0
  79. data/templates/Sysrescuecd-2.0.0-experimental/definition.rb +20 -0
  80. data/templates/archlinux-i386/aif.cfg +33 -0
  81. data/templates/archlinux-i386/definition.rb +29 -0
  82. data/templates/archlinux-i386/postinstall.sh +95 -0
  83. data/templates/archlinux-x86_64/aif.cfg +33 -0
  84. data/templates/archlinux-x86_64/definition.rb +29 -0
  85. data/templates/archlinux-x86_64/postinstall.sh +95 -0
  86. data/templates/freebsd-8.2-experimental/definition.rb +19 -0
  87. data/templates/freebsd-8.2-experimental/postinstall.sh +191 -0
  88. data/templates/freebsd-8.2-pcbsd-i386/definition.rb +31 -0
  89. data/templates/freebsd-8.2-pcbsd-i386/pcinstall.fbg.cfg +57 -0
  90. data/templates/freebsd-8.2-pcbsd-i386/postinstall.sh +93 -0
  91. data/templates/freebsd-8.2-pcbsd-i386-netboot/definition.rb +34 -0
  92. data/templates/freebsd-8.2-pcbsd-i386-netboot/pcinstall.fbg.cfg +58 -0
  93. data/templates/freebsd-8.2-pcbsd-i386-netboot/postinstall.sh +93 -0
  94. data/templates/gentoo-latest-i386-experimental/definition.rb +29 -0
  95. data/templates/gentoo-latest-i386-experimental/postinstall.sh +184 -0
  96. data/templates/openindiana-148-ai-x86/auto_install/ai.dtd +58 -0
  97. data/templates/openindiana-148-ai-x86/auto_install/ai_manifest.xml +241 -0
  98. data/templates/openindiana-148-ai-x86/auto_install/configuration.dtd +44 -0
  99. data/templates/openindiana-148-ai-x86/auto_install/default.xml +121 -0
  100. data/templates/openindiana-148-ai-x86/auto_install/default.xml.orig +124 -0
  101. data/templates/openindiana-148-ai-x86/auto_install/sc_profiles/static_network.xml +105 -0
  102. data/templates/openindiana-148-ai-x86/auto_install/software.dtd +105 -0
  103. data/templates/openindiana-148-ai-x86/auto_install/target.dtd +196 -0
  104. data/templates/openindiana-148-ai-x86/default.xml +121 -0
  105. data/templates/openindiana-148-ai-x86/definition.rb +59 -0
  106. data/templates/openindiana-148-ai-x86/postinstall.sh +103 -0
  107. data/templates/opensuse-11.4-i386-experimental/README +11 -0
  108. data/templates/opensuse-11.4-i386-experimental/autoinst.xml +1269 -0
  109. data/templates/opensuse-11.4-i386-experimental/autoinst.xml.generated +1269 -0
  110. data/templates/opensuse-11.4-i386-experimental/autoinst.xml.tweaked +1269 -0
  111. data/templates/opensuse-11.4-i386-experimental/definition.rb +31 -0
  112. data/templates/opensuse-11.4-i386-experimental/postinstall.sh +90 -0
  113. data/templates/solaris-11-express-i386/auto_install/ai.dtd +58 -0
  114. data/templates/solaris-11-express-i386/auto_install/ai_manifest.xml +241 -0
  115. data/templates/solaris-11-express-i386/auto_install/configuration.dtd +44 -0
  116. data/templates/solaris-11-express-i386/auto_install/default.xml +124 -0
  117. data/templates/solaris-11-express-i386/auto_install/default.xml.orig +124 -0
  118. data/templates/solaris-11-express-i386/auto_install/sc_profiles/static_network.xml +105 -0
  119. data/templates/solaris-11-express-i386/auto_install/software.dtd +105 -0
  120. data/templates/solaris-11-express-i386/auto_install/target.dtd +196 -0
  121. data/templates/solaris-11-express-i386/default.xml +121 -0
  122. data/templates/solaris-11-express-i386/definition.rb +65 -0
  123. data/templates/solaris-11-express-i386/postinstall.sh +98 -0
  124. data/templates/ubuntu-10.04.2-amd64-netboot/definition.rb +23 -0
  125. data/templates/ubuntu-10.04.2-amd64-netboot/postinstall.sh +90 -0
  126. data/templates/ubuntu-10.04.2-amd64-netboot/preseed.cfg +89 -0
  127. data/templates/ubuntu-10.04.2-server-amd64/definition.rb +57 -0
  128. data/templates/ubuntu-10.04.2-server-amd64/postinstall.sh +90 -0
  129. data/templates/ubuntu-10.04.2-server-amd64/preseed.cfg +87 -0
  130. data/templates/ubuntu-10.04.2-server-amd64-alt/definition.rb +57 -0
  131. data/templates/ubuntu-10.04.2-server-amd64-alt/postinstall.sh +249 -0
  132. data/templates/ubuntu-10.04.2-server-amd64-alt/preseed.cfg +124 -0
  133. data/templates/ubuntu-10.04.2-server-i386/definition.rb +24 -0
  134. data/templates/ubuntu-10.04.2-server-i386/postinstall.sh +91 -0
  135. data/templates/ubuntu-10.04.2-server-i386/preseed.cfg +87 -0
  136. data/templates/ubuntu-10.04.2-server-i386-netboot/definition.rb +23 -0
  137. data/templates/ubuntu-10.04.2-server-i386-netboot/postinstall.sh +90 -0
  138. data/templates/ubuntu-10.04.2-server-i386-netboot/preseed.cfg +89 -0
  139. data/templates/ubuntu-10.10-server-amd64/definition.rb +24 -0
  140. data/templates/ubuntu-10.10-server-amd64/postinstall.sh +90 -0
  141. data/templates/ubuntu-10.10-server-amd64/preseed.cfg +87 -0
  142. data/templates/ubuntu-10.10-server-amd64-netboot/definition.rb +24 -0
  143. data/templates/ubuntu-10.10-server-amd64-netboot/postinstall.sh +90 -0
  144. data/templates/ubuntu-10.10-server-amd64-netboot/preseed.cfg +89 -0
  145. data/templates/ubuntu-10.10-server-i386/definition.rb +24 -0
  146. data/templates/ubuntu-10.10-server-i386/postinstall.sh +90 -0
  147. data/templates/ubuntu-10.10-server-i386/preseed.cfg +87 -0
  148. data/templates/ubuntu-10.10-server-i386-netboot/definition.rb +24 -0
  149. data/templates/ubuntu-10.10-server-i386-netboot/postinstall.sh +90 -0
  150. data/templates/ubuntu-10.10-server-i386-netboot/preseed.cfg +89 -0
  151. data/templates/ubuntu-11.04-server-amd64/definition.rb +24 -0
  152. data/templates/ubuntu-11.04-server-amd64/postinstall.sh +90 -0
  153. data/templates/ubuntu-11.04-server-amd64/preseed.cfg +87 -0
  154. data/templates/ubuntu-11.04-server-i386/definition.rb +24 -0
  155. data/templates/ubuntu-11.04-server-i386/postinstall.sh +90 -0
  156. data/templates/ubuntu-11.04-server-i386/preseed.cfg +87 -0
  157. data/templates/ubuntu-8.04.4-server-amd64/definition.rb +25 -0
  158. data/templates/ubuntu-8.04.4-server-amd64/postinstall.sh +68 -0
  159. data/templates/ubuntu-8.04.4-server-amd64/preseed.cfg +88 -0
  160. data/templates/ubuntu-8.04.4-server-i386/definition.rb +25 -0
  161. data/templates/ubuntu-8.04.4-server-i386/postinstall.sh +47 -0
  162. data/templates/ubuntu-8.04.4-server-i386/preseed.cfg +87 -0
  163. data/templates/windows-2008R2-amd64/Autounattend.xml +132 -0
  164. data/templates/windows-2008R2-amd64/README.md +68 -0
  165. data/templates/windows-2008R2-amd64/cygwin-setup.exe +0 -0
  166. data/templates/windows-2008R2-amd64/definition.rb +16 -0
  167. data/templates/windows-2008R2-amd64/install-cygwin-sshd.bat +38 -0
  168. data/templates/windows-2008R2-amd64/install-winrm.bat +6 -0
  169. data/templates/windows-2008R2-amd64/oracle-cert.cer +0 -0
  170. data/templates/windows-2008R2-amd64/postinstall.sh +122 -0
  171. data/templates/windows-2008R2-amd64/winrm.rb +8 -0
  172. data/trials/docu-vbox.txt +83 -0
  173. data/trials/f.rb +29 -0
  174. data/trials/t.rb +15 -0
  175. data/validation/features/steps/ssh_steps.rb +170 -0
  176. data/validation/support/env.rb +1 -0
  177. data/validation/vagrant-private.key +27 -0
  178. data/validation/vagrant.feature +52 -0
  179. data/validation/vagrant.pub +1 -0
  180. data/veewee.gemspec +33 -0
  181. data/vendor/cache/Platform-0.4.0.gem +0 -0
  182. data/vendor/cache/archive-tar-minitar-0.5.2.gem +0 -0
  183. data/vendor/cache/builder-3.0.0.gem +0 -0
  184. data/vendor/cache/cucumber-1.0.2.gem +0 -0
  185. data/vendor/cache/diff-lcs-1.1.2.gem +0 -0
  186. data/vendor/cache/erubis-2.7.0.gem +0 -0
  187. data/vendor/cache/ffi-1.0.9.gem +0 -0
  188. data/vendor/cache/gherkin-2.4.6.gem +0 -0
  189. data/vendor/cache/highline-1.6.2.gem +0 -0
  190. data/vendor/cache/i18n-0.5.0.gem +0 -0
  191. data/vendor/cache/json-1.5.3.gem +0 -0
  192. data/vendor/cache/net-scp-1.0.4.gem +0 -0
  193. data/vendor/cache/net-ssh-2.1.4.gem +0 -0
  194. data/vendor/cache/open4-1.1.0.gem +0 -0
  195. data/vendor/cache/popen4-0.1.2.gem +0 -0
  196. data/vendor/cache/progressbar-0.9.1.gem +0 -0
  197. data/vendor/cache/rspec-2.5.0.gem +0 -0
  198. data/vendor/cache/rspec-core-2.5.2.gem +0 -0
  199. data/vendor/cache/rspec-expectations-2.5.0.gem +0 -0
  200. data/vendor/cache/rspec-mocks-2.5.0.gem +0 -0
  201. data/vendor/cache/term-ansicolor-1.0.6.gem +0 -0
  202. data/vendor/cache/thor-0.14.6.gem +0 -0
  203. data/vendor/cache/vagrant-0.8.2.gem +0 -0
  204. data/vendor/cache/virtualbox-0.9.1.gem +0 -0
  205. metadata +417 -0
data/.gitignore ADDED
@@ -0,0 +1,15 @@
1
+ .DS_Store
2
+ gems/*
3
+ iso/*
4
+ tmp/*
5
+ definitions/*
6
+ Vagrantfile
7
+ cookbooks/*
8
+ boxes/*
9
+ pkg/*
10
+ *.box
11
+ .vagrant
12
+ virtualfloppy.vfd
13
+ .bundle
14
+ vendor/bundle
15
+ /*.gem
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec :name => "HeSYINUvSBZfxqA-veewee"
data/Gemfile.lock ADDED
@@ -0,0 +1,69 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ veewee (0.2.0.2)
5
+ cucumber (~> 1.0.2)
6
+ highline (~> 1.6.1)
7
+ net-ssh (~> 2.1.0)
8
+ popen4 (~> 0.1.2)
9
+ progressbar
10
+ rspec (~> 2.5.0)
11
+ thor (~> 0.14.6)
12
+ vagrant (~> 0.8.0)
13
+
14
+ GEM
15
+ remote: http://rubygems.org/
16
+ specs:
17
+ Platform (0.4.0)
18
+ archive-tar-minitar (0.5.2)
19
+ builder (3.0.0)
20
+ cucumber (1.0.2)
21
+ builder (>= 2.1.2)
22
+ diff-lcs (>= 1.1.2)
23
+ gherkin (~> 2.4.5)
24
+ json (>= 1.4.6)
25
+ term-ansicolor (>= 1.0.5)
26
+ diff-lcs (1.1.2)
27
+ erubis (2.7.0)
28
+ ffi (1.0.9)
29
+ gherkin (2.4.6)
30
+ json (>= 1.4.6)
31
+ highline (1.6.2)
32
+ i18n (0.5.0)
33
+ json (1.5.3)
34
+ net-scp (1.0.4)
35
+ net-ssh (>= 1.99.1)
36
+ net-ssh (2.1.4)
37
+ open4 (1.1.0)
38
+ popen4 (0.1.2)
39
+ Platform (>= 0.4.0)
40
+ open4 (>= 0.4.0)
41
+ progressbar (0.9.1)
42
+ rspec (2.5.0)
43
+ rspec-core (~> 2.5.0)
44
+ rspec-expectations (~> 2.5.0)
45
+ rspec-mocks (~> 2.5.0)
46
+ rspec-core (2.5.2)
47
+ rspec-expectations (2.5.0)
48
+ diff-lcs (~> 1.1.2)
49
+ rspec-mocks (2.5.0)
50
+ term-ansicolor (1.0.6)
51
+ thor (0.14.6)
52
+ vagrant (0.8.2)
53
+ archive-tar-minitar (= 0.5.2)
54
+ erubis (~> 2.7.0)
55
+ i18n (~> 0.5.0)
56
+ json (~> 1.5.1)
57
+ net-scp (~> 1.0.4)
58
+ net-ssh (~> 2.1.4)
59
+ thor (~> 0.14.6)
60
+ virtualbox (~> 0.9.1)
61
+ virtualbox (0.9.1)
62
+ ffi (~> 1.0.9)
63
+
64
+ PLATFORMS
65
+ ruby
66
+
67
+ DEPENDENCIES
68
+ bundler (>= 1.0.0)
69
+ veewee!
@@ -0,0 +1,33 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path("../lib/veewee/version", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "HeSYINUvSBZfxqA-veewee"
6
+ s.version = Veewee::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Patrick Debois", "Ringo De Smet"]
9
+ s.email = ["patrick.debois@jedi.be", "ringo.desmet@gmail.com"]
10
+ s.homepage = "http://github.com/jedi4ever/veewee/"
11
+ s.summary = %q{Vagrant box creation}
12
+ s.description = %q{Expand the 'vagrant box' command to support the creation of base boxes from scratch}
13
+
14
+ s.required_rubygems_version = ">= 1.3.6"
15
+ s.rubyforge_project = "veewee"
16
+
17
+ s.add_dependency "vagrant", "~> 0.8.0"
18
+ s.add_dependency "net-ssh", "~> 2.1.0"
19
+ s.add_dependency "popen4", "~> 0.1.2"
20
+ s.add_dependency "thor", "~> 0.14.6"
21
+ s.add_dependency "highline", "~> 1.6.1"
22
+ s.add_dependency "progressbar"
23
+ s.add_dependency "cucumber", "~> 1.0.2"
24
+ s.add_dependency "rspec", "~> 2.5.0"
25
+ #s.add_dependency "simon", "~> 0.1.1"
26
+
27
+ s.add_development_dependency "bundler", ">= 1.0.0"
28
+
29
+ s.files = `git ls-files`.split("\n")
30
+ s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
31
+ s.require_path = 'lib'
32
+ end
33
+
data/README.md ADDED
@@ -0,0 +1,198 @@
1
+ **VeeWee:** the tool to easily build vagrant base boxes
2
+ Vagrant is a great tool to test new things or changes in a virtual machine(Virtualbox) using either chef or puppet.
3
+ The first step is to download an existing 'base box'. I believe this scares a lot of people as they don't know who or how this box was build. Therefore lots of people end up first building their own base box to use with vagrant.
4
+
5
+ Veewee tries to automate this and to share the knowledge and sources you need to create a basebox. Instead of creating custom ISO's from your favorite distribution, it leverages the 'keyboardputscancode' command of Virtualbox so send the actual 'boot prompt' keysequence to boot an existing iso.
6
+
7
+ Before we can actually build the boxes, we need to take care of the minimal things to install:
8
+
9
+ - Have Virtualbox 4.x installed -> download it from http://download.virtualbox.org/virtualbox/
10
+
11
+
12
+ People have reported good experiences, why don't you give it a try?
13
+
14
+ ## Installation:
15
+ __as a gem__
16
+
17
+ $ gem install veewee
18
+
19
+ __from source__
20
+
21
+ $ git clone https://github.com/jedi4ever/veewee.git
22
+ $ cd veewee
23
+ $ gem install bundler
24
+ $ bundle install
25
+
26
+ If you don't use rvm, be sure to execute vagrant through bundle exec
27
+
28
+ $ alias vagrant="bundle exec vagrant"
29
+
30
+
31
+ ## List all templates
32
+
33
+ $ vagrant basebox templates
34
+ The following templates are available:
35
+ vagrant basebox define '<boxname>' 'ubuntu-10.10-server-i386-netboot'
36
+ vagrant basebox define '<boxname>' 'ubuntu-10.10-server-amd64-netboot'
37
+ vagrant basebox define '<boxname>' 'solaris-11-express-i386'
38
+ vagrant basebox define '<boxname>' 'freebsd-8.2-pcbsd-i386-netboot'
39
+ vagrant basebox define '<boxname>' 'Fedora-14-amd64-netboot'
40
+ vagrant basebox define '<boxname>' 'ubuntu-11.04-server-amd64'
41
+ vagrant basebox define '<boxname>' 'freebsd-8.2-experimental'
42
+ vagrant basebox define '<boxname>' 'archlinux-i686'
43
+ vagrant basebox define '<boxname>' 'CentOS-5.6-i386-netboot'
44
+ vagrant basebox define '<boxname>' 'openindiana-148-ai-x86'
45
+ vagrant basebox define '<boxname>' 'ubuntu-10.10-server-i386'
46
+ vagrant basebox define '<boxname>' 'ubuntu-10.04.2-server-i386'
47
+ vagrant basebox define '<boxname>' 'ubuntu-10.04.2-amd64-netboot'
48
+ vagrant basebox define '<boxname>' 'Sysrescuecd-2.0.0-experimental'
49
+ vagrant basebox define '<boxname>' 'Debian-6.0.1a-amd64-netboot'
50
+ vagrant basebox define '<boxname>' 'freebsd-8.2-pcbsd-i386'
51
+ vagrant basebox define '<boxname>' 'Fedora-14-i386'
52
+ vagrant basebox define '<boxname>' 'Fedora-14-amd64'
53
+ vagrant basebox define '<boxname>' 'ubuntu-10.04.2-server-i386-netboot'
54
+ vagrant basebox define '<boxname>' 'opensuse-11.4-i386-experimental'
55
+ vagrant basebox define '<boxname>' 'CentOS-4.8-i386'
56
+ vagrant basebox define '<boxname>' 'ubuntu-10.04.2-server-amd64'
57
+ vagrant basebox define '<boxname>' 'ubuntu-8.04.4-server-amd64'
58
+ vagrant basebox define '<boxname>' 'gentoo-latest-i386-experimental'
59
+ vagrant basebox define '<boxname>' 'ubuntu-8.04.4-server-i386'
60
+ vagrant basebox define '<boxname>' 'windows-2008R2-amd64'
61
+ vagrant basebox define '<boxname>' 'Fedora-14-i386-netboot'
62
+ vagrant basebox define '<boxname>' 'archlinux-64-experimental'
63
+ vagrant basebox define '<boxname>' 'Debian-6.0.1a-i386-netboot'
64
+ vagrant basebox define '<boxname>' 'ubuntu-10.10-server-amd64'
65
+ vagrant basebox define '<boxname>' 'archlinux-64-aif-experimental'
66
+ vagrant basebox define '<boxname>' 'ubuntu-11.04-server-i386'
67
+ vagrant basebox define '<boxname>' 'CentOS-5.6-i386'
68
+
69
+
70
+ ## Define a new box
71
+ Let's define a Ubuntu 10.10 server i386 basebox called myunbuntubox
72
+ this is essentially making a copy based on the templates provided above.
73
+
74
+ $ vagrant basebox define 'myubuntubox' 'ubuntu-10.10-server-i386'
75
+ The basebox 'myubuntubox' has been succesfully created from the template ''ubuntu-10.10-server-i386'
76
+ You can now edit the definition files stored in definitions/myubuntubox
77
+ or build the box with:
78
+ vagrant basebox build 'myubuntubox'
79
+
80
+ -> This copies over the templates/ubuntu-10.10-server-i386 to definition/myubuntubox
81
+
82
+ $ ls definitions/myubuntubox
83
+ definition.rb postinstall.sh postinstall2.sh preseed.cfg
84
+
85
+ ## Optionally modify the definition.rb , postinstall.sh or preseed.cfg
86
+
87
+ Veewee::Session.declare( {
88
+ :cpu_count => '1', :memory_size=> '256',
89
+ :disk_size => '10140', :disk_format => 'VDI',
90
+ :os_type_id => 'Ubuntu',
91
+ :iso_file => "ubuntu-10.10-server-i386.iso",
92
+ :iso_src => "http://releases.ubuntu.com/maverick/ubuntu-10.10-server-i386.iso",
93
+ :iso_md5 => "ce1cee108de737d7492e37069eed538e",
94
+ :iso_download_timeout => "1000",
95
+ :boot_wait => "10",
96
+ :boot_cmd_sequence => [
97
+ '<Esc><Esc><Enter>',
98
+ '/install/vmlinuz noapic preseed/url=http://%IP%:%PORT%/preseed.cfg ',
99
+ 'debian-installer=en_US auto locale=en_US kbd-chooser/method=us ',
100
+ 'hostname=%NAME% ',
101
+ 'fb=false debconf/frontend=noninteractive ',
102
+ 'console-setup/ask_detect=false console-setup/modelcode=pc105 console-setup/layoutcode=us ',
103
+ 'initrd=/install/initrd.gz -- <Enter>'
104
+ ],
105
+ :kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "preseed.cfg",
106
+ :ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
107
+ :ssh_host_port => "2222", :ssh_guest_port => "22",
108
+ :sudo_cmd => "echo '%p'|sudo -S sh '%f'",
109
+ :shutdown_cmd => "shutdown -H",
110
+ :postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
111
+ }
112
+ )
113
+
114
+ If you need to change values in the templates, be sure to run the rake undefine, the rake define again to copy the changes across.
115
+
116
+ ## Getting the cdrom file in place
117
+ Put your isofile inside the 'currentdir'/iso directory or if you don't run
118
+
119
+ $ vagrant basebox build 'myubuntubox'
120
+
121
+ - the build assumes your iso files are in 'currentdir'/iso
122
+ - if it can not find it will suggest to download the iso for you
123
+ - use '--force' to overwrite an existing install
124
+
125
+ ## Build the new box:
126
+
127
+ $ vagrant basebox build 'myubuntubox'
128
+
129
+ - This will create a machine + disk according to the definition.rb
130
+ - Note: :os_type_id = The internal Name Virtualbox uses for that Distribution
131
+ - Mount the ISO File :iso_file
132
+ - Boot up the machine and wait for :boot_time
133
+ - Send the keystrokes in :boot_cmd_sequence
134
+ - Startup a webserver on :kickstart_port to wait for a request for the :kickstart_file
135
+ - Wait for ssh login to work with :ssh_user , :ssh_password
136
+ - Sudo execute the :postinstall_files
137
+
138
+ ## Validate the vm
139
+
140
+ $ vagrant basebox validate 'myubuntubox'
141
+
142
+ this will run some cucumber test against the box to see if it has the necessary bits and pieces for vagrant to work
143
+
144
+ ## Export the vm to a .box file
145
+
146
+ $ vagrant basebox export 'myubuntubox'
147
+
148
+ this is actually calling - vagrant package --base 'myubuntubox' --output 'boxes/myubuntubox.box'
149
+
150
+ this will result in a myubuntubox.box
151
+
152
+ ## Add the box as one of your boxes
153
+ To import it into vagrant type:
154
+
155
+ $ vagrant box add 'myubuntubox' 'myubuntubox.box'
156
+
157
+ ## Use it in vagrant
158
+
159
+ To use it:
160
+
161
+ $ vagrant init 'myubuntubox'
162
+ $ vagrant up
163
+ $ vagrant ssh
164
+
165
+ ## How to add a new OS/installation (needs some love)
166
+
167
+ I suggest the easiest way is to get an account on github and fork of the veewee repository
168
+
169
+ $ git clone https://github.com/*your account*/veewee.git
170
+ $ cd veewee
171
+ $ gem install bundler
172
+ $ bundle install
173
+
174
+ If you don't use rvm, be sure to execute vagrant through bundle exec
175
+
176
+ $ alias vagrant="bundle exec vagrant"
177
+
178
+ Start of an existing one
179
+
180
+ $ vagrant basebox define 'mynewos' 'ubuntu...'
181
+
182
+ - Do changes in the currentdir/definitions/mynewos
183
+ - When it builds ok, move the definition/mynewos to a sensible directory under templates
184
+ - commit the changes (git commit -a)
185
+ - push the changes to github (git push)
186
+ - go to the github gui and issue a pull request for it
187
+
188
+ ## If you have a setup working, share your 'definition' with me. That would be fun!
189
+
190
+ IDEAS:
191
+
192
+ - Now you integrate this with your CI build to create a daily basebox
193
+
194
+ FUTURE IDEAS:
195
+
196
+ - export to AMI too
197
+ - provide for more failsafe execution, testing parameters
198
+ - Do the same for Vmware Fusion
data/Rakefile ADDED
@@ -0,0 +1,92 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ require 'bundler/setup'
4
+ Bundler::GemHelper.install_tasks
5
+
6
+ #Setup some base variables to use
7
+ veewee_dir= "."
8
+ definition_dir= File.expand_path(File.join(veewee_dir, "definitions"))
9
+ lib_dir= File.expand_path(File.join(veewee_dir, "lib"))
10
+ box_dir= File.expand_path(File.join(veewee_dir, "boxes"))
11
+ template_dir=File.expand_path(File.join(veewee_dir, "templates"))
12
+ vbox_dir=File.expand_path(File.join(veewee_dir, "tmp"))
13
+ tmp_dir=File.expand_path(File.join(veewee_dir, "tmp"))
14
+ iso_dir=File.expand_path(File.join(veewee_dir, "iso"))
15
+
16
+
17
+ #Load Veewee::Session libraries
18
+ Dir.glob(File.join(lib_dir, '**','*.rb')).each {|f|
19
+ require f }
20
+
21
+ #Initialize
22
+ Veewee::Session.setenv({:veewee_dir => veewee_dir, :definition_dir => definition_dir,
23
+ :template_dir => template_dir, :iso_dir => iso_dir, :box_dir => box_dir, :tmp_dir => tmp_dir})
24
+
25
+ desc 'Default: list templates'
26
+ task :default => [:templates]
27
+
28
+ desc 'List templates'
29
+ task :templates do
30
+ Veewee::Session.list_templates
31
+ end
32
+
33
+ desc 'Define box'
34
+ task :define, [:boxname,:template_name] do |t,args|
35
+ if args.to_hash.size!=2
36
+ puts "needs two arguments: rake define['boxname','template_name']"
37
+ exit
38
+ end
39
+ Veewee::Session.define(args.boxname,args.template_name)
40
+ end
41
+
42
+ desc 'Undefine box'
43
+ task :undefine, [:boxname] do |t,args|
44
+ if args.to_hash.size!=1
45
+ puts "needs one arguments: rake undefine[\"yourname\"]"
46
+ exit
47
+ end
48
+ Veewee::Session.undefine(args.boxname)
49
+ end
50
+
51
+ desc 'List Definitions'
52
+ task :definitions do
53
+ Veewee::Session.list_definitions
54
+ end
55
+
56
+ desc 'Build box'
57
+ task :build, [:boxname] do |t,args|
58
+ if args.to_hash.size!=1
59
+ puts "needs one arguments: rake build['boxname']"
60
+ exit
61
+ end
62
+ Veewee::Session.build(args.boxname)
63
+ end
64
+
65
+ desc 'List boxes'
66
+ task :boxes do
67
+ Veewee::Session.list_boxes
68
+ end
69
+
70
+ desc 'Export box'
71
+ task :export, [:boxname] do |t,args|
72
+ if args.to_hash.size!=1
73
+ puts "needs one arguments: rake export['boxname']"
74
+ exit
75
+ end
76
+ Veewee::Session.export_box(args.boxname)
77
+ end
78
+
79
+ desc 'Remove box'
80
+ task :remove_box, [:boxname] do |t,args|
81
+ Veewee::Session.remove_box(args.boxname)
82
+ end
83
+
84
+ desc 'List ostypes available'
85
+ task :list_ostypes do |t,args|
86
+ Veewee::Session.list_ostypes
87
+ end
88
+
89
+ desc 'Clean all unfinished builds'
90
+ task :clean do
91
+ Veewee::Session.clean
92
+ end
data/bin/veewee ADDED
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'thor'
5
+ require 'bundler'
6
+ require 'virtualbox'
7
+ require 'veewee'
8
+
9
+
10
+ #Setup some base variables to use
11
+ veewee_dir= File.expand_path(File.join(File.dirname(__FILE__),".."))
12
+ definition_dir= File.expand_path(File.join(".", "definitions"))
13
+ lib_dir= File.expand_path(File.join(veewee_dir, "lib"))
14
+ box_dir= File.expand_path(File.join(veewee_dir, "boxes"))
15
+ template_dir=File.expand_path(File.join(veewee_dir, "templates"))
16
+
17
+ #vbox_dir=File.expand_path(File.join(veewee_dir, "tmp"))
18
+ tmp_dir=File.expand_path(File.join(veewee_dir, "tmp"))
19
+
20
+ iso_dir=File.expand_path(File.join(veewee_dir, "iso"))
21
+
22
+ #needs to be moved to the config files to be allowed override
23
+ #ENV['VBOX_USER_HOME']=vbox_dir
24
+
25
+ #Load Veewee::Session libraries
26
+ Dir.glob(File.join(lib_dir, '**','*.rb')).each {|f|
27
+ require f }
28
+
29
+ #Initialize
30
+ Veewee::Session.setenv({:veewee_dir => veewee_dir, :definition_dir => definition_dir,
31
+ :template_dir => template_dir, :iso_dir => iso_dir, :box_dir => box_dir, :tmp_dir => tmp_dir})
32
+
33
+
34
+
35
+ class VeeweeCLI < Thor
36
+
37
+ desc "init [NAME] [TEMPLATE]", "initializes a box from a template"
38
+ method_options :force => :boolean
39
+ def init(boxname=nil, template=nil)
40
+ if (boxname.nil?)
41
+ puts "please provide a boxname"
42
+ exit
43
+ end
44
+
45
+ puts "Init a new box #{boxname}, starting from template #{template}"
46
+ Veewee::Session.define(boxname,template)
47
+
48
+ end
49
+
50
+ desc "templates", "list the template available"
51
+ def templates
52
+ Veewee::Session.list_templates
53
+ end
54
+
55
+ desc "build [NAME]", "build the box defined"
56
+ method_options :force => :boolean
57
+ def build(boxname)
58
+ puts "Building box #{boxname}"
59
+ Veewee::Session.build(boxname)
60
+ end
61
+
62
+ desc "export [NAME]", "export the box"
63
+ method_options :force => :boolean
64
+ def export(boxname)
65
+ if (!boxname.nil?)
66
+ Veewee::Session.export_box(boxname)
67
+ end
68
+ end
69
+
70
+ end
71
+
72
+
73
+
74
+ version=VirtualBox.version
75
+ if (version.match(/^4./))
76
+ VeeweeCLI.start
77
+ else
78
+ puts "veewee only supports VirtualBox 4.x"
79
+ end
@@ -0,0 +1,5 @@
1
+ $ java -jar dir2floppy.jar
2
+ Usage: java -jar dir2floppy.jar <sourcedir> <floppyfile>
3
+
4
+ This uses the http://code.google.com/p/fat32-lib library
5
+ http://code.google.com/p/fat32-lib/wiki/Tutorial
Binary file
@@ -0,0 +1,137 @@
1
+ package be.jedi.dir2floppy;
2
+
3
+ import java.io.File;
4
+ import java.io.FileInputStream;
5
+ import java.io.IOException;
6
+ import java.nio.ByteBuffer;
7
+ import java.nio.channels.FileChannel;
8
+
9
+ import de.waldheinz.fs.FileSystem;
10
+ import de.waldheinz.fs.FsDirectoryEntry;
11
+ import de.waldheinz.fs.FsFile;
12
+ import de.waldheinz.fs.fat.SuperFloppyFormatter;
13
+ import de.waldheinz.fs.util.FileDisk;
14
+
15
+ /**
16
+ * Hello world!
17
+ *
18
+ */
19
+ public class Dir2Floppy
20
+ {
21
+ public static void main( String[] args )
22
+ {
23
+ if (args.length < 2) {
24
+ System.out.println("Usage: java -jar dir2floppy.jar <sourcedir> <floppyfile>");
25
+ System.exit(-1);
26
+ }
27
+
28
+ FileDisk device = null;
29
+
30
+ //Create the floppy
31
+ try {
32
+ device = FileDisk.create(new File(args[1]),(long)1440 * 1024);
33
+ } catch (IOException e) {
34
+ // TODO Auto-generated catch block
35
+ e.printStackTrace();
36
+ System.exit(-1);
37
+ }
38
+
39
+ //Format the floppy
40
+ FileSystem fs=null;
41
+ try {
42
+ fs = SuperFloppyFormatter.get(device).format();
43
+
44
+ } catch (IOException e) {
45
+ // TODO Auto-generated catch block
46
+ e.printStackTrace();
47
+ System.exit(-1);
48
+
49
+ }
50
+
51
+ //Iterate of directories
52
+ File dir = new File(args[0]);
53
+
54
+ String[] children = dir.list();
55
+ if (children == null) {
56
+ // Either dir does not exist or is not a directory
57
+ System.out.println("Error. does the directory exist?");
58
+ System.exit(-1);
59
+ } else {
60
+ for (int i=0; i<children.length; i++) {
61
+ // Get filename of file or directory
62
+ File aFile=new File(dir.getAbsolutePath()+System.getProperty("file.separator")+children[i]);
63
+
64
+ try {
65
+ // Create the entry on the floppy
66
+ FsDirectoryEntry floppyEntry = fs.getRoot().addFile(children[i]);
67
+ //floppyEntry.setName(children[i]);
68
+ System.out.print("- Processing file: "+children[i]+" ");
69
+
70
+ FsFile floppyfile = floppyEntry.getFile();
71
+
72
+ // Copy the file over
73
+ if (aFile.isFile()) {
74
+ FileInputStream fis= new FileInputStream(aFile);
75
+
76
+ FileChannel fci = fis.getChannel();
77
+ ByteBuffer buffer = ByteBuffer.allocate(1024);
78
+
79
+ long counter=0;
80
+ int len;
81
+
82
+ // http://www.kodejava.org/examples/49.html
83
+ // Here we start to read the source file and write it
84
+ // to the destination file. We repeat this process
85
+ // until the read method of input stream channel return
86
+ // nothing (-1).
87
+ while(true)
88
+ {
89
+ // read a block of data and put it in the buffer
90
+ int read = fci.read(buffer);
91
+
92
+ // did we reach the end of the channel? if yes
93
+ // jump out the while-loop
94
+ if (read == -1)
95
+ break;
96
+
97
+ // flip the buffer
98
+ buffer.flip();
99
+
100
+ // write to the destination channel
101
+ System.out.print(".");
102
+ floppyfile.write(counter*1024, buffer);
103
+ counter++;
104
+
105
+
106
+ // clear the buffer and user it for the next read
107
+ // process
108
+ buffer.clear();
109
+ }
110
+ System.out.println();
111
+
112
+ floppyfile.flush();
113
+
114
+ fis.close();
115
+ }
116
+ } catch (IOException e) {
117
+ // TODO Auto-generated catch block
118
+ e.printStackTrace();
119
+
120
+ }
121
+
122
+ }
123
+ }
124
+
125
+
126
+ try {
127
+ fs.close();
128
+ } catch (IOException e) {
129
+ // TODO Auto-generated catch block
130
+ e.printStackTrace();
131
+ }
132
+
133
+ System.out.println( "Done" );
134
+ }
135
+
136
+ }
137
+
@@ -0,0 +1,6 @@
1
+ begin
2
+ require 'veewee'
3
+ rescue LoadError
4
+ require 'rubygems'
5
+ require 'veewee'
6
+ end