veewee 0.1.29 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +23 -29
- data/lib/veewee/session.rb +10 -7
- data/lib/veewee/ssh.rb +70 -42
- data/lib/veewee/version.rb +1 -1
- data/templates/CentOS-4.8-i386/postinstall.sh +2 -0
- data/templates/CentOS-5.6-i386-netboot/postinstall.sh +3 -1
- data/templates/CentOS-5.6-i386/postinstall.sh +3 -1
- data/templates/CentOS-5.6-x86_64-netboot/postinstall.sh +2 -0
- data/templates/CentOS-6.0-i386-netboot/definition.rb +16 -0
- data/templates/CentOS-6.0-i386-netboot/ks.cfg +52 -0
- data/templates/CentOS-6.0-i386-netboot/postinstall.sh +30 -0
- data/templates/CentOS-6.0-i386/definition.rb +17 -0
- data/templates/CentOS-6.0-i386/ks.cfg +47 -0
- data/templates/CentOS-6.0-i386/postinstall.sh +48 -0
- data/templates/CentOS-6.0-x86_64-netboot/definition.rb +16 -0
- data/templates/CentOS-6.0-x86_64-netboot/ks.cfg +52 -0
- data/templates/CentOS-6.0-x86_64-netboot/postinstall.sh +30 -0
- data/templates/CentOS-6.0-x86_64/definition.rb +17 -0
- data/templates/CentOS-6.0-x86_64/ks.cfg +47 -0
- data/templates/CentOS-6.0-x86_64/postinstall.sh +48 -0
- data/templates/Debian-5.0.8-amd64-netboot/postinstall.sh +2 -0
- data/templates/Debian-5.0.8-i386-netboot/postinstall.sh +2 -0
- data/templates/Debian-6.0.2-amd64-netboot/postinstall.sh +2 -0
- data/templates/Debian-6.0.2-i386-netboot/postinstall.sh +2 -0
- data/templates/Fedora-14-amd64-netboot/postinstall.sh +2 -0
- data/templates/Fedora-14-amd64/postinstall.sh +2 -0
- data/templates/Fedora-14-i386-netboot/postinstall.sh +2 -0
- data/templates/Fedora-14-i386/postinstall.sh +2 -0
- data/templates/Fedora-15-i386-netboot/definition.rb +17 -0
- data/templates/Fedora-15-i386-netboot/ks.cfg +82 -0
- data/templates/Fedora-15-i386-netboot/postinstall.sh +18 -0
- data/templates/Fedora-15-i386/definition.rb +17 -0
- data/templates/Fedora-15-i386/ks.cfg +64 -0
- data/templates/Fedora-15-i386/postinstall.sh +33 -0
- data/templates/archlinux-i386/aif.cfg +33 -0
- data/templates/archlinux-i386/definition.rb +29 -0
- data/templates/archlinux-i386/postinstall.sh +95 -0
- data/templates/archlinux-x86_64/aif.cfg +33 -0
- data/templates/{archlinux-64-aif-experimental → archlinux-x86_64}/definition.rb +7 -7
- data/templates/archlinux-x86_64/postinstall.sh +95 -0
- data/templates/freebsd-8.2-experimental/postinstall.sh +3 -1
- data/templates/freebsd-8.2-pcbsd-i386-netboot/postinstall.sh +2 -0
- data/templates/freebsd-8.2-pcbsd-i386/postinstall.sh +2 -0
- data/templates/gentoo-latest-i386-experimental/postinstall.sh +2 -0
- data/templates/openindiana-148-ai-x86/postinstall.sh +2 -0
- data/templates/opensuse-11.4-i386-experimental/postinstall.sh +1 -0
- data/templates/solaris-11-express-i386/postinstall.sh +2 -0
- data/templates/ubuntu-10.04.2-amd64-netboot/postinstall.sh +4 -2
- data/templates/ubuntu-10.04.2-server-amd64-alt/definition.rb +57 -0
- data/templates/ubuntu-10.04.2-server-amd64-alt/postinstall.sh +249 -0
- data/templates/ubuntu-10.04.2-server-amd64-alt/preseed.cfg +124 -0
- data/templates/ubuntu-10.04.2-server-amd64/definition.rb +56 -23
- data/templates/ubuntu-10.04.2-server-amd64/postinstall.sh +4 -2
- data/templates/ubuntu-10.04.2-server-i386-netboot/postinstall.sh +4 -2
- data/templates/ubuntu-10.04.2-server-i386/postinstall.sh +3 -1
- data/templates/ubuntu-10.10-server-amd64-netboot/postinstall.sh +4 -2
- data/templates/ubuntu-10.10-server-amd64/postinstall.sh +3 -1
- data/templates/ubuntu-10.10-server-i386-netboot/postinstall.sh +4 -2
- data/templates/ubuntu-10.10-server-i386/postinstall.sh +4 -2
- data/templates/ubuntu-11.04-server-amd64/postinstall.sh +4 -2
- data/templates/ubuntu-11.04-server-i386/postinstall.sh +4 -2
- data/templates/ubuntu-8.04.4-server-amd64/postinstall.sh +2 -0
- data/templates/ubuntu-8.04.4-server-i386/postinstall.sh +3 -1
- data/validation/features/steps/ssh_steps.rb +22 -8
- data/veewee.gemspec +2 -2
- metadata +40 -21
- data/templates/archlinux-64-aif-experimental/postinstall.sh +0 -6
- data/templates/archlinux-64-experimental/autorun0 +0 -6
- data/templates/archlinux-64-experimental/definition.rb +0 -21
- data/templates/archlinux-64-experimental/postinstall.sh +0 -190
- data/templates/archlinux-i686/autorun0 +0 -6
- data/templates/archlinux-i686/definition.rb +0 -21
- data/templates/archlinux-i686/postinstall.sh +0 -191
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
Veewee::Session.declare({
|
|
2
|
-
:cpu_count => '1', :memory_size=> '256',
|
|
3
|
-
:disk_size => '10140', :disk_format => 'VDI',:hostiocache => 'off',
|
|
4
|
-
:os_type_id => 'ArchLinux_64',
|
|
5
|
-
:iso_file => "systemrescuecd-x86-2.0.0.iso",
|
|
6
|
-
:iso_src => "http://downloads.sourceforge.net/project/systemrescuecd/sysresccd-x86/2.0.0/systemrescuecd-x86-2.0.0.iso?r=http%3A%2F%2Fwww.sysresccd.org%2FDownload&ts=1297107227&use_mirror=ignum",
|
|
7
|
-
:iso_md5 => "51012e0bb943cff6367e5cea3a61cdbe",
|
|
8
|
-
:iso_download_timeout => "1000",
|
|
9
|
-
:boot_wait => "10", :boot_cmd_sequence => [
|
|
10
|
-
'<Down><Down><Down><Down><Down><Tab> ',
|
|
11
|
-
'setkmap=us dodhcp=eth0 dhcphostname=%NAME% ar_source=http://%IP%:%PORT%/ autoruns=0 rootpass=vagrant',
|
|
12
|
-
'<Enter>'
|
|
13
|
-
],
|
|
14
|
-
:kickstart_port => "7122", :kickstart_timeout => "10000", :kickstart_file => "autorun0",
|
|
15
|
-
:ssh_login_timeout => "10000", :ssh_user => "root", :ssh_password => "vagrant", :ssh_key => "",
|
|
16
|
-
:ssh_host_port => "7222", :ssh_guest_port => "22",
|
|
17
|
-
:sudo_cmd => "sh '%f'",
|
|
18
|
-
:shutdown_cmd => "shutdown -H",
|
|
19
|
-
:postinstall_files => [ "postinstall.sh"], :postinstall_timeout => "10000"
|
|
20
|
-
})
|
|
21
|
-
#'setkmap=us dodhcp=eth0 dhcphostname=%NAME% ar_source=http://%IP%:%PORT%/ autoruns=0 rootpass=vagrant',
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
#https://wiki.archlinux.org/index.php/Install_from_Existing_Linux
|
|
4
|
-
|
|
5
|
-
ARCH=x86_64
|
|
6
|
-
mkdir /tmp/archlinux
|
|
7
|
-
cd /tmp/archlinux
|
|
8
|
-
|
|
9
|
-
alias wget='wget --trust-server-names'
|
|
10
|
-
|
|
11
|
-
wget http://www.archlinux.org/packages/core/$ARCH/pacman/download/
|
|
12
|
-
wget http://www.archlinux.org/packages/core/any/pacman-mirrorlist/download/
|
|
13
|
-
|
|
14
|
-
wget http://www.archlinux.org/packages/core/$ARCH/libfetch/download/
|
|
15
|
-
wget http://www.archlinux.org/packages/core/$ARCH/libarchive/download/
|
|
16
|
-
wget http://www.archlinux.org/packages/core/$ARCH/bzip2/download/
|
|
17
|
-
wget http://www.archlinux.org/packages/core/$ARCH/openssl/download/
|
|
18
|
-
wget http://www.archlinux.org/packages/core/$ARCH/xz/download/
|
|
19
|
-
wget http://www.archlinux.org/packages/core/$ARCH/expat/download/
|
|
20
|
-
|
|
21
|
-
for f in *.tar.xz ; do unxz -v $f ; done
|
|
22
|
-
for f in *.tar ; do tar xvf $f ; done
|
|
23
|
-
for f in *.tar.gz ; do tar xzvf $f ; done
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export PATH=/tmp/archlinux/usr/bin:$PATH
|
|
27
|
-
export LD_LIBRARY_PATH=/tmp/archlinux/usr/lib:/tmp/archlinux/lib:$LD_LIBRARY_PATH
|
|
28
|
-
alias pacman="pacman --config /tmp/archlinux/etc/pacman.conf"
|
|
29
|
-
|
|
30
|
-
cd /
|
|
31
|
-
for f in /tmp/archlinux/pacman-*pkg.tar.gz ; do
|
|
32
|
-
tar xzf $f
|
|
33
|
-
done
|
|
34
|
-
|
|
35
|
-
#/etc/pacman.d/mirrorlist
|
|
36
|
-
#enable a mirror
|
|
37
|
-
|
|
38
|
-
#Partition the disk
|
|
39
|
-
#This assumes a predefined layout - customize to your own liking
|
|
40
|
-
|
|
41
|
-
sfdisk --force /dev/sda <<EOF
|
|
42
|
-
# partition table of /dev/sda
|
|
43
|
-
unit: sectors
|
|
44
|
-
|
|
45
|
-
/dev/sda1 : start= 2048, size= 16777216, Id=83
|
|
46
|
-
/dev/sda2 : start= 16779264, size= 3987456, Id=82
|
|
47
|
-
/dev/sda3 : start= 0, size= 0, Id= 0
|
|
48
|
-
/dev/sda4 : start= 0, size= 0, Id= 0
|
|
49
|
-
EOF
|
|
50
|
-
|
|
51
|
-
sleep 2
|
|
52
|
-
|
|
53
|
-
#Format the first disk
|
|
54
|
-
mkfs.ext3 /dev/sda1
|
|
55
|
-
|
|
56
|
-
#Format the swap and use it
|
|
57
|
-
mkswap /dev/sda2
|
|
58
|
-
swapon /dev/sda2
|
|
59
|
-
|
|
60
|
-
mkdir /newarch
|
|
61
|
-
mount /dev/sda1 /newarch
|
|
62
|
-
|
|
63
|
-
mkdir -p /newarch/var/lib/pacman
|
|
64
|
-
|
|
65
|
-
#setting pacman - mirror - Belgium
|
|
66
|
-
#Customize to your own liking
|
|
67
|
-
sed -i 's/^#\(.*kangaroot.*\)/\1/' /etc/pacman.d/mirrorlist
|
|
68
|
-
|
|
69
|
-
# https://wiki.archlinux.org/index.php/Mirrors#List_by_speed
|
|
70
|
-
# pacman -S reflector
|
|
71
|
-
# export LC_ALL=C
|
|
72
|
-
# reflector -c Belgium -l 8 -r -o /etc/pacman.d/mirrorlist
|
|
73
|
-
|
|
74
|
-
pacman -Sy -r /newarch
|
|
75
|
-
|
|
76
|
-
#pacman: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory
|
|
77
|
-
#require bzip2
|
|
78
|
-
pacman --noconfirm --cachedir /newarch/var/cache/pacman/pkg -S base -r /newarch
|
|
79
|
-
|
|
80
|
-
#Create the devices
|
|
81
|
-
cd /newarch/dev
|
|
82
|
-
rm -f console ; mknod -m 600 console c 5 1
|
|
83
|
-
rm -f null ; mknod -m 666 null c 1 3
|
|
84
|
-
rm -f zero ; mknod -m 666 zero c 1 5
|
|
85
|
-
|
|
86
|
-
#Copy the dns information (cp is aliased so we use the binary)
|
|
87
|
-
/bin/cp -f /etc/resolv.conf /newarch/etc/
|
|
88
|
-
|
|
89
|
-
#Mount the process architecture
|
|
90
|
-
mount -t proc proc /newarch/proc
|
|
91
|
-
mount -t sysfs sys /newarch/sys
|
|
92
|
-
mount -o bind /dev /newarch/dev
|
|
93
|
-
|
|
94
|
-
chroot /newarch pacman --noconfirm -S kernel26
|
|
95
|
-
|
|
96
|
-
#set the mirror list within the machine
|
|
97
|
-
chroot /newarch sed -i 's/^#\(.*kangaroot.*\)/\1/' /etc/pacman.d/mirrorlist
|
|
98
|
-
#/etc/fstab
|
|
99
|
-
#We need a partition!
|
|
100
|
-
|
|
101
|
-
echo "echo '/dev/sda1 / ext4 defaults,noatime 0 0' >> /etc/fstab"|chroot /newarch sh -
|
|
102
|
-
echo "echo '/dev/sda2 swap swap defaults 0 0'>> /etc/fstab"|chroot /newarch sh -
|
|
103
|
-
|
|
104
|
-
#/etc/rc.conf
|
|
105
|
-
|
|
106
|
-
#hostname
|
|
107
|
-
|
|
108
|
-
chroot /newarch sed -i 's/^HOSTNAME=\(.*\)/HOSTNAME=vagrant-arch/' /etc/rc.conf
|
|
109
|
-
#gateway
|
|
110
|
-
|
|
111
|
-
#/etc/hosts
|
|
112
|
-
#/etc/mkinitcpio.conf
|
|
113
|
-
#/etc/local.gen
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
#grub
|
|
117
|
-
echo "grep -v rootfs /proc/mounts > /etc/mtab" |chroot /newarch sh -
|
|
118
|
-
chroot /newarch grub-install /dev/sda
|
|
119
|
-
echo "cp -a /usr/lib/grub/i386-pc/* /boot/grub" | chroot /newarch sh -
|
|
120
|
-
|
|
121
|
-
#/boot/grub/menu.lst
|
|
122
|
-
|
|
123
|
-
echo "sed -i 's:^kernel\(.*\)$:kernel /boot/vmlinuz26 root=/dev/sda1 ro:' /boot/grub/menu.lst" | chroot /newarch sh -
|
|
124
|
-
echo "sed -i 's:^initrd\(.*\)$:initrd /boot/kernel26.img:' /boot/grub/menu.lst" | chroot /newarch sh -
|
|
125
|
-
|
|
126
|
-
#Configure ssh
|
|
127
|
-
chroot /newarch pacman --noconfirm -S openssh
|
|
128
|
-
|
|
129
|
-
#Still errors
|
|
130
|
-
echo "sed -i 's:^DAEMONS\(.*\))$:DAEMONS\1 sshd):' /etc/rc.conf" | chroot /newarch sh -
|
|
131
|
-
echo "echo 'sshd:ALL' > /etc/hosts.allow" | chroot /newarch sh -
|
|
132
|
-
echo "echo 'ALL:ALL' > /etc/hosts.deny" | chroot /newarch sh -
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
#Configure Sudo
|
|
138
|
-
chroot /newarch pacman --noconfirm -S sudo
|
|
139
|
-
echo "echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers" | chroot /newarch sh -
|
|
140
|
-
|
|
141
|
-
#create vagrant user / password vagrant
|
|
142
|
-
chroot /newarch useradd -m -r vagrant -p '$1$MPmczGP9$1SeNO4bw5YgiEJuo/ZkWq1'
|
|
143
|
-
|
|
144
|
-
#get some ruby running
|
|
145
|
-
chroot /newarch pacman --noconfirm -S git curl gcc make
|
|
146
|
-
echo "bash < <( curl -L http://bit.ly/rvm-install-system-wide )"| chroot /newarch /bin/bash -
|
|
147
|
-
echo "/usr/local/bin/rvm install ruby-1.8.7 "| chroot /newarch sh -
|
|
148
|
-
echo "/usr/local/bin/rvm use ruby-1.8.7 --default "| chroot /newarch sh -
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
#Installing chef & Puppet
|
|
152
|
-
echo ". /usr/local/lib/rvm ; gem install chef --no-ri --no-rdoc"| chroot /newarch sh -
|
|
153
|
-
echo ". /usr/local/lib/rvm ; gem install puppet --no-ri --no-rdoc"| chroot /newarch sh -
|
|
154
|
-
|
|
155
|
-
#Installing vagrant keys
|
|
156
|
-
echo "creating vagrant ssh keys"
|
|
157
|
-
chroot /newarch mkdir /home/vagrant/.ssh
|
|
158
|
-
chroot /newarch chmod 700 /home/vagrant/.ssh
|
|
159
|
-
chroot /newarch cd /home/vagrant/.ssh
|
|
160
|
-
chroot /newarch wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
|
|
161
|
-
chroot /newarch chmod 600 /home/vagrant/.ssh/authorized_keys
|
|
162
|
-
chroot /newarch chown -R vagrant /home/vagrant/.ssh
|
|
163
|
-
|
|
164
|
-
echo "adding rvm to global bash rc"
|
|
165
|
-
echo "echo '. /usr/local/lib/rvm' >> /etc/bash/bash.rc" | chroot /newarch sh -
|
|
166
|
-
|
|
167
|
-
#https://wiki.archlinux.org/index.php/VirtualBox
|
|
168
|
-
#kernel pacman -S kernel26-headers
|
|
169
|
-
chroot /newarch pacman --noconfirm -S kernel26-headers
|
|
170
|
-
/bin/cp -f /root/.vbox_version /newarch/home/vagrant/.vbox_version
|
|
171
|
-
VBOX_VERSION=$(cat /root/.vbox_version)
|
|
172
|
-
|
|
173
|
-
#Installing the virtualbox guest additions
|
|
174
|
-
cat <<EOF | chroot /newarch /bin/bash -
|
|
175
|
-
cd /tmp
|
|
176
|
-
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
|
|
177
|
-
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
|
|
178
|
-
sh /mnt/VBoxLinuxAdditions.run
|
|
179
|
-
umount /mnt
|
|
180
|
-
rm VBoxGuestAdditions_$VBOX_VERSION.iso
|
|
181
|
-
EOF
|
|
182
|
-
|
|
183
|
-
echo "sed -i 's:^DAEMONS\(.*\))$:DAEMONS\1 rc.vboxadd):' /etc/rc.conf" | chroot /newarch sh -
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
cd /
|
|
187
|
-
umount /newarch/{proc,sys,dev}
|
|
188
|
-
umount /newarch
|
|
189
|
-
|
|
190
|
-
#reboot
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
Veewee::Session.declare({
|
|
2
|
-
:cpu_count => '1', :memory_size=> '256',
|
|
3
|
-
:disk_size => '10140', :disk_format => 'VDI',:hostiocache => 'off',
|
|
4
|
-
:os_type_id => 'ArchLinux',
|
|
5
|
-
:iso_file => "systemrescuecd-x86-2.0.0.iso",
|
|
6
|
-
:iso_src => "http://downloads.sourceforge.net/project/systemrescuecd/sysresccd-x86/2.0.0/systemrescuecd-x86-2.0.0.iso?r=http%3A%2F%2Fwww.sysresccd.org%2FDownload&ts=1297107227&use_mirror=ignum",
|
|
7
|
-
:iso_md5 => "51012e0bb943cff6367e5cea3a61cdbe",
|
|
8
|
-
:iso_download_timeout => "1000",
|
|
9
|
-
:boot_wait => "10", :boot_cmd_sequence => [
|
|
10
|
-
'<Tab> ',
|
|
11
|
-
'setkmap=us dodhcp=eth0 dhcphostname=%NAME% ar_source=http://%IP%:%PORT%/ autoruns=0 rootpass=vagrant',
|
|
12
|
-
'<Enter>'
|
|
13
|
-
],
|
|
14
|
-
:kickstart_port => "7122", :kickstart_timeout => "10000", :kickstart_file => "autorun0",
|
|
15
|
-
:ssh_login_timeout => "10000", :ssh_user => "root", :ssh_password => "vagrant", :ssh_key => "",
|
|
16
|
-
:ssh_host_port => "7222", :ssh_guest_port => "22",
|
|
17
|
-
:sudo_cmd => "sh '%f'",
|
|
18
|
-
:shutdown_cmd => "shutdown -H",
|
|
19
|
-
:postinstall_files => [ "postinstall.sh"], :postinstall_timeout => "10000"
|
|
20
|
-
})
|
|
21
|
-
#'setkmap=us dodhcp=eth0 dhcphostname=%NAME% ar_source=http://%IP%:%PORT%/ autoruns=0 rootpass=vagrant',
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
#https://wiki.archlinux.org/index.php/Install_from_Existing_Linux
|
|
4
|
-
|
|
5
|
-
#ARCH=x86_64
|
|
6
|
-
ARCH=i686
|
|
7
|
-
mkdir /tmp/archlinux
|
|
8
|
-
cd /tmp/archlinux
|
|
9
|
-
|
|
10
|
-
alias wget='wget --trust-server-names'
|
|
11
|
-
|
|
12
|
-
wget http://www.archlinux.org/packages/core/$ARCH/pacman/download/
|
|
13
|
-
wget http://www.archlinux.org/packages/core/any/pacman-mirrorlist/download/
|
|
14
|
-
|
|
15
|
-
wget http://www.archlinux.org/packages/core/$ARCH/libfetch/download/
|
|
16
|
-
wget http://www.archlinux.org/packages/core/$ARCH/libarchive/download/
|
|
17
|
-
wget http://www.archlinux.org/packages/core/$ARCH/bzip2/download/
|
|
18
|
-
wget http://www.archlinux.org/packages/core/$ARCH/openssl/download/
|
|
19
|
-
wget http://www.archlinux.org/packages/core/$ARCH/xz/download/
|
|
20
|
-
wget http://www.archlinux.org/packages/core/$ARCH/expat/download/
|
|
21
|
-
|
|
22
|
-
for f in *.tar.xz ; do unxz -v $f ; done
|
|
23
|
-
for f in *.tar ; do tar xvf $f ; done
|
|
24
|
-
for f in *.tar.gz ; do tar xzvf $f ; done
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export PATH=/tmp/archlinux/usr/bin:$PATH
|
|
28
|
-
export LD_LIBRARY_PATH=/tmp/archlinux/usr/lib:/tmp/archlinux/lib:$LD_LIBRARY_PATH
|
|
29
|
-
alias pacman="pacman --config /tmp/archlinux/etc/pacman.conf"
|
|
30
|
-
|
|
31
|
-
cd /
|
|
32
|
-
for f in /tmp/archlinux/pacman-*pkg.tar.gz ; do
|
|
33
|
-
tar xzf $f
|
|
34
|
-
done
|
|
35
|
-
|
|
36
|
-
#/etc/pacman.d/mirrorlist
|
|
37
|
-
#enable a mirror
|
|
38
|
-
|
|
39
|
-
#Partition the disk
|
|
40
|
-
#This assumes a predefined layout - customize to your own liking
|
|
41
|
-
|
|
42
|
-
sfdisk --force /dev/sda <<EOF
|
|
43
|
-
# partition table of /dev/sda
|
|
44
|
-
unit: sectors
|
|
45
|
-
|
|
46
|
-
/dev/sda1 : start= 2048, size= 16777216, Id=83
|
|
47
|
-
/dev/sda2 : start= 16779264, size= 3987456, Id=82
|
|
48
|
-
/dev/sda3 : start= 0, size= 0, Id= 0
|
|
49
|
-
/dev/sda4 : start= 0, size= 0, Id= 0
|
|
50
|
-
EOF
|
|
51
|
-
|
|
52
|
-
sleep 2
|
|
53
|
-
|
|
54
|
-
#Format the first disk
|
|
55
|
-
mkfs.ext3 /dev/sda1
|
|
56
|
-
|
|
57
|
-
#Format the swap and use it
|
|
58
|
-
mkswap /dev/sda2
|
|
59
|
-
swapon /dev/sda2
|
|
60
|
-
|
|
61
|
-
mkdir /newarch
|
|
62
|
-
mount /dev/sda1 /newarch
|
|
63
|
-
|
|
64
|
-
mkdir -p /newarch/var/lib/pacman
|
|
65
|
-
|
|
66
|
-
#setting pacman - mirror - Belgium
|
|
67
|
-
#Customize to your own liking
|
|
68
|
-
sed -i 's/^#\(.*kangaroot.*\)/\1/' /etc/pacman.d/mirrorlist
|
|
69
|
-
|
|
70
|
-
# https://wiki.archlinux.org/index.php/Mirrors#List_by_speed
|
|
71
|
-
# pacman -S reflector
|
|
72
|
-
# export LC_ALL=C
|
|
73
|
-
# reflector -c Belgium -l 8 -r -o /etc/pacman.d/mirrorlist
|
|
74
|
-
|
|
75
|
-
pacman -Sy -r /newarch
|
|
76
|
-
|
|
77
|
-
#pacman: error while loading shared libraries: libbz2.so.1.0: cannot open shared object file: No such file or directory
|
|
78
|
-
#require bzip2
|
|
79
|
-
pacman --noconfirm --cachedir /newarch/var/cache/pacman/pkg -S base -r /newarch
|
|
80
|
-
|
|
81
|
-
#Create the devices
|
|
82
|
-
cd /newarch/dev
|
|
83
|
-
rm -f console ; mknod -m 600 console c 5 1
|
|
84
|
-
rm -f null ; mknod -m 666 null c 1 3
|
|
85
|
-
rm -f zero ; mknod -m 666 zero c 1 5
|
|
86
|
-
|
|
87
|
-
#Copy the dns information (cp is aliased so we use the binary)
|
|
88
|
-
/bin/cp -f /etc/resolv.conf /newarch/etc/
|
|
89
|
-
|
|
90
|
-
#Mount the process architecture
|
|
91
|
-
mount -t proc proc /newarch/proc
|
|
92
|
-
mount -t sysfs sys /newarch/sys
|
|
93
|
-
mount -o bind /dev /newarch/dev
|
|
94
|
-
|
|
95
|
-
chroot /newarch pacman --noconfirm -S kernel26
|
|
96
|
-
|
|
97
|
-
#set the mirror list within the machine
|
|
98
|
-
chroot /newarch sed -i 's/^#\(.*kangaroot.*\)/\1/' /etc/pacman.d/mirrorlist
|
|
99
|
-
#/etc/fstab
|
|
100
|
-
#We need a partition!
|
|
101
|
-
|
|
102
|
-
echo "echo '/dev/sda1 / ext4 defaults,noatime 0 0' >> /etc/fstab"|chroot /newarch sh -
|
|
103
|
-
echo "echo '/dev/sda2 swap swap defaults 0 0'>> /etc/fstab"|chroot /newarch sh -
|
|
104
|
-
|
|
105
|
-
#/etc/rc.conf
|
|
106
|
-
|
|
107
|
-
#hostname
|
|
108
|
-
|
|
109
|
-
chroot /newarch sed -i 's/^HOSTNAME=\(.*\)/HOSTNAME=vagrant-arch/' /etc/rc.conf
|
|
110
|
-
#gateway
|
|
111
|
-
|
|
112
|
-
#/etc/hosts
|
|
113
|
-
#/etc/mkinitcpio.conf
|
|
114
|
-
#/etc/local.gen
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
#grub
|
|
118
|
-
echo "grep -v rootfs /proc/mounts > /etc/mtab" |chroot /newarch sh -
|
|
119
|
-
chroot /newarch grub-install /dev/sda
|
|
120
|
-
echo "cp -a /usr/lib/grub/i386-pc/* /boot/grub" | chroot /newarch sh -
|
|
121
|
-
|
|
122
|
-
#/boot/grub/menu.lst
|
|
123
|
-
|
|
124
|
-
echo "sed -i 's:^kernel\(.*\)$:kernel /boot/vmlinuz26 root=/dev/sda1 ro:' /boot/grub/menu.lst" | chroot /newarch sh -
|
|
125
|
-
echo "sed -i 's:^initrd\(.*\)$:initrd /boot/kernel26.img:' /boot/grub/menu.lst" | chroot /newarch sh -
|
|
126
|
-
|
|
127
|
-
#Configure ssh
|
|
128
|
-
chroot /newarch pacman --noconfirm -S openssh
|
|
129
|
-
|
|
130
|
-
#Still errors
|
|
131
|
-
echo "sed -i 's:^DAEMONS\(.*\))$:DAEMONS\1 sshd):' /etc/rc.conf" | chroot /newarch sh -
|
|
132
|
-
echo "echo 'sshd:ALL' > /etc/hosts.allow" | chroot /newarch sh -
|
|
133
|
-
echo "echo 'ALL:ALL' > /etc/hosts.deny" | chroot /newarch sh -
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
#Configure Sudo
|
|
139
|
-
chroot /newarch pacman --noconfirm -S sudo
|
|
140
|
-
echo "echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers" | chroot /newarch sh -
|
|
141
|
-
|
|
142
|
-
#create vagrant user / password vagrant
|
|
143
|
-
chroot /newarch useradd -m -r vagrant -p '$1$MPmczGP9$1SeNO4bw5YgiEJuo/ZkWq1'
|
|
144
|
-
|
|
145
|
-
#get some ruby running
|
|
146
|
-
chroot /newarch pacman --noconfirm -S git curl gcc make
|
|
147
|
-
echo "bash < <( curl -L http://bit.ly/rvm-install-system-wide )"| chroot /newarch /bin/bash -
|
|
148
|
-
echo "/usr/local/bin/rvm install ruby-1.8.7 "| chroot /newarch sh -
|
|
149
|
-
echo "/usr/local/bin/rvm use ruby-1.8.7 --default "| chroot /newarch sh -
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
#Installing chef & Puppet
|
|
153
|
-
echo ". /usr/local/lib/rvm ; gem install chef --no-ri --no-rdoc"| chroot /newarch sh -
|
|
154
|
-
echo ". /usr/local/lib/rvm ; gem install puppet --no-ri --no-rdoc"| chroot /newarch sh -
|
|
155
|
-
|
|
156
|
-
#Installing vagrant keys
|
|
157
|
-
echo "creating vagrant ssh keys"
|
|
158
|
-
chroot /newarch mkdir /home/vagrant/.ssh
|
|
159
|
-
chroot /newarch chmod 700 /home/vagrant/.ssh
|
|
160
|
-
chroot /newarch cd /home/vagrant/.ssh
|
|
161
|
-
chroot /newarch wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
|
|
162
|
-
chroot /newarch chmod 600 /home/vagrant/.ssh/authorized_keys
|
|
163
|
-
chroot /newarch chown -R vagrant /home/vagrant/.ssh
|
|
164
|
-
|
|
165
|
-
echo "adding rvm to global bash rc"
|
|
166
|
-
echo "echo '. /usr/local/lib/rvm' >> /etc/bash/bash.rc" | chroot /newarch sh -
|
|
167
|
-
|
|
168
|
-
#https://wiki.archlinux.org/index.php/VirtualBox
|
|
169
|
-
#kernel pacman -S kernel26-headers
|
|
170
|
-
chroot /newarch pacman --noconfirm -S kernel26-headers
|
|
171
|
-
/bin/cp -f /root/.vbox_version /newarch/home/vagrant/.vbox_version
|
|
172
|
-
VBOX_VERSION=$(cat /root/.vbox_version)
|
|
173
|
-
|
|
174
|
-
#Installing the virtualbox guest additions
|
|
175
|
-
cat <<EOF | chroot /newarch /bin/bash -
|
|
176
|
-
cd /tmp
|
|
177
|
-
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
|
|
178
|
-
mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
|
|
179
|
-
sh /mnt/VBoxLinuxAdditions.run
|
|
180
|
-
umount /mnt
|
|
181
|
-
rm VBoxGuestAdditions_$VBOX_VERSION.iso
|
|
182
|
-
EOF
|
|
183
|
-
|
|
184
|
-
echo "sed -i 's:^DAEMONS\(.*\))$:DAEMONS\1 rc.vboxadd):' /etc/rc.conf" | chroot /newarch sh -
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
cd /
|
|
188
|
-
umount /newarch/{proc,sys,dev}
|
|
189
|
-
umount /newarch
|
|
190
|
-
|
|
191
|
-
reboot
|