From ac38214011c2208fb3766cac49066ebbda374493 Mon Sep 17 00:00:00 2001 From: Quentin Smith Date: Mon, 27 Dec 2010 00:31:53 -0500 Subject: [PATCH] Support debian-installer based preseeded installations --- code/controls.py | 16 +++++++----- code/static/preseed/maverick/amd64.preseed | 37 ++++++++++++++++++++++++++++ debian/changelog | 6 +++++ 3 files changed, 53 insertions(+), 6 deletions(-) create mode 100644 code/static/preseed/maverick/amd64.preseed diff --git a/code/controls.py b/code/controls.py index 2a86a89..faa27a7 100644 --- a/code/controls.py +++ b/code/controls.py @@ -47,12 +47,16 @@ def lvinstall(machine, autoinstall): memsize = machine.memory swapsize = getswap(disksize, memsize) imagesize = disksize - swapsize - ip = machine.nics[0].ip - remctl('control', machine.name, 'install', - 'dist=%s' % autoinstall.distribution, - 'mirror=%s' % autoinstall.mirror, - 'arch=%s' % autoinstall.arch, - 'imagesize=%s' % imagesize) + + installer_options = ['dist=%s' % autoinstall.distribution, + 'mirror=%s' % autoinstall.mirror, + 'arch=%s' % autoinstall.arch, + 'imagesize=%s' % imagesize] + if autoinstall.preseed: + installer_options += ['preseed=http://'+config.web.hostname+'/static/preseed/'+autoinstall.distribution+'/'+autoinstall.arch+'.preseed'] + + remctl('control', machine.name, 'install', + *installer_options) def lvcopy(machine_orig_name, machine, rootpw): """Copy a golden image onto a machine's disk""" diff --git a/code/static/preseed/maverick/amd64.preseed b/code/static/preseed/maverick/amd64.preseed new file mode 100644 index 0000000..fc581b0 --- /dev/null +++ b/code/static/preseed/maverick/amd64.preseed @@ -0,0 +1,37 @@ +# Download packages from mirrors.mit.edu +d-i mirror/country string enter information manually +d-i mirror/http/countries string manual +d-i mirror/http/hostname string mirrors.mit.edu +d-i mirror/http/directory string /ubuntu/ +d-i mirror/http/proxy string + +# Use time.mit.edu for NTP syncing +d-i clock-setup/ntp-server string time.mit.edu + +# Guided partitioning with LVM +d-i partman-auto/method string lvm +d-i partman-auto/choose_recipe select atomic +d-i partman-lvm/confirm boolean true +d-i partman-lvm/confirm_nooverwrite boolean true +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 + +# Use the linux-virtual kernel +d-i base-installer/kernel/image string linux-virtual + +# Create just a root account +d-i passwd/root-login boolean true +d-i passwd/root-password string fake_value +d-i passwd/root-password-again string fake_value +d-i passwd/make-user boolean false + +# Use GRUB 1 so PyGrub can read the menu.lst +d-i grub-installer/grub2_instead_of_grub_legacy boolean false + +# Remove the root password so users can log in on the console +d-i preseed/late_command string in-target passwd -d root + +# Avoid that last message about the install being complete. +d-i finish-install/reboot_in_progress note diff --git a/debian/changelog b/debian/changelog index 4841af2..a94f1ae 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +invirt-web (0.1.13) unstable; urgency=low + + * Support preseed-based autoinstalls, including amd64 maverick. + + -- Quentin Smith Sun, 26 Dec 2010 23:47:21 -0500 + invirt-web (0.1.10) unstable; urgency=low * Enable VM creation by default -- 1.7.9.5