Commits

Kirill Simonov committed 14739d7

Added VM build scripts for Ubuntu 10.04 and 11.10.

  • Participants
  • Parent commits 205900e

Comments (0)

Files changed (7)

tool/data/vm/ubuntu-install.sh

+debian-install.sh

tool/data/vm/ubuntu-isolinux.cfg

+# This is a configuration file for the ISOLINUX boot loader.
+# See http://syslinux.zytor.com/ for general information on ISOLINUX.
+# See https://help.ubuntu.com/11.04/installation-guide/i386/preseed-using.html
+# for information on using boot parameters to preseed questions.
+
+default linux
+label linux
+say Installing Ubuntu Linux...
+kernel /install/vmlinuz
+append vga=normal initrd=/install/initrd.gz debian-installer/locale=en_US console-setup/ask_detect=false keyboard-configuration/layoutcode=us preseed/file=/cdrom/preseed.cfg -- quiet
+

tool/data/vm/ubuntu-lts-install.sh

+ubuntu-install.sh

tool/data/vm/ubuntu-lts-isolinux.cfg

+# This is a configuration file for the ISOLINUX boot loader.
+# See http://syslinux.zytor.com/ for general information on ISOLINUX.
+# See https://help.ubuntu.com/10.04/installation-guide/i386/preseed-using.html
+# for information on using boot parameters to preseed questions.
+
+prompt 1
+timeout 1
+default linux
+label linux
+say Installing Ubuntu Linux...
+kernel /install/vmlinuz
+append vga=normal initrd=/install/initrd.gz debian-installer/locale=en_US console-setup/ask_detect=false console-setup/layoutcode=us preseed/file=/cdrom/preseed.cfg -- quiet
+

tool/data/vm/ubuntu-lts-preseed.cfg

+ubuntu-preseed.cfg

tool/data/vm/ubuntu-preseed.cfg

+# This is an answer file for the Ubuntu installer.
+# See https://help.ubuntu.com/11.04/installation-guide/i386/appendix-preseed.html
+# for the general documentation on preseeding.
+# See https://help.ubuntu.com/11.04/installation-guide/example-preseed.txt
+# for an example of a preseed file.
+
+# Set the locale (noop, must be set as a boot parameter).
+d-i debian-installer/locale string en_US
+
+# Choose the keyboard configuration (noop, must be set as a boot parameter).
+d-i console-setup/ask_detect boolean false
+d-i keyboard-configuration/layoutcode string us
+
+# Set the hostname and the domain.
+d-i netcfg/get_hostname string linux-vm
+d-i netcfg/get_domain string
+
+# The hardware clock is set to UTC.
+d-i clock-setup/utc boolean true
+
+# Select the time zone (we might want to use UTC here).
+d-i time/zone string US/Eastern
+
+# Choose regular partitioning, no LVM or encryption.
+d-i partman-auto/method string regular
+
+# We need to provide a custom partitioning recipe because the Oracle server
+# (and the client) requires a larger swap than provided by default.
+# So we allocate 2G for the swap (twice as much as required by Oracle)
+# and give the rest for the root filesystem.
+#
+# For general description of the recipe format, see
+# partman-auto-recipe.txt in the debian-installer package.
+d-i partman-auto/expert_recipe string   \
+    fs-recipe :                         \
+        1024 65536 65536 ext3           \
+            $primary{ }                 \
+            $bootable{ }                \
+            method{ format }            \
+            format{ }                   \
+            use_filesystem{ }           \
+            filesystem{ ext3 }          \
+            mountpoint{ / }             \
+        .                               \
+        2048 2048 2048 linux-swap       \
+            method{ swap }              \
+            format{ }                   \
+        .
+
+# Confirm the partitioning.
+d-i partman-partitioning/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
+
+# Enable and set the root password: root.
+d-i passwd/root-login boolean true
+d-i passwd/root-password password root
+d-i passwd/root-password-again password root
+
+# Do not create a regular user.
+d-i passwd/make-user boolean false
+
+# Do not warn about weak passwords.
+d-i user-setup/allow-password-weak boolean true
+
+# Select APT mirror and proxy settings.
+d-i mirror/country string US
+d-i mirror/http/mirror select us.archive.ubuntu.com
+d-i mirror/http/proxy string
+
+# Package selection: standard.
+tasksel tasksel/first multiselect standard
+
+# Additional packages to install.
+d-i pkgsel/include string openssh-server build-essential
+
+# Indicate how to upgrade packages after debootstrap.
+d-i pkgsel/upgrade select safe-upgrade
+
+# No automatic updates.
+d-i pkgsel/update-policy select none
+
+# Do not participate in the popularity contest.
+popularity-contest popularity-contest/participate boolean false
+
+# Install the boot loader to the MBR.
+d-i grub-installer/only_debian boolean true
+
+# Execute the post-installation script in the chrooted environment.
+d-i preseed/late_command string         \
+    cp /cdrom/install.sh /target/;      \
+    cp /cdrom/identity.pub /target/;    \
+    in-target /install.sh;              \
+    rm /target/install.sh /target/identity.pub
+
+# Skip the reboot warning.
+d-i finish-install/reboot_in_progress note
+
+# Power off the machine after the installation is complete.
+d-i debian-installer/exit/poweroff boolean true
+
     "http://cdimage.debian.org/cdimage/release/6.0.3/i386/iso-cd/debian-6.0.3-i386-netinst.iso",
 ]
 
+UBUNTU_ISO_URLS = [
+    "http://releases.ubuntu.com/oneiric/ubuntu-11.10-server-i386.iso",
+]
+
+UBUNTU_LTS_ISO_URLS = [
+    "http://releases.ubuntu.com/lucid/ubuntu-10.04.4-server-i386.iso",
+]
+
 CENTOS_ISO_URLS = [
     "http://mirrors.cmich.edu/centos/6.2/isos/i386/CentOS-6.2-i386-minimal.iso",
 ]
 class DebianTemplateVM(VM):
     # Debian 6.0 "squeeze" (32-bit) VM.
 
-    def __init__(self, name):
+    def __init__(self, name, iso_env="DEBIAN_ISO", iso_urls=DEBIAN_ISO_URLS):
         super(DebianTemplateVM, self).__init__(name, 'linux')
+        self.iso_env = iso_env
+        self.iso_urls = iso_urls
 
     def build(self):
         super(DebianTemplateVM, self).build()
         log("building VM: `%s`..." % self.name)
         start_time = datetime.datetime.now()
-        src_iso_path = os.environ.get("DEBIAN_ISO")
+        src_iso_path = os.environ.get(self.iso_env)
         if not (src_iso_path and os.path.isfile(src_iso_path)):
-            src_iso_path = self.download(DEBIAN_ISO_URLS)
+            src_iso_path = self.download(self.iso_urls)
         unpack_path = TMP_DIR+"/"+self.name
         if os.path.exists(unpack_path):
             rmtree(unpack_path)
 debian_vm = DebianTemplateVM('debian')
 centos_vm = CentOSTemplateVM('centos')
 windows_vm = WindowsTemplateVM('windows')
+ubuntu_vm = DebianTemplateVM('ubuntu',
+                             iso_env="UBUNTU_ISO",
+                             iso_urls=UBUNTU_ISO_URLS)
+ubuntu_lts_vm = DebianTemplateVM('ubuntu-lts',
+                                 iso_env="UBUNTU_LTS_ISO",
+                                 iso_urls=UBUNTU_LTS_ISO_URLS)
 
 
 @job