Permalink
Browse files

got Debian 6.0 and Archlinux working

  • Loading branch information...
jedi4ever committed Feb 9, 2011
1 parent d011a15 commit 825e07d085752c2718d99acd7a1aa59f546dcd78
View
@@ -389,7 +389,7 @@ def self.destroy_vm(boxname)
location=boxname+"."+@definition[:disk_format].downcase
found=false
VirtualBox::HardDrive.all.each do |d|
- if !d.location.match(/#{location}/).nil?
+ if d.location.match(/#{location}/)
if File.exists?(d.location)
command="#{@vboxcmd} closemedium disk '#{d.location}' --delete"
@@ -511,7 +511,7 @@ def self.create_disk(boxname)
place=results.gets.chop
results.close
- command ="#{@vboxcmd} createhd --filename '#{place}/#{boxname}/#{boxname}.#{@definition[:disk_format]}' --size '#{@definition[:disk_size].to_i}' --format #{@definition[:disk_format]} > /dev/null"
+ command ="#{@vboxcmd} createhd --filename '#{place}/#{boxname}/#{boxname}.#{@definition[:disk_format].downcase}' --size '#{@definition[:disk_size].to_i}' --format #{@definition[:disk_format].downcase} > /dev/null"
puts "#{command}"
Veewee::Shell.execute("#{command}")
@@ -706,7 +706,7 @@ def self.transaction(boxname,step_name,checksums,&block)
sleep 2
#TODO:Restore snapshot!!!
vm.start
- sleep 2
+ sleep 4
puts "Starting machine"
end
@@ -78,6 +78,7 @@ def self.rollback_snapshot(vmname,snapname)
end
if (delete_flag) then
remove_snapshot_vmachine(vmname,name)
+ sleep 1
end
}
@@ -3,4 +3,4 @@
echo "We are installing archlinux through the livecd of System Rescue"
echo "Please wait while we do the grunt work ."
-echo "Occassinally this hangs because of network issues to the archlinux mirrors"
+echo "Occasionally this hangs because of network issues to the archlinux mirrors"
@@ -131,6 +131,9 @@ echo "sed -i 's:^DAEMONS\(.*\))$:DAEMONS\1 sshd):' /etc/rc.conf" | chroot /newar
echo "echo 'sshd:ALL' > /etc/hosts.allow" | chroot /newarch sh -
echo "echo 'ALL:ALL' > /etc/hosts.deny" | chroot /newarch sh -
+
+
+
#Configure Sudo
chroot /newarch pacman --noconfirm -S sudo
echo "echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers" | chroot /newarch sh -
@@ -164,15 +167,18 @@ echo "echo '. /usr/local/lib/rvm' >> /etc/bash/bash.rc" | chroot /newarch sh -
#https://wiki.archlinux.org/index.php/VirtualBox
#kernel pacman -S kernel26-headers
chroot /newarch pacman --noconfirm -S kernel26-headers
-#/bin/cp -f /root/.vbox_version /newarch/root/.vbox_version
-#VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
+/bin/cp -f /root/.vbox_version /newarch/home/vagrant/.vbox_version
+VBOX_VERSION=$(cat /root/.vbox_version)
+
##INstalling the virtualbox guest additions
-#cd /tmp
-#wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
-#mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
-#sh /mnt/VBoxLinuxAdditions.run
-#chroot /newarch umount /mnt
-#rm VBoxGuestAdditions_$VBOX_VERSION.iso
+cat <EOF | chroot /newarch /bin/bash -
+cd /tmp
+wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
+mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
+sh /mnt/VBoxLinuxAdditions.run
+umount /mnt
+rm VBoxGuestAdditions_$VBOX_VERSION.iso
+EOF
echo "sed -i 's:^DAEMONS\(.*\))$:DAEMONS\1 rc.vboxadd):' /etc/rc.conf" | chroot /newarch sh -
@@ -4,9 +4,9 @@
:disk_size => '10140',
:disk_format => 'VDI',
:disk_size => '10240' ,
- :os_type_id => 'Debian',
- :iso_file => "debian-508-amd64-netinst.iso",
- :iso_src => "http://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-508-amd64-netinst.iso",
+ :os_type_id => 'Debian_64',
+ :iso_file => "debian-6.0.0-amd64-netinst.iso",
+ :iso_src => "http://ftp.acc.umu.se/debian-cd/current/amd64/iso-cd/debian-6.0.0-amd64-netinst.iso",
:iso_md5 => "98111f815d3bea761d303a14d8df8887",
:iso_download_timeout => "1000",
:boot_wait => "10",:boot_cmd_sequence => [
@@ -33,7 +33,7 @@
:ssh_user => "vagrant",
:ssh_password => "vagrant",
:ssh_key => "",
- :ssh_host_port => "2222",
+ :ssh_host_port => "7222",
:ssh_guest_port => "22",
:sudo_cmd => "echo '%p'|sudo -S sh '%f'",
:shutdown_cmd => "shutdown -H",
@@ -0,0 +1,49 @@
+#http://adrianbravo.tumblr.com/post/644860401
+
+#Updating the box
+apt-get -y update
+apt-get -y install linux-headers-$(uname -r) build-essential
+apt-get -y install zlib1g-dev libssl-dev libreadline5-dev
+apt-get clean
+
+#Setting up sudo
+cp /etc/sudoers /etc/sudoers.orig
+sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
+
+#Installing ruby
+wget http://rubyforge.org/frs/download.php/71096/ruby-enterprise-1.8.7-2010.02.tar.gz
+tar xzvf ruby-enterprise-1.8.7-2010.02.tar.gz
+./ruby-enterprise-1.8.7-2010.02/installer -a /opt/ruby --no-dev-docs --dont-install-useful-gems
+echo 'PATH=$PATH:/opt/ruby/bin/'> /etc/profile.d/rubyenterprise.sh
+rm -rf ./ruby-enterprise-1.8.7-2010.02/
+rm ruby-enterprise-1.8.7-2010.02.tar.gz
+
+#Installing chef & Puppet
+/opt/ruby/bin/gem install chef --no-ri --no-rdoc
+/opt/ruby/bin/gem install puppet --no-ri --no-rdoc
+
+#Installing vagrant keys
+mkdir /home/vagrant/.ssh
+chmod 700 /home/vagrant/.ssh
+cd /home/vagrant/.ssh
+wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys
+chown -R vagrant /home/vagrant/.ssh
+
+#the netboot install the virtualbox stuff so we have to remove it
+apt-get -y remove virtualbox-ose-guest-dkms
+apt-get -y remove virtualbox-ose-guest-utils
+
+#INstalling the virtualbox guest additions
+VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
+#INstalling the virtualbox guest additions
+cd /tmp
+wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
+mount -o loop VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
+yes|sh /mnt/VBoxLinuxAdditions.run
+umount /mnt
+
+apt-get -y remove linux-headers-$(uname -r) build-essential
+apt-get -y autoremove
+
+rm VBoxGuestAdditions_$VBOX_VERSION.iso
+exit
@@ -1,4 +1,4 @@
-#### Contents of the preconfiguration file (for lenny)
+#### Contents of the preconfiguration file (for squeeze)
### Localization
# Locale sets language and country.
d-i debian-installer/locale string en_US
@@ -96,7 +96,7 @@ d-i clock-setup/ntp boolean true
# be given in traditional non-devfs format.
# Note: A disk must be specified, unless the system has only one disk.
# For example, to use the first SCSI/SATA hard disk:
-#d-i partman-auto/disk string /dev/sda
+d-i partman-auto/disk string /dev/sda
# In addition, you'll need to specify the method to use.
# The presently available methods are: "regular", "lvm" and "crypto"
d-i partman-auto/method string lvm
@@ -107,14 +107,21 @@ d-i partman-auto/method string lvm
d-i partman-lvm/device_remove_lvm boolean true
# The same applies to pre-existing software RAID array:
d-i partman-md/device_remove_md boolean true
+
# And the same goes for the confirmation to write the lvm partitions.
d-i partman-lvm/confirm boolean true
+d-i partman-lvm/confirm_nooverwrite boolean true
+
+
+d-i partman/choose_partition select finish
+d-i partman-auto-lvm/guided_size string max
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home: separate /home partition
# - multi: separate /home, /usr, /var, and /tmp partitions
d-i partman-auto/choose_recipe select atomic
+d-i partman/default_filesystem string ext3
# Or provide a recipe of your own...
# The recipe format is documented in the file devel/partman-auto-recipe.txt.
@@ -142,11 +149,15 @@ d-i partman-auto/choose_recipe select atomic
# method{ swap } format{ } \
# .
+#The preseed line that "selects finish" needs to be in a certain order in your preseed, the example-preseed does not follow this.
+#http://ubuntuforums.org/archive/index.php/t-1504045.html
+
# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman/confirm_write_new_label boolean true
-d-i partman/choose_partition select finish
d-i partman/confirm boolean true
+d-i partman/confirm_nooverwrite boolean true
+
### Base system installation
# Select the initramfs generator used to generate the initrd for 2.6 kernels.
@@ -198,16 +209,6 @@ d-i passwd/user-default-groups string audio cdrom video admin
#d-i apt-setup/security_host string security.debian.org
#d-i apt-setup/volatile_host string volatile.debian.org
-# Additional repositories, local[0-9] available
-d-i apt-setup/local0/repository string \
- http://apt.opscode.com lenny main
-d-i apt-setup/local0/comment string Chef
-# Enable deb-src lines
-d-i apt-setup/local0/source boolean true
-# URL to the public key of the local repository; you must provide a key or
-# apt will complain about the unauthenticated repository and so the
-# sources.list line will be left commented out
-d-i apt-setup/local0/key string http://apt.opscode.com/packages@opscode.com.gpg.key
# By default the installer requires that repositories be authenticated
# using a known gpg key. This setting can be used to disable that
@@ -221,7 +222,7 @@ tasksel tasksel/first multiselect standard
#tasksel tasksel/desktop multiselect kde, xfce
# Individual additional packages to install
-d-i pkgsel/include string openssh-server ntp acpid chef sudo bzip2 puppet
+d-i pkgsel/include string openssh-server ntp acpid sudo bzip2
# Whether to upgrade packages after debootstrap.
# Allowed values: none, safe-upgrade, full-upgrade
@@ -309,8 +310,3 @@ d-i finish-install/reboot_in_progress note
# still a usable /target directory. You can chroot to /target and use it
# directly, or use the apt-install and in-target commands to easily install
# packages and run commands in the target system.
-#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh
-d-i preseed/late_command string apt-install wget; mount -o loop /dev /target/dev; mount -o loop /proc /target/proc; chroot /target wget --no-check-certificate -qO/tmp/latecommand.sh https://github.com/Babar/veewee/raw/master/templates/debian-lenny-amd64/latecommand.sh; chroot /target sh /tmp/latecommand.sh
-
-# Prevent chef from asking for a server
-chef chef/chef_server_url string
@@ -1,41 +0,0 @@
-#http://adrianbravo.tumblr.com/post/644860401
-
-exec > /root/install.log
-exec 2>&1
-
-#Updating the box
-apt-get -y update
-#apt-get -y dist-upgrade
-apt-get clean
-
-#Setting up sudo
-echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
-
-#Installing vagrant keys
-mkdir /home/vagrant/.ssh
-chmod 700 /home/vagrant/.ssh
-cd /home/vagrant/.ssh
-wget --no-check-certificate 'http://github.com/mitchellh/vagrant/raw/master/keys/vagrant.pub' -O authorized_keys
-chown -R vagrant /home/vagrant/.ssh
-
-#Installing the virtualbox guest additions
-# This will not work... We need to figure out some way to get the current VBox version
-apt-get -y install linux-headers-$(uname -r) build-essential \
- zlib1g-dev libssl-dev libreadline5-dev
-VAGRANT_VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
-VBOX_VERSION=${VAGRANT_VBOX_VERSION:-4.0.2}
-VBOX_ISO=/tmp/vboxga.iso
-if [ ! -f $VBOX_ISO ]; then
- wget -qO$VBOX_ISO http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
-fi
-mount -o loop $VBOX_ISO /mnt
-sh /mnt/VBoxLinuxAdditions.run
-umount /mnt
-
-apt-get -y remove linux-headers-$(uname -r) build-essential \
- zlib1g-dev libssl-dev libreadline5-dev
-
-rm -f $VBOX_ISO $0
-
-apt-get -y autoremove
-exit
@@ -1,24 +0,0 @@
-#http://adrianbravo.tumblr.com/post/644860401
-
-#Updating the box
-apt-get -y update
-apt-get -y install linux-headers-$(uname -r) build-essential \
- zlib1g-dev libssl-dev libreadline5-dev
-apt-get clean
-
-#Installing the virtualbox guest additions
-VBOX_VERSION=$(cat /home/vagrant/.vbox_version)
-VBOX_ISO=/tmp/vboxga.iso
-if [ ! -f $VBOX_ISO ]; then
- wget -qO$VBOX_ISO http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
-fi
-mount -o loop $VBOX_ISO /mnt
-sh /mnt/VBoxLinuxAdditions.run
-umount /mnt
-
-apt-get -y remove linux-headers-$(uname -r) build-essential \
- zlib1g-dev libssl-dev libreadline5-dev
-apt-get -y autoremove
-
-rm -f $VBOX_ISO $0
-exit

0 comments on commit 825e07d

Please sign in to comment.