veewee 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/veewee/scancode.rb +10 -4
- data/lib/veewee/session.rb +1 -1
- data/lib/veewee/version.rb +1 -1
- data/templates/freebsd-8.2-i386-pcbsdinstaller/definition.rb +33 -0
- data/templates/freebsd-8.2-i386-pcbsdinstaller/pcinstall.fbg.cfg +68 -0
- data/templates/freebsd-8.2-i386-pcbsdinstaller/postinstall.sh +21 -0
- metadata +7 -4
data/Gemfile.lock
CHANGED
data/lib/veewee/scancode.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
module Veewee
|
2
2
|
class Scancode
|
3
3
|
|
4
|
-
def self.send_sequence(vboxcmd,vname,sequence)
|
4
|
+
def self.send_sequence(vboxcmd,vname,sequence,webport)
|
5
5
|
puts
|
6
6
|
counter=0
|
7
7
|
sequence.each { |s|
|
8
8
|
counter=counter+1
|
9
9
|
|
10
10
|
s.gsub!(/%IP%/,Veewee::Session.local_ip);
|
11
|
-
s.gsub!(/%PORT%/,
|
11
|
+
s.gsub!(/%PORT%/,webport);
|
12
12
|
s.gsub!(/%NAME%/, vname);
|
13
13
|
puts "Typing:[#{counter}]: "+s
|
14
14
|
|
@@ -51,9 +51,14 @@ module Veewee
|
|
51
51
|
k['a'] = '1e'; k['s'] = '1f' ; k['d'] = '20' ; k['f'] = '21'; k['g'] = '22' ; k['h'] = '23' ; k['j'] = '24'; k['k']= '25' ; k['l']='26'; k[';'] = '27'
|
52
52
|
k['A'] = '2a 1e aa'; k['S'] = '2a 1f aa' ; k['D'] = '2a 20 aa' ; k['F'] = '2a 21 aa'; k['G'] = '2a 22 aa' ; k['H'] = '2a 23 aa' ; k['J'] = '2a 24 aa'; k['K']= '2a 25 aa' ; k['L']='2a 26 aa';
|
53
53
|
|
54
|
-
k[';'] = '27' ;k['"']='28';
|
54
|
+
k[';'] = '27' ;k['"']='2a 28 aa';k['\'']='28';
|
55
|
+
|
56
|
+
k['\\'] = '2b'; k['|'] = '2a 2b aa';
|
55
57
|
|
56
|
-
k['[']='1a'; k[']']='1b'
|
58
|
+
k['[']='1a'; k[']']='1b';
|
59
|
+
k['<']='2a 33 aa'; k['>']='2a 34 aa';
|
60
|
+
k['$']='2a 05 aa';
|
61
|
+
k['+']='2a 0d aa';
|
57
62
|
|
58
63
|
k['z'] = '2c'; k['x'] = '2d' ; k['c'] = '2e' ; k['v'] = '2f'; k['b'] = '30' ; k['n'] = '31' ; k['m'] = '32';
|
59
64
|
k['Z'] = '2a 2c aa'; k['X'] = '2a 2d aa' ; k['C'] = '2a 2e aa' ; k['V'] = '2a 2f aa'; k['B'] = '2a 30 aa' ; k['N'] = '2a 31 aa' ; k['M'] = '2a 32 aa';
|
@@ -68,6 +73,7 @@ module Veewee
|
|
68
73
|
special['<Return>'] = '1c'
|
69
74
|
special['<Esc>'] = '01';
|
70
75
|
special['<Tab>'] = '0f';
|
76
|
+
special['<KillX>'] = '1d 38 0e';
|
71
77
|
|
72
78
|
#special['<Up>'] = '01';
|
73
79
|
#special['<Down>'] = '01';
|
data/lib/veewee/session.rb
CHANGED
@@ -278,7 +278,7 @@ module Veewee
|
|
278
278
|
puts "Waiting for the machine to boot"
|
279
279
|
sleep @definition[:boot_wait].to_i
|
280
280
|
|
281
|
-
Veewee::Scancode.send_sequence("#{@vboxcmd}","#{boxname}",@definition[:boot_cmd_sequence])
|
281
|
+
Veewee::Scancode.send_sequence("#{@vboxcmd}","#{boxname}",@definition[:boot_cmd_sequence],@definition[:kickstart_port])
|
282
282
|
|
283
283
|
kickstartfile=@definition[:kickstart_file]
|
284
284
|
if kickstartfile.nil? || kickstartfile.length == 0
|
data/lib/veewee/version.rb
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
# Many thanks to @draco2002
|
2
|
+
# http://dracosplace.com/veewee_and_freebsd
|
3
|
+
|
4
|
+
Veewee::Session.declare( {
|
5
|
+
:cpu_count => '1', :memory_size=> '768',
|
6
|
+
:disk_size => '10140', :disk_format => 'VDI',:disk_size => '10240' ,
|
7
|
+
:os_type_id => 'FreeBSD',
|
8
|
+
# :iso_file => "PCBSD8.2-x86-bootonly.iso",
|
9
|
+
:iso_file => "PCBSD8.2-x86-DVD.iso",
|
10
|
+
|
11
|
+
# :iso_src => "ftp://mirrors.isc.org/pub/pcbsd/8.2/i386/PCBSD8.2-x86-bootonly.iso",
|
12
|
+
:iso_src => "ftp://mirrors.isc.org/pub/pcbsd/8.2/i386/PCBSD8.2-x86-DVD.iso",
|
13
|
+
|
14
|
+
:iso_md5 => "6433a8abf6073b177750d48398bed341",
|
15
|
+
:iso_download_timeout => "1000",
|
16
|
+
:boot_wait => "60",:boot_cmd_sequence => [
|
17
|
+
'<KillX>',
|
18
|
+
'<Enter>',
|
19
|
+
'dhclient em0<Enter>',
|
20
|
+
'sleep 15;echo "Lets Get the File";fetch "http://%IP%:%PORT%/pcinstall.fbg.cfg";sleep 2;',
|
21
|
+
'echo \'echo sshd_enable=\"YES\" >> $FSMNT/etc/rc.conf\' > /root/activate-ssh.sh ; cat /root/activate-ssh.sh<Enter>',
|
22
|
+
'chmod +x /root/activate-ssh.sh<Enter>',
|
23
|
+
'echo "Hope i got the file";/usr/PCBSD/pc-sysinstall/pc-sysinstall -c /root/pcinstall.fbg.cfg<Enter>'
|
24
|
+
,'reboot<Enter>',
|
25
|
+
],
|
26
|
+
:kickstart_port => "7122", :kickstart_timeout => "10000",:kickstart_file => "pcinstall.fbg.cfg",
|
27
|
+
:ssh_login_timeout => "10000",:ssh_user => "vagrant", :ssh_password => "vagrant",:ssh_key => "",
|
28
|
+
:ssh_host_port => "7222", :ssh_guest_port => "22",
|
29
|
+
:sudo_cmd => "cat '%f'|su -",
|
30
|
+
:shutdown_cmd => "shutdown -H",
|
31
|
+
:postinstall_files => [ "postinstall.sh"],:postinstall_timeout => "10000"
|
32
|
+
}
|
33
|
+
)
|
@@ -0,0 +1,68 @@
|
|
1
|
+
installInteractive=no
|
2
|
+
installMode=fresh
|
3
|
+
installType=FreeBSD
|
4
|
+
packageType=tar
|
5
|
+
hostname=freebsd
|
6
|
+
#installMedium=dvd
|
7
|
+
installMedium=dvd
|
8
|
+
netSaveDev=AUTO-DHCP
|
9
|
+
|
10
|
+
# Timezone
|
11
|
+
timeZone=America/New_York
|
12
|
+
enableNTP=yes
|
13
|
+
|
14
|
+
# Keyboard Layout Options
|
15
|
+
localizeKeyModel=pc104
|
16
|
+
localizeKeyLayout=us U.S.
|
17
|
+
|
18
|
+
# Disk Setup for ada0
|
19
|
+
disk0=ada0
|
20
|
+
partition=ALL
|
21
|
+
bootManager=none
|
22
|
+
partscheme=MBR
|
23
|
+
commitDiskPart
|
24
|
+
|
25
|
+
# Setup the disk label
|
26
|
+
# All sizes are expressed in MB
|
27
|
+
disk0-part=UFS+S 1024 /
|
28
|
+
disk0-part=SWAP 1534 none
|
29
|
+
disk0-part=UFS+S 2048 /var
|
30
|
+
disk0-part=UFS+S 5629 /usr
|
31
|
+
commitDiskLabel
|
32
|
+
|
33
|
+
# List our components to install
|
34
|
+
installComponents=ports
|
35
|
+
|
36
|
+
# Set the root pass
|
37
|
+
rootPass=vagrant
|
38
|
+
|
39
|
+
userName=vagrant
|
40
|
+
userComment=vagrant user
|
41
|
+
userPass=vagrant
|
42
|
+
userShell=/bin/csh
|
43
|
+
userHome=/home/vagrant
|
44
|
+
# Wheel group makes user sudo able
|
45
|
+
userGroups=wheel,operator
|
46
|
+
commitUser
|
47
|
+
|
48
|
+
# This is executed in sh not in bash
|
49
|
+
# 072 = '=' character
|
50
|
+
# 042 = '"' character
|
51
|
+
#runExtCommand=echo sshd_enable\\\072\\\042YES\\\042 >> $FSMNT/etc/rc.conf
|
52
|
+
#runExtCommand=echo sshd_enable\=\"YES\" >> $FSMNT/etc/rc.conf
|
53
|
+
runExtCommand=/root/activate-ssh.sh
|
54
|
+
|
55
|
+
# We can't run this because the chroot does not have network setup yet
|
56
|
+
# http://sonicchicken.net/blog/wordpress/20090111/batch-port-install/
|
57
|
+
# http://lists.freebsd.org/pipermail/freebsd-questions/2007-January/140301.html
|
58
|
+
#runCommand=cd /usr/ports/security/sudo ; make install -DBATCH
|
59
|
+
|
60
|
+
# We temporary disable password checks , we promise to make up for it later
|
61
|
+
runCommand=sed -i -e 's@auth.*include.*system@@' /etc/pam.d/su
|
62
|
+
|
63
|
+
#/usr/local/etc/sudoers
|
64
|
+
## Same thing without a password
|
65
|
+
# %wheel ALL=(ALL) NOPASSWD: ALL
|
66
|
+
|
67
|
+
## Uncomment to allow members of group sudo to execute any command
|
68
|
+
# %sudo ALL=(ALL) ALL
|
@@ -0,0 +1,21 @@
|
|
1
|
+
#First install sudo
|
2
|
+
cd /usr/ports/security/sudo
|
3
|
+
make install -DBATCH
|
4
|
+
|
5
|
+
#We prefer bash to be there
|
6
|
+
cd /usr/ports/shells/bash
|
7
|
+
make install -DBATCH
|
8
|
+
|
9
|
+
#Off to rubygems to get first ruby running
|
10
|
+
cd /usr/ports/dev/ruby-gems
|
11
|
+
make install -DBATCH
|
12
|
+
|
13
|
+
#Gem chef
|
14
|
+
cd /usr/ports/sysutils/rubygem-chef
|
15
|
+
make install -DBATCH
|
16
|
+
|
17
|
+
#Now only if we could get things to install in /usr instead of /usr/local
|
18
|
+
|
19
|
+
#Gem puppet
|
20
|
+
|
21
|
+
#Virtualbox additions
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: veewee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 14
|
10
|
+
version: 0.1.14
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Patrick Debois
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-03-
|
19
|
+
date: 2011-03-15 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -195,6 +195,9 @@ files:
|
|
195
195
|
- templates/Sysrescuecd-2.0.0-experimental/definition.rb
|
196
196
|
- templates/freebsd-8.2-experimental/definition.rb
|
197
197
|
- templates/freebsd-8.2-experimental/postinstall.sh
|
198
|
+
- templates/freebsd-8.2-i386-pcbsdinstaller/definition.rb
|
199
|
+
- templates/freebsd-8.2-i386-pcbsdinstaller/pcinstall.fbg.cfg
|
200
|
+
- templates/freebsd-8.2-i386-pcbsdinstaller/postinstall.sh
|
198
201
|
- templates/ubuntu-10.04.1-server-amd64/definition.rb
|
199
202
|
- templates/ubuntu-10.04.1-server-amd64/postinstall.sh
|
200
203
|
- templates/ubuntu-10.04.1-server-amd64/preseed.cfg
|