commit ae2998af1c2eab6ca258d098f5cd2c9851c66f47
Author: Jochen Schalanda <jochen.schalanda@detasad.com.sa>
Date:   Sun May 23 12:01:00 2010 +0000

    Fixes #265 - improved preseed template and more complicated partitioning scheme for Debian-based distributions.

diff --git a/app/views/unattended/preseed.rhtml b/app/views/unattended/preseed.rhtml
index 7bae41c78..e3a29778e 100644
--- a/app/views/unattended/preseed.rhtml
+++ b/app/views/unattended/preseed.rhtml
@@ -1,38 +1,66 @@
+# Locale, country and keyboard settings
 d-i debian-installer/locale string en_US
-d-i console-setup/layoutcode string en_US
-d-i console-tools/archs select at
-d-i console-keymaps-at/keymap select American English
-d-i debian-installer/keymap string us
-d-i netcfg/choose_interface select eth0
-d-i clock-setup/utc boolean true
-d-i netcfg/dhcp_timeout string 60
+d-i console-setup/ask_detect boolean false
+d-i console-setup/modelcode string pc105
+d-i console-setup/variant USA
+d-i console-setup/layout USA
+d-i console-setup/layoutcode string us
+
+# Network configuration
 d-i netcfg/choose_interface select auto
 d-i netcfg/get_hostname string <%= @host.name %>
 d-i netcfg/get_domain string <%= @host.domain.name %>
-d-i netcfg/dhcp_options select Retry network autoconfiguration
-d-i mirror/codename string <%= @host.operatingsystem.release_name %>
-d-i mirror/country string enter information manually
-d-i mirror/http/countries select enter information manually
-d-i mirror/http/directory string <%= @preseed_path %>
+d-i netcfg/wireless_wep string
+
+d-i hw-detect/load_firmware boolean true
+
+# Mirror settings
+d-i mirror/country string manual
 d-i mirror/http/hostname string <%= @preseed_server %>
+d-i mirror/http/directory string <%= @preseed_path %>
 d-i mirror/http/proxy string
+d-i mirror/codename string <%= @host.operatingsystem.release_name %>
+d-i mirror/suite string <%= @host.operatingsystem.release_name %>
+d-i mirror/udeb/suite string <%= @host.operatingsystem.release_name %>
+
+# Time settings
+d-i clock-setup/utc boolean true
+d-i time/zone string UTC
+
+# NTP
+d-i clock-setup/ntp boolean true
+d-i clock-setup/ntp-server string ntp
+
+# Set alignment for automatic partitioning
+# Choices: cylinder, minimal, optimal
+#d-i partman/alignment select cylinder
 
 <%= @host.diskLayout %>
 
-d-i clock-setup/utc boolean false
-d-i time/zone string US/Central
-d-i apt-setup/security_host string
+# Install different kernel
+#d-i base-installer/kernel/image string linux-server
 
+# User settings
 d-i passwd/root-password-crypted password <%= root_pass %>
 user-setup-udeb passwd/root-login boolean true
 d-i passwd passwd/make-user boolean false
 user-setup-udeb passwd/make-user boolean false
 
+# Install minimal task set (see tasksel --task-packages minimal)
+tasksel tasksel/first multiselect minimal
+
+# Install some base packages
+d-i pkgsel/include string puppet lsb-release openssh-server
+d-i pkgsel/update-policy select unattended-upgrades
+
+popularity-contest popularity-contest/participate boolean false
+
+# Boot loader settings
+#grub-pc grub-pc/hidden_timeout boolean false
+#grub-pc grub-pc/timeout string 10
 d-i grub-installer/only_debian boolean true
 d-i grub-installer/with_other_os boolean true
-tasksel tasksel/first multiselect standard
-d-i pkgsel/include string puppet lsb-release openssh-server
+
 d-i finish-install/reboot_in_progress note
 
-popularity-contest popularity-contest/participate boolean false
 d-i preseed/late_command string wget <%= foreman_url("preseed_finish") %> -O /target/tmp/finish.sh && in-target chmod +x /tmp/finish.sh && in-target /tmp/finish.sh
diff --git a/app/views/unattended/preseed_finish.rhtml b/app/views/unattended/preseed_finish.rhtml
index a34e6c4fc..2f22f8595 100644
--- a/app/views/unattended/preseed_finish.rhtml
+++ b/app/views/unattended/preseed_finish.rhtml
@@ -1,6 +1,7 @@
 cat > /etc/puppet/puppet.conf << EOF
 <%= snippets "puppet.conf" -%>
 EOF
+/bin/sed -i 's/^START=no/START=yes/' /etc/default/puppet
 /bin/touch /etc/puppet/namespaceauth.conf 
-/usr/sbin/puppetd --config /etc/puppet/puppet.conf -o --tags no_such_tag --server <%= @host.puppetmaster %>  --no-daemonize
-wget -q -O /dev/null --no-check-certificate <%= foreman_url %>
+/usr/sbin/puppetd --config /etc/puppet/puppet.conf --onetime --tags no_such_tag --server <%= @host.puppetmaster %> --no-daemonize
+/usr/bin/wget --quiet --output-document=/dev/null --no-check-certificate <%= foreman_url %>
diff --git a/db/migrate/20100523114430_add_ubuntu_custom_lvm_ptable.rb b/db/migrate/20100523114430_add_ubuntu_custom_lvm_ptable.rb
new file mode 100644
index 000000000..786219cc3
--- /dev/null
+++ b/db/migrate/20100523114430_add_ubuntu_custom_lvm_ptable.rb
@@ -0,0 +1,67 @@
+class AddUbuntuCustomLvmPtable < ActiveRecord::Migration
+  def self.up
+    Ptable.create :name => "Ubuntu custom LVM", :layout => <<EOF
+d-i partman-auto/disk string /dev/sda
+d-i partman-auto/method string lvm
+
+d-i partman-lvm/device_remove_lvm boolean true
+d-i partman-md/device_remove_md boolean true
+d-i partman-lvm/confirm boolean true
+d-i partman-lvm/confirm_nooverwrite boolean true
+
+d-i partman-auto/init_automatically_partition \\
+	select Guided - use entire disk and set up LVM
+
+d-i partman-auto-lvm/guided_size string max
+d-i partman-auto-lvm/new_vg_name string vg00
+
+d-i partman-auto/expert_recipe string                         \\
+      boot-root ::                                            \\
+              64 128 128 ext3                                 \\
+                      $primary{ } $bootable{ }                \\
+                      method{ format } format{ }              \\
+                      use_filesystem{ } filesystem{ ext4 }    \\
+                      mountpoint{ /boot }                     \\
+              .                                               \\
+              128 512 200% linux-swap                         \\
+                      method{ swap } format{ }                \\
+              .                                               \\
+              512 512 512 ext3                                \\
+                      method{ format } format{ } $lvmok{ }    \\
+                      use_filesystem{ } filesystem{ ext4 }    \\
+                      mountpoint{ / }                         \\
+              .                                               \\
+              256 256 256 ext3                                \\
+                      method{ format } format{ } $lvmok{ }    \\
+                      use_filesystem{ } filesystem{ ext4 }    \\
+                      mountpoint{ /home }                     \\
+              .                                               \\
+              256 512 512 ext3                                \\
+                      method{ format } format{ } $lvmok{ }    \\
+                      use_filesystem{ } filesystem{ ext4 }    \\
+                      mountpoint{ /tmp }                      \\
+              .                                               \\
+              2048 4096 4096 ext3                             \\
+                      method{ format } format{ } $lvmok{ }    \\
+                      use_filesystem{ } filesystem{ ext4 }    \\
+                      mountpoint{ /usr }                      \\
+              .                                               \\
+              2048 4096 -1 ext3                               \\
+                      method{ format } format{ } $lvmok{ }    \\
+                      use_filesystem{ } filesystem{ ext4 }    \\
+                      mountpoint{ /var }                      \\
+              .
+
+d-i partman/default_filesystem string ext4
+
+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
+EOF
+  end
+
+  def self.down
+    Ptable.first(:conditions => "name = 'Ubuntu custom LVM'").delete
+  end
+end
